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

@@ -1019,7 +1019,7 @@ static Hotkey railtoolbar_hotkeys[] = {
};
HotkeyList BuildRailToolbarWindow::hotkeys("railtoolbar", railtoolbar_hotkeys, RailToolbarGlobalHotkeys);
static const NWidgetPart _nested_build_rail_widgets[] = {
static constexpr NWidgetPart _nested_build_rail_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
NWidget(WWT_CAPTION, COLOUR_DARK_GREEN, WID_RAT_CAPTION), SetDataTip(STR_JUST_STRING2, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS), SetTextStyle(TC_WHITE),
@@ -1238,12 +1238,12 @@ public:
this->FinishInitNested(TRANSPORT_RAIL);
this->LowerWidget(_railstation.orientation + WID_BRAS_PLATFORM_DIR_X);
this->LowerWidget(WID_BRAS_PLATFORM_DIR_X + _railstation.orientation);
if (_settings_client.gui.station_dragdrop) {
this->LowerWidget(WID_BRAS_PLATFORM_DRAG_N_DROP);
} else {
this->LowerWidget(_settings_client.gui.station_numtracks + WID_BRAS_PLATFORM_NUM_BEGIN);
this->LowerWidget(_settings_client.gui.station_platlength + WID_BRAS_PLATFORM_LEN_BEGIN);
this->LowerWidget(WID_BRAS_PLATFORM_NUM_BEGIN + _settings_client.gui.station_numtracks);
this->LowerWidget(WID_BRAS_PLATFORM_LEN_BEGIN + _settings_client.gui.station_platlength);
}
this->SetWidgetLoweredState(WID_BRAS_HIGHLIGHT_OFF, !_settings_client.gui.station_show_coverage);
this->SetWidgetLoweredState(WID_BRAS_HIGHLIGHT_ON, _settings_client.gui.station_show_coverage);
@@ -1570,9 +1570,9 @@ public:
switch (widget) {
case WID_BRAS_PLATFORM_DIR_X:
case WID_BRAS_PLATFORM_DIR_Y:
this->RaiseWidget(_railstation.orientation + WID_BRAS_PLATFORM_DIR_X);
this->RaiseWidget(WID_BRAS_PLATFORM_DIR_X + _railstation.orientation);
_railstation.orientation = (Axis)(widget - WID_BRAS_PLATFORM_DIR_X);
this->LowerWidget(_railstation.orientation + WID_BRAS_PLATFORM_DIR_X);
this->LowerWidget(WID_BRAS_PLATFORM_DIR_X + _railstation.orientation);
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
this->SetDirty();
CloseWindowById(WC_SELECT_STATION, 0);
@@ -1585,7 +1585,7 @@ public:
case WID_BRAS_PLATFORM_NUM_5:
case WID_BRAS_PLATFORM_NUM_6:
case WID_BRAS_PLATFORM_NUM_7: {
this->RaiseWidget(_settings_client.gui.station_numtracks + WID_BRAS_PLATFORM_NUM_BEGIN);
this->RaiseWidget(WID_BRAS_PLATFORM_NUM_BEGIN + _settings_client.gui.station_numtracks);
this->RaiseWidget(WID_BRAS_PLATFORM_DRAG_N_DROP);
_settings_client.gui.station_numtracks = widget - WID_BRAS_PLATFORM_NUM_BEGIN;
@@ -1766,7 +1766,7 @@ BuildRailStationWindow::GUIStationClassList::FilterFunction * const BuildRailSta
&TagNameFilter,
};
static const NWidgetPart _nested_station_builder_widgets[] = {
static constexpr NWidgetPart _nested_station_builder_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
NWidget(WWT_CAPTION, COLOUR_DARK_GREEN), SetDataTip(STR_STATION_BUILD_RAIL_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
@@ -2272,7 +2272,7 @@ static Hotkey signaltoolbar_hotkeys[] = {
HotkeyList BuildSignalWindow::hotkeys("signaltoolbar", signaltoolbar_hotkeys);
/** Nested widget definition of the build signal window */
static const NWidgetPart _nested_signal_builder_widgets[] = {
static constexpr NWidgetPart _nested_signal_builder_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
NWidget(WWT_CAPTION, COLOUR_DARK_GREEN, WID_BS_CAPTION), SetDataTip(STR_BUILD_SIGNAL_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
@@ -2368,7 +2368,7 @@ struct BuildRailDepotWindow : public PickerWindowBase {
BuildRailDepotWindow(WindowDesc *desc, Window *parent) : PickerWindowBase(desc, parent)
{
this->InitNested(TRANSPORT_RAIL);
this->LowerWidget(_build_depot_direction + WID_BRAD_DEPOT_NE);
this->LowerWidget(WID_BRAD_DEPOT_NE + _build_depot_direction);
}
void UpdateWidgetSize(WidgetID widget, Dimension *size, [[maybe_unused]] const Dimension &padding, [[maybe_unused]] Dimension *fill, [[maybe_unused]] Dimension *resize) override
@@ -2400,9 +2400,9 @@ struct BuildRailDepotWindow : public PickerWindowBase {
case WID_BRAD_DEPOT_SE:
case WID_BRAD_DEPOT_SW:
case WID_BRAD_DEPOT_NW:
this->RaiseWidget(_build_depot_direction + WID_BRAD_DEPOT_NE);
this->RaiseWidget(WID_BRAD_DEPOT_NE + _build_depot_direction);
_build_depot_direction = (DiagDirection)(widget - WID_BRAD_DEPOT_NE);
this->LowerWidget(_build_depot_direction + WID_BRAD_DEPOT_NE);
this->LowerWidget(WID_BRAD_DEPOT_NE + _build_depot_direction);
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
this->SetDirty();
break;
@@ -2411,7 +2411,7 @@ struct BuildRailDepotWindow : public PickerWindowBase {
};
/** Nested widget definition of the build rail depot window */
static const NWidgetPart _nested_build_depot_widgets[] = {
static constexpr NWidgetPart _nested_build_depot_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
NWidget(WWT_CAPTION, COLOUR_DARK_GREEN), SetDataTip(STR_BUILD_DEPOT_TRAIN_ORIENTATION_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
@@ -2644,7 +2644,7 @@ struct BuildRailWaypointWindow : PickerWindowBase {
/* static */ QueryString BuildRailWaypointWindow::editbox(BuildRailWaypointWindow::FILTER_LENGTH * MAX_CHAR_LENGTH, BuildRailWaypointWindow::FILTER_LENGTH);
/** Nested widget definition for the build NewGRF rail waypoint window */
static const NWidgetPart _nested_build_waypoint_widgets[] = {
static constexpr NWidgetPart _nested_build_waypoint_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
NWidget(WWT_CAPTION, COLOUR_DARK_GREEN), SetDataTip(STR_WAYPOINT_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),