|
@@ -42,15 +42,15 @@ enum SmallMapWindowWidgets {
|
|
|
SM_WIDGET_INDUSTRIES, ///< Button to select the industries view.
|
|
|
SM_WIDGET_ROUTES, ///< Button to select the routes view.
|
|
|
SM_WIDGET_VEGETATION, ///< Button to select the vegetation view.
|
|
|
SM_WIDGET_OWNERS, ///< Button to select the owners view.
|
|
|
SM_WIDGET_CENTERMAP, ///< Button to move smallmap center to main window center.
|
|
|
SM_WIDGET_TOGGLETOWNNAME, ///< Toggle button to display town names.
|
|
|
SM_WIDGET_SELECTINDUSTRIES, ///< Selection widget for the buttons at the industry mode.
|
|
|
SM_WIDGET_ENABLEINDUSTRIES, ///< Button to enable display of all industries.
|
|
|
SM_WIDGET_DISABLEINDUSTRIES, ///< Button to disable display of all industries.
|
|
|
SM_WIDGET_SELECT_BUTTONS, ///< Selection widget for the buttons present in some smallmap modes.
|
|
|
SM_WIDGET_ENABLE_ALL, ///< Button to enable display of all legend entries.
|
|
|
SM_WIDGET_DISABLE_ALL, ///< Button to disable display of all legend entries.
|
|
|
SM_WIDGET_SHOW_HEIGHT, ///< Show heightmap toggle button.
|
|
|
};
|
|
|
|
|
|
static int _smallmap_industry_count; ///< Number of used industries
|
|
|
static int _smallmap_company_count; ///< Number of entries in the owner legend.
|
|
|
|
|
@@ -1039,13 +1039,13 @@ public:
|
|
|
|
|
|
_smallmap_industry_show_heightmap = false;
|
|
|
BuildLandLegend();
|
|
|
this->SetWidgetLoweredState(SM_WIDGET_SHOW_HEIGHT, _smallmap_industry_show_heightmap);
|
|
|
|
|
|
this->SetWidgetLoweredState(SM_WIDGET_TOGGLETOWNNAME, this->show_towns);
|
|
|
this->GetWidget<NWidgetStacked>(SM_WIDGET_SELECTINDUSTRIES)->SetDisplayedPlane(this->map_type != SMT_INDUSTRY);
|
|
|
this->GetWidget<NWidgetStacked>(SM_WIDGET_SELECT_BUTTONS)->SetDisplayedPlane(this->map_type != SMT_INDUSTRY);
|
|
|
|
|
|
this->SetupWidgetData();
|
|
|
|
|
|
this->SetZoomLevel(ZLC_INITIALIZE, NULL);
|
|
|
this->SmallMapCenterOnCurrentPos();
|
|
|
}
|
|
@@ -1209,13 +1209,13 @@ public:
|
|
|
{
|
|
|
this->RaiseWidget(this->map_type + SM_WIDGET_CONTOUR);
|
|
|
this->map_type = map_type;
|
|
|
this->LowerWidget(this->map_type + SM_WIDGET_CONTOUR);
|
|
|
|
|
|
/* Hide Enable all/Disable all buttons if is not industry type small map */
|
|
|
this->GetWidget<NWidgetStacked>(SM_WIDGET_SELECTINDUSTRIES)->SetDisplayedPlane(this->map_type != SMT_INDUSTRY);
|
|
|
this->GetWidget<NWidgetStacked>(SM_WIDGET_SELECT_BUTTONS)->SetDisplayedPlane(this->map_type != SMT_INDUSTRY);
|
|
|
|
|
|
this->SetupWidgetData();
|
|
|
|
|
|
this->SetDirty();
|
|
|
}
|
|
|
|
|
@@ -1361,20 +1361,20 @@ public:
|
|
|
}
|
|
|
}
|
|
|
this->SetDirty();
|
|
|
}
|
|
|
break;
|
|
|
|
|
|
case SM_WIDGET_ENABLEINDUSTRIES: // Enable all industries
|
|
|
case SM_WIDGET_ENABLE_ALL: // Enable all industries
|
|
|
for (int i = 0; i != _smallmap_industry_count; i++) {
|
|
|
_legend_from_industries[i].show_on_map = true;
|
|
|
}
|
|
|
this->SetDirty();
|
|
|
break;
|
|
|
|
|
|
case SM_WIDGET_DISABLEINDUSTRIES: // Disable all industries
|
|
|
case SM_WIDGET_DISABLE_ALL: // Disable all industries
|
|
|
for (int i = 0; i != _smallmap_industry_count; i++) {
|
|
|
_legend_from_industries[i].show_on_map = false;
|
|
|
}
|
|
|
this->SetDirty();
|
|
|
break;
|
|
|
|
|
@@ -1643,16 +1643,16 @@ static const NWidgetPart _nested_smallma
|
|
|
EndContainer(),
|
|
|
NWidgetFunction(SmallMapDisplay), // Smallmap display and legend bar + image buttons.
|
|
|
/* Bottom button row and resize box. */
|
|
|
NWidget(NWID_HORIZONTAL),
|
|
|
NWidget(WWT_PANEL, COLOUR_BROWN),
|
|
|
NWidget(NWID_HORIZONTAL),
|
|
|
NWidget(NWID_SELECTION, INVALID_COLOUR, SM_WIDGET_SELECTINDUSTRIES),
|
|
|
NWidget(NWID_SELECTION, INVALID_COLOUR, SM_WIDGET_SELECT_BUTTONS),
|
|
|
NWidget(NWID_HORIZONTAL, NC_EQUALSIZE),
|
|
|
NWidget(WWT_PUSHTXTBTN, COLOUR_BROWN, SM_WIDGET_ENABLEINDUSTRIES), SetDataTip(STR_SMALLMAP_ENABLE_ALL, STR_SMALLMAP_TOOLTIP_ENABLE_ALL),
|
|
|
NWidget(WWT_PUSHTXTBTN, COLOUR_BROWN, SM_WIDGET_DISABLEINDUSTRIES), SetDataTip(STR_SMALLMAP_DISABLE_ALL, STR_SMALLMAP_TOOLTIP_DISABLE_ALL),
|
|
|
NWidget(WWT_PUSHTXTBTN, COLOUR_BROWN, SM_WIDGET_ENABLE_ALL), SetDataTip(STR_SMALLMAP_ENABLE_ALL, STR_SMALLMAP_TOOLTIP_ENABLE_ALL_INDUSTRIES),
|
|
|
NWidget(WWT_PUSHTXTBTN, COLOUR_BROWN, SM_WIDGET_DISABLE_ALL), SetDataTip(STR_SMALLMAP_DISABLE_ALL, STR_SMALLMAP_TOOLTIP_DISABLE_ALL_INDUSTRIES),
|
|
|
NWidget(WWT_TEXTBTN, COLOUR_BROWN, SM_WIDGET_SHOW_HEIGHT), SetDataTip(STR_SMALLMAP_SHOW_HEIGHT, STR_SMALLMAP_TOOLTIP_SHOW_HEIGHT),
|
|
|
EndContainer(),
|
|
|
NWidget(NWID_SPACER), SetFill(1, 1),
|
|
|
EndContainer(),
|
|
|
NWidget(NWID_SPACER), SetFill(1, 0), SetResize(1, 0),
|
|
|
EndContainer(),
|