* Function to set up widgets depending on the information being shown on the smallmap. */
| 1265 | * Function to set up widgets depending on the information being shown on the smallmap. |
| 1266 | */ |
| 1267 | void SetupWidgetData() |
| 1268 | { |
| 1269 | StringID legend_tooltip; |
| 1270 | StringID enable_all_tooltip; |
| 1271 | StringID disable_all_tooltip; |
| 1272 | int industry_names_select_plane; |
| 1273 | int select_buttons_plane; |
| 1274 | switch (this->map_type) { |
| 1275 | case SMT_INDUSTRY: |
| 1276 | legend_tooltip = STR_SMALLMAP_TOOLTIP_INDUSTRY_SELECTION; |
| 1277 | enable_all_tooltip = STR_SMALLMAP_TOOLTIP_ENABLE_ALL_INDUSTRIES; |
| 1278 | disable_all_tooltip = STR_SMALLMAP_TOOLTIP_DISABLE_ALL_INDUSTRIES; |
| 1279 | industry_names_select_plane = 0; |
| 1280 | select_buttons_plane = 0; |
| 1281 | break; |
| 1282 | |
| 1283 | case SMT_OWNER: |
| 1284 | legend_tooltip = STR_SMALLMAP_TOOLTIP_COMPANY_SELECTION; |
| 1285 | enable_all_tooltip = STR_SMALLMAP_TOOLTIP_ENABLE_ALL_COMPANIES; |
| 1286 | disable_all_tooltip = STR_SMALLMAP_TOOLTIP_DISABLE_ALL_COMPANIES; |
| 1287 | industry_names_select_plane = SZSP_NONE; |
| 1288 | select_buttons_plane = 0; |
| 1289 | break; |
| 1290 | |
| 1291 | case SMT_LINKSTATS: |
| 1292 | legend_tooltip = STR_SMALLMAP_TOOLTIP_CARGO_SELECTION; |
| 1293 | enable_all_tooltip = STR_SMALLMAP_TOOLTIP_ENABLE_ALL_CARGOS; |
| 1294 | disable_all_tooltip = STR_SMALLMAP_TOOLTIP_DISABLE_ALL_CARGOS; |
| 1295 | industry_names_select_plane = SZSP_NONE; |
| 1296 | select_buttons_plane = 0; |
| 1297 | break; |
| 1298 | |
| 1299 | default: |
| 1300 | legend_tooltip = STR_NULL; |
| 1301 | enable_all_tooltip = STR_NULL; |
| 1302 | disable_all_tooltip = STR_NULL; |
| 1303 | industry_names_select_plane = SZSP_NONE; |
| 1304 | select_buttons_plane = 1; |
| 1305 | break; |
| 1306 | } |
| 1307 | |
| 1308 | this->GetWidget<NWidgetCore>(WID_SM_LEGEND)->SetToolTip(legend_tooltip); |
| 1309 | this->GetWidget<NWidgetCore>(WID_SM_ENABLE_ALL)->SetStringTip(STR_SMALLMAP_ENABLE_ALL, enable_all_tooltip); |
| 1310 | this->GetWidget<NWidgetCore>(WID_SM_DISABLE_ALL)->SetStringTip(STR_SMALLMAP_DISABLE_ALL, disable_all_tooltip); |
| 1311 | this->GetWidget<NWidgetStacked>(WID_SM_SHOW_IND_NAMES_SEL)->SetDisplayedPlane(industry_names_select_plane); |
| 1312 | this->GetWidget<NWidgetStacked>(WID_SM_SELECT_BUTTONS)->SetDisplayedPlane(select_buttons_plane); |
| 1313 | } |
| 1314 | |
| 1315 | /** |
| 1316 | * Decide which colours to show to the user for a group of tiles. |
no test coverage detected