Merge branch 'master' into jgrpp

# Conflicts:
#	cmake/CompileFlags.cmake
#	src/3rdparty/squirrel/squirrel/sqclosure.h
#	src/3rdparty/squirrel/squirrel/sqobject.h
#	src/3rdparty/squirrel/squirrel/sqvm.h
#	src/aircraft.h
#	src/airport_gui.cpp
#	src/blitter/32bpp_sse_func.hpp
#	src/blitter/null.hpp
#	src/bridge_gui.cpp
#	src/build_vehicle_gui.cpp
#	src/cargotype.h
#	src/cheat_gui.cpp
#	src/command.cpp
#	src/command_func.h
#	src/company_gui.cpp
#	src/console_gui.cpp
#	src/date_gui.cpp
#	src/depot_gui.cpp
#	src/dock_gui.cpp
#	src/economy.cpp
#	src/error_gui.cpp
#	src/fileio.cpp
#	src/fios.cpp
#	src/fios_gui.cpp
#	src/fontcache/spritefontcache.h
#	src/framerate_gui.cpp
#	src/game/game_text.cpp
#	src/gamelog.cpp
#	src/genworld_gui.cpp
#	src/gfx_layout_fallback.cpp
#	src/group_gui.cpp
#	src/highscore_gui.cpp
#	src/hotkeys.cpp
#	src/industry_cmd.cpp
#	src/industry_gui.cpp
#	src/landscape.cpp
#	src/main_gui.cpp
#	src/misc_cmd.cpp
#	src/misc_gui.cpp
#	src/network/core/tcp_game.cpp
#	src/network/core/udp.cpp
#	src/network/network_chat_gui.cpp
#	src/network/network_content_gui.cpp
#	src/network/network_gui.cpp
#	src/network/network_server.cpp
#	src/network/network_server.h
#	src/newgrf_airport.cpp
#	src/newgrf_airport.h
#	src/newgrf_airporttiles.cpp
#	src/newgrf_airporttiles.h
#	src/newgrf_animation_base.h
#	src/newgrf_canal.cpp
#	src/newgrf_commons.h
#	src/newgrf_config.cpp
#	src/newgrf_debug_gui.cpp
#	src/newgrf_engine.cpp
#	src/newgrf_engine.h
#	src/newgrf_generic.cpp
#	src/newgrf_gui.cpp
#	src/newgrf_house.cpp
#	src/newgrf_house.h
#	src/newgrf_industries.cpp
#	src/newgrf_industries.h
#	src/newgrf_industrytiles.cpp
#	src/newgrf_industrytiles.h
#	src/newgrf_object.cpp
#	src/newgrf_object.h
#	src/newgrf_railtype.cpp
#	src/newgrf_railtype.h
#	src/newgrf_roadstop.cpp
#	src/newgrf_roadstop.h
#	src/newgrf_roadtype.cpp
#	src/newgrf_roadtype.h
#	src/newgrf_spritegroup.cpp
#	src/newgrf_spritegroup.h
#	src/newgrf_station.cpp
#	src/newgrf_station.h
#	src/newgrf_town.cpp
#	src/newgrf_town.h
#	src/news_gui.cpp
#	src/object_gui.cpp
#	src/order_gui.cpp
#	src/os/macosx/crashlog_osx.cpp
#	src/os/unix/crashlog_unix.cpp
#	src/os/windows/crashlog_win.cpp
#	src/os/windows/win32.cpp
#	src/os/windows/win32_main.cpp
#	src/pathfinder/npf/npf.cpp
#	src/pathfinder/npf/queue.cpp
#	src/rail_cmd.cpp
#	src/rail_gui.cpp
#	src/road_gui.cpp
#	src/roadveh.h
#	src/saveload/saveload.cpp
#	src/screenshot.cpp
#	src/script/api/script_text.hpp
#	src/settings.cpp
#	src/settings_gui.cpp
#	src/settings_internal.h
#	src/settings_table.cpp
#	src/signs_cmd.cpp
#	src/signs_gui.cpp
#	src/smallmap_gui.cpp
#	src/smallmap_gui.h
#	src/spriteloader/grf.hpp
#	src/station_cmd.cpp
#	src/station_gui.cpp
#	src/station_map.h
#	src/statusbar_gui.cpp
#	src/stdafx.h
#	src/strgen/strgen.cpp
#	src/table/newgrf_debug_data.h
#	src/terraform_gui.cpp
#	src/timer/timer_game_calendar.cpp
#	src/timer/timer_window.cpp
#	src/town.h
#	src/town_cmd.cpp
#	src/town_gui.cpp
#	src/train_gui.cpp
#	src/transparency_gui.cpp
#	src/vehicle_gui.cpp
#	src/water_cmd.cpp
#	src/waypoint_cmd.cpp
#	src/widget.cpp
#	src/widget_type.h
#	src/widgets/dropdown.cpp
#	src/widgets/rail_widget.h
#	src/widgets/terraform_widget.h
#	src/window.cpp
#	src/window_gui.h
This commit is contained in:
Jonathan G Rennison
2023-11-20 22:26:57 +00:00
278 changed files with 1680 additions and 1495 deletions

View File

@@ -510,7 +510,7 @@ struct BuildRailToolbarWindow : Window {
this->InitNested(TRANSPORT_RAIL);
this->SetupRailToolbar(railtype);
this->DisableWidget(WID_RAT_REMOVE);
this->last_user_action = WIDGET_LIST_END;
this->last_user_action = INVALID_WID_RAT;
if (_settings_client.gui.link_terraform_toolbar) ShowTerraformToolbar(this);
}
@@ -785,7 +785,7 @@ struct BuildRailToolbarWindow : Window {
}
}
void OnPlaceObject(Point pt, TileIndex tile) override
void OnPlaceObject([[maybe_unused]] Point pt, TileIndex tile) override
{
switch (this->last_user_action) {
case WID_RAT_BUILD_NS:
@@ -851,7 +851,7 @@ struct BuildRailToolbarWindow : Window {
}
}
void OnPlaceDrag(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt) override
void OnPlaceDrag(ViewportPlaceMethod select_method, [[maybe_unused]] ViewportDragDropSelectionProcess select_proc, [[maybe_unused]] Point pt) override
{
/* no dragging if you have pressed the convert button */
if (FindWindowById(WC_BUILD_SIGNAL, 0) != nullptr && _convert_signal_button && this->IsWidgetLowered(WID_RAT_BUILD_SIGNALS)) return;
@@ -859,7 +859,7 @@ struct BuildRailToolbarWindow : Window {
VpSelectTilesWithMethod(pt.x, pt.y, select_method);
}
void OnPlaceMouseUp(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt, TileIndex start_tile, TileIndex end_tile) override
void OnPlaceMouseUp([[maybe_unused]] ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, [[maybe_unused]] Point pt, TileIndex start_tile, TileIndex end_tile) override
{
if (pt.x != -1) {
switch (select_proc) {
@@ -939,7 +939,7 @@ struct BuildRailToolbarWindow : Window {
CloseWindowByClass(WC_BUILD_BRIDGE);
}
void OnPlacePresize(Point pt, TileIndex tile) override
void OnPlacePresize([[maybe_unused]] Point pt, TileIndex tile) override
{
DoCommand(tile, _cur_railtype | (TRANSPORT_RAIL << 8), 0, DC_AUTO, CMD_BUILD_TUNNEL);
VpSetPresizeRange(tile, _build_tunnel_endtile == 0 ? tile : _build_tunnel_endtile);
@@ -952,7 +952,7 @@ struct BuildRailToolbarWindow : Window {
return ES_NOT_HANDLED;
}
void OnRealtimeTick(uint delta_ms) override
void OnRealtimeTick([[maybe_unused]] uint delta_ms) override
{
if (this->IsWidgetLowered(WID_RAT_BUILD_WAYPOINT)) CheckRedrawWaypointCoverage(this, false);
}
@@ -1324,7 +1324,7 @@ public:
_railstation.station_class = station_class;
}
void OnInvalidateData(int data = 0, bool gui_scope = true) override
void OnInvalidateData([[maybe_unused]] int data = 0, [[maybe_unused]] bool gui_scope = true) override
{
if (!gui_scope) return;
@@ -1346,12 +1346,14 @@ public:
return ES_HANDLED;
}
void OnEditboxChanged(int wid) override
void OnEditboxChanged(int widget) override
{
string_filter.SetFilterTerm(this->filter_editbox.text.buf);
this->station_classes.SetFilterState(!string_filter.IsEmpty());
this->station_classes.ForceRebuild();
this->InvalidateData();
if (widget == WID_BRAS_FILTER_EDITBOX) {
string_filter.SetFilterTerm(this->filter_editbox.text.buf);
this->station_classes.SetFilterState(!string_filter.IsEmpty());
this->station_classes.ForceRebuild();
this->InvalidateData();
}
}
void OnPaint() override
@@ -1403,7 +1405,7 @@ public:
}
}
void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override
void UpdateWidgetSize(int widget, Dimension *size, [[maybe_unused]] const Dimension &padding, [[maybe_unused]] Dimension *fill, [[maybe_unused]] Dimension *resize) override
{
switch (widget) {
case WID_BRAS_NEWST_LIST: {
@@ -1541,7 +1543,7 @@ public:
}
}
void OnClick(Point pt, int widget, int click_count) override
void OnClick([[maybe_unused]] Point pt, int widget, [[maybe_unused]] int click_count) override
{
switch (GB(widget, 0, 16)) {
case WID_BRAS_PLATFORM_DIR_X:
@@ -1697,7 +1699,7 @@ public:
}
}
void OnRealtimeTick(uint delta_ms) override
void OnRealtimeTick([[maybe_unused]] uint delta_ms) override
{
CheckRedrawStationCoverage(this);
}
@@ -1950,11 +1952,11 @@ private:
this->GetWidget<NWidgetStacked>(WID_BS_ELECTRIC_NOEN_SEL)->SetDisplayedPlane(this->noentry_ui_shown ? 0 : SZSP_NONE);
this->GetWidget<NWidgetStacked>(WID_BS_PROGRAM_SEL)->SetDisplayedPlane(show_progsig ? 0 : 1);
this->SetWidgetDisabledState(WID_BS_PROGRAM, !show_progsig);
this->SetWidgetsDisabledState(!show_norm, WID_BS_SEMAPHORE_NORM, WID_BS_ELECTRIC_NORM, WIDGET_LIST_END);
this->SetWidgetsDisabledState(!show_norm, WID_BS_SEMAPHORE_NORM, WID_BS_ELECTRIC_NORM);
this->SetWidgetsDisabledState(!show_presig, WID_BS_SEMAPHORE_ENTRY, WID_BS_ELECTRIC_ENTRY, WID_BS_SEMAPHORE_EXIT,
WID_BS_ELECTRIC_EXIT, WID_BS_SEMAPHORE_COMBO, WID_BS_ELECTRIC_COMBO, WIDGET_LIST_END);
this->SetWidgetsDisabledState(!show_progsig, WID_BS_SEMAPHORE_PROG, WID_BS_ELECTRIC_PROG, WIDGET_LIST_END);
this->SetWidgetsDisabledState(!this->noentry_ui_shown, WID_BS_SEMAPHORE_NO_ENTRY, WID_BS_ELECTRIC_NO_ENTRY, WIDGET_LIST_END);
WID_BS_ELECTRIC_EXIT, WID_BS_SEMAPHORE_COMBO, WID_BS_ELECTRIC_COMBO);
this->SetWidgetsDisabledState(!show_progsig, WID_BS_SEMAPHORE_PROG, WID_BS_ELECTRIC_PROG);
this->SetWidgetsDisabledState(!this->noentry_ui_shown, WID_BS_SEMAPHORE_NO_ENTRY, WID_BS_ELECTRIC_NO_ENTRY);
this->GetWidget<NWidgetStacked>(WID_BS_TOGGLE_SIZE_SEL)->SetDisplayedPlane(!this->realistic_braking_mode ? 0 : SZSP_NONE);
this->SetWidgetDisabledState(WID_BS_TOGGLE_SIZE, this->realistic_braking_mode);
@@ -2017,7 +2019,7 @@ public:
}
}
void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override
void UpdateWidgetSize(int widget, Dimension *size, [[maybe_unused]] const Dimension &padding, [[maybe_unused]] Dimension *fill, [[maybe_unused]] Dimension *resize) override
{
if (widget == WID_BS_DRAG_SIGNALS_DENSITY_LABEL) {
/* Two digits for signals density. */
@@ -2210,7 +2212,7 @@ public:
* @param data Information about the changed data.
* @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details.
*/
void OnInvalidateData(int data = 0, bool gui_scope = true) override
void OnInvalidateData([[maybe_unused]] int data = 0, [[maybe_unused]] bool gui_scope = true) override
{
if (!gui_scope) return;
this->LowerWidget((_cur_signal_variant == SIG_ELECTRIC ? WID_BS_ELECTRIC_NORM : WID_BS_SEMAPHORE_NORM) + _cur_signal_button);
@@ -2360,7 +2362,7 @@ struct BuildRailDepotWindow : public PickerWindowBase {
this->LowerWidget(_build_depot_direction + WID_BRAD_DEPOT_NE);
}
void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override
void UpdateWidgetSize(int widget, Dimension *size, [[maybe_unused]] const Dimension &padding, [[maybe_unused]] Dimension *fill, [[maybe_unused]] Dimension *resize) override
{
if (!IsInsideMM(widget, WID_BRAD_DEPOT_NE, WID_BRAD_DEPOT_NW + 1)) return;
@@ -2381,7 +2383,7 @@ struct BuildRailDepotWindow : public PickerWindowBase {
}
}
void OnClick(Point pt, int widget, int click_count) override
void OnClick([[maybe_unused]] Point pt, int widget, [[maybe_unused]] int click_count) override
{
switch (widget) {
case WID_BRAD_DEPOT_NE:
@@ -2588,7 +2590,7 @@ struct BuildRailWaypointWindow : PickerWindowBase {
}
}
void OnClick(Point pt, int widget, int click_count) override
void OnClick([[maybe_unused]] Point pt, int widget, [[maybe_unused]] int click_count) override
{
switch (GB(widget, 0, 16)) {
case WID_BRW_WAYPOINT: {
@@ -2754,7 +2756,6 @@ static void SetDefaultRailGui()
/**
* Updates the current signal variant used in the signal GUI
* to the one adequate to current year.
* @param new_value needed to be called when a setting changes
*/
void ResetSignalVariant(int32 new_value)
{