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:
@@ -486,7 +486,7 @@ public:
|
||||
this->Window::Close();
|
||||
}
|
||||
|
||||
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_STL_SORTBY: {
|
||||
@@ -622,7 +622,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 (widget) {
|
||||
case WID_STL_LIST: {
|
||||
@@ -739,13 +739,15 @@ public:
|
||||
|
||||
void OnDropdownSelect(int widget, int index) override
|
||||
{
|
||||
if (this->stations.SortType() != index) {
|
||||
this->stations.SetSortType(index);
|
||||
if (widget == WID_STL_SORTDROPBTN) {
|
||||
if (this->stations.SortType() != index) {
|
||||
this->stations.SetSortType(index);
|
||||
|
||||
/* Display the current sort variant */
|
||||
this->GetWidget<NWidgetCore>(WID_STL_SORTDROPBTN)->widget_data = this->sorter_names[this->stations.SortType()];
|
||||
/* Display the current sort variant */
|
||||
this->GetWidget<NWidgetCore>(WID_STL_SORTDROPBTN)->widget_data = this->sorter_names[this->stations.SortType()];
|
||||
|
||||
this->SetDirty();
|
||||
this->SetDirty();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -767,7 +769,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 (data == 0) {
|
||||
/* This needs to be done in command-scope to enforce rebuilding before resorting invalid data */
|
||||
@@ -1500,7 +1502,7 @@ struct StationViewWindow : public Window {
|
||||
data->Update(count);
|
||||
}
|
||||
|
||||
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_SV_WAITING:
|
||||
@@ -1636,9 +1638,11 @@ struct StationViewWindow : public Window {
|
||||
|
||||
void SetStringParameters(int widget) const override
|
||||
{
|
||||
const Station *st = Station::Get(this->window_number);
|
||||
SetDParam(0, st->index);
|
||||
SetDParam(1, st->facilities);
|
||||
if (widget == WID_SV_CAPTION) {
|
||||
const Station *st = Station::Get(this->window_number);
|
||||
SetDParam(0, st->index);
|
||||
SetDParam(1, st->facilities);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2007,11 +2011,7 @@ struct StationViewWindow : public Window {
|
||||
const Station *st = Station::Get(this->window_number);
|
||||
Rect tr = r.Shrink(WidgetDimensions::scaled.framerect);
|
||||
|
||||
CargoTypes cargo_mask = 0;
|
||||
for (CargoID i = 0; i < NUM_CARGO; i++) {
|
||||
if (HasBit(st->goods[i].status, GoodsEntry::GES_ACCEPTANCE)) SetBit(cargo_mask, i);
|
||||
}
|
||||
SetDParam(0, cargo_mask);
|
||||
SetDParam(0, GetAcceptanceMask(st));
|
||||
int bottom = DrawStringMultiLine(tr.left, tr.right, tr.top, INT32_MAX, STR_STATION_VIEW_ACCEPTS_CARGO);
|
||||
return CeilDiv(bottom - r.top - WidgetDimensions::scaled.framerect.top, FONT_HEIGHT_NORMAL);
|
||||
}
|
||||
@@ -2094,7 +2094,7 @@ struct StationViewWindow : public Window {
|
||||
this->SetWidgetDirty(WID_SV_WAITING);
|
||||
}
|
||||
|
||||
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_SV_WAITING:
|
||||
@@ -2345,7 +2345,7 @@ struct StationViewWindow : public Window {
|
||||
* @param data Information about the changed data. If it's a valid cargo ID, invalidate the cargo 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) {
|
||||
if (data >= 0 && data < NUM_CARGO) {
|
||||
@@ -2556,7 +2556,7 @@ struct SelectStationWindow : Window {
|
||||
this->Window::Close();
|
||||
}
|
||||
|
||||
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_JS_PANEL) return;
|
||||
|
||||
@@ -2597,7 +2597,7 @@ struct SelectStationWindow : Window {
|
||||
}
|
||||
}
|
||||
|
||||
void OnClick(Point pt, int widget, int click_count) override
|
||||
void OnClick([[maybe_unused]] Point pt, int widget, [[maybe_unused]] int click_count) override
|
||||
{
|
||||
if (widget != WID_JS_PANEL) return;
|
||||
|
||||
@@ -2618,7 +2618,7 @@ struct SelectStationWindow : Window {
|
||||
CloseWindowById(WC_SELECT_STATION, 0);
|
||||
}
|
||||
|
||||
void OnRealtimeTick(uint delta_ms) override
|
||||
void OnRealtimeTick([[maybe_unused]] uint delta_ms) override
|
||||
{
|
||||
if (_thd.dirty & 2) {
|
||||
_thd.dirty &= ~2;
|
||||
@@ -2636,7 +2636,7 @@ struct SelectStationWindow : Window {
|
||||
* @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;
|
||||
FindStationsNearby<T>(this->area, true, IsSpecializedStationRightType<T>(this->select_station_cmd));
|
||||
@@ -2644,7 +2644,7 @@ struct SelectStationWindow : Window {
|
||||
this->SetDirty();
|
||||
}
|
||||
|
||||
void OnMouseOver(Point pt, int widget) override
|
||||
void OnMouseOver([[maybe_unused]] Point pt, int widget) override
|
||||
{
|
||||
if (widget != WID_JS_PANEL) {
|
||||
SetViewportCatchmentSpecializedStation<T>(nullptr, true);
|
||||
|
Reference in New Issue
Block a user