Merge branch 'master' into jgrpp

# Conflicts:
#	src/airport_gui.cpp
#	src/build_vehicle_gui.cpp
#	src/direction_type.h
#	src/gfx_type.h
#	src/group_gui.cpp
#	src/misc_gui.cpp
#	src/rail_gui.cpp
#	src/road_gui.cpp
#	src/signs_gui.cpp
#	src/slope_func.h
#	src/smallmap_gui.cpp
#	src/terraform_gui.cpp
#	src/toolbar_gui.cpp
#	src/town_gui.cpp
#	src/town_type.h
#	src/vehicle_type.h
#	src/widget_type.h
This commit is contained in:
Jonathan G Rennison
2024-01-21 22:24:49 +00:00
105 changed files with 1193 additions and 1227 deletions

View File

@@ -1067,7 +1067,7 @@ SmallMapWindow::SmallMapWindow(WindowDesc *desc, int window_number) : Window(des
_smallmap_industry_highlight = INVALID_INDUSTRYTYPE;
this->overlay = std::make_unique<LinkGraphOverlay>(this, WID_SM_MAP, 0, this->GetOverlayCompanyMask(), 1);
this->InitNested(window_number);
this->LowerWidget(this->map_type + WID_SM_CONTOUR);
this->LowerWidget(WID_SM_CONTOUR + this->map_type);
this->RebuildColourIndexIfNecessary();
@@ -1295,9 +1295,9 @@ void SmallMapWindow::RebuildColourIndexIfNecessary()
*/
void SmallMapWindow::SwitchMapType(SmallMapType map_type)
{
this->RaiseWidget(this->map_type + WID_SM_CONTOUR);
this->RaiseWidget(WID_SM_CONTOUR + this->map_type);
this->map_type = map_type;
this->LowerWidget(this->map_type + WID_SM_CONTOUR);
this->LowerWidget(WID_SM_CONTOUR + this->map_type);
this->SetupWidgetData();
@@ -1725,7 +1725,7 @@ void SmallMapWindow::ScreenshotCallbackHandler(void *buf, uint y, uint pitch, ui
this->DrawSmallMap(&dpi, false);
}
SmallMapWindow::SmallMapType SmallMapWindow::map_type = SMT_CONTOUR;
SmallMapType SmallMapWindow::map_type = SMT_CONTOUR;
bool SmallMapWindow::show_towns = true;
int SmallMapWindow::map_height_limit = -1;
@@ -1791,14 +1791,14 @@ public:
};
/** Widget parts of the smallmap display. */
static const NWidgetPart _nested_smallmap_display[] = {
static constexpr NWidgetPart _nested_smallmap_display[] = {
NWidget(WWT_PANEL, COLOUR_BROWN, WID_SM_MAP_BORDER),
NWidget(WWT_INSET, COLOUR_BROWN, WID_SM_MAP), SetMinimalSize(346, 140), SetResize(1, 1), SetPadding(2, 2, 2, 2), EndContainer(),
EndContainer(),
};
/** Widget parts of the smallmap legend bar + image buttons. */
static const NWidgetPart _nested_smallmap_bar[] = {
static constexpr NWidgetPart _nested_smallmap_bar[] = {
NWidget(WWT_PANEL, COLOUR_BROWN),
NWidget(NWID_HORIZONTAL),
NWidget(WWT_EMPTY, INVALID_COLOUR, WID_SM_LEGEND), SetResize(1, 1),
@@ -1849,7 +1849,7 @@ static std::unique_ptr<NWidgetBase> SmallMapDisplay()
}
static const NWidgetPart _nested_smallmap_widgets[] = {
static constexpr NWidgetPart _nested_smallmap_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
NWidget(WWT_CAPTION, COLOUR_BROWN, WID_SM_CAPTION), SetDataTip(STR_SMALLMAP_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),