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:
@@ -398,7 +398,7 @@ struct CompanyFinancesWindow : Window {
|
||||
}
|
||||
}
|
||||
|
||||
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_CF_EXPS_CATEGORY:
|
||||
@@ -494,7 +494,7 @@ struct CompanyFinancesWindow : Window {
|
||||
this->DrawWidgets();
|
||||
}
|
||||
|
||||
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_CF_TOGGLE_SIZE: // toggle size
|
||||
@@ -643,7 +643,7 @@ public:
|
||||
return ScaleGUITrad(28) + WidgetDimensions::scaled.hsep_normal + GetStringBoundingBox(this->String()).width + WidgetDimensions::scaled.dropdowntext.Horizontal();
|
||||
}
|
||||
|
||||
uint Height(uint width) const override
|
||||
uint Height(uint) const override
|
||||
{
|
||||
return std::max(FONT_HEIGHT_NORMAL, ScaleGUITrad(12) + WidgetDimensions::scaled.vsep_normal);
|
||||
}
|
||||
@@ -653,7 +653,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
void Draw(const Rect &r, bool sel, Colours bg_colour) const override
|
||||
void Draw(const Rect &r, bool sel, Colours) const override
|
||||
{
|
||||
bool rtl = _current_text_dir == TD_RTL;
|
||||
int icon_y = CenterBounds(r.top, r.bottom, 0);
|
||||
@@ -830,7 +830,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_SCL_SPACER_DROPDOWN: {
|
||||
@@ -1001,7 +1001,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) {
|
||||
/* Livery Class buttons */
|
||||
@@ -1106,7 +1106,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;
|
||||
|
||||
@@ -1127,7 +1127,7 @@ public:
|
||||
return;
|
||||
}
|
||||
|
||||
this->SetWidgetsDisabledState(true, WID_SCL_CLASS_RAIL, WID_SCL_CLASS_ROAD, WID_SCL_CLASS_SHIP, WID_SCL_CLASS_AIRCRAFT, WIDGET_LIST_END);
|
||||
this->SetWidgetsDisabledState(true, WID_SCL_CLASS_RAIL, WID_SCL_CLASS_ROAD, WID_SCL_CLASS_SHIP, WID_SCL_CLASS_AIRCRAFT);
|
||||
|
||||
bool current_class_valid = this->livery_class == LC_OTHER || this->livery_class >= LC_GROUP_RAIL;
|
||||
if (_settings_client.gui.liveries == LIT_ALL || (_settings_client.gui.liveries == LIT_COMPANY && this->window_number == _local_company)) {
|
||||
@@ -1495,7 +1495,7 @@ public:
|
||||
this->number_dim = number_dim;
|
||||
}
|
||||
|
||||
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_SCMF_HAS_MOUSTACHE_EARRING_TEXT:
|
||||
@@ -1543,8 +1543,8 @@ public:
|
||||
void OnPaint() override
|
||||
{
|
||||
/* lower the non-selected gender button */
|
||||
this->SetWidgetsLoweredState(!this->is_female, WID_SCMF_MALE, WID_SCMF_MALE2, WIDGET_LIST_END);
|
||||
this->SetWidgetsLoweredState( this->is_female, WID_SCMF_FEMALE, WID_SCMF_FEMALE2, WIDGET_LIST_END);
|
||||
this->SetWidgetsLoweredState(!this->is_female, WID_SCMF_MALE, WID_SCMF_MALE2);
|
||||
this->SetWidgetsLoweredState( this->is_female, WID_SCMF_FEMALE, WID_SCMF_FEMALE2);
|
||||
|
||||
/* advanced company manager face selection window */
|
||||
|
||||
@@ -1559,44 +1559,44 @@ public:
|
||||
|
||||
/* Eye colour buttons */
|
||||
this->SetWidgetsDisabledState(_cmf_info[CMFV_EYE_COLOUR].valid_values[this->ge] < 2,
|
||||
WID_SCMF_EYECOLOUR, WID_SCMF_EYECOLOUR_L, WID_SCMF_EYECOLOUR_R, WIDGET_LIST_END);
|
||||
WID_SCMF_EYECOLOUR, WID_SCMF_EYECOLOUR_L, WID_SCMF_EYECOLOUR_R);
|
||||
|
||||
/* Chin buttons */
|
||||
this->SetWidgetsDisabledState(_cmf_info[CMFV_CHIN].valid_values[this->ge] < 2,
|
||||
WID_SCMF_CHIN, WID_SCMF_CHIN_L, WID_SCMF_CHIN_R, WIDGET_LIST_END);
|
||||
WID_SCMF_CHIN, WID_SCMF_CHIN_L, WID_SCMF_CHIN_R);
|
||||
|
||||
/* Eyebrows buttons */
|
||||
this->SetWidgetsDisabledState(_cmf_info[CMFV_EYEBROWS].valid_values[this->ge] < 2,
|
||||
WID_SCMF_EYEBROWS, WID_SCMF_EYEBROWS_L, WID_SCMF_EYEBROWS_R, WIDGET_LIST_END);
|
||||
WID_SCMF_EYEBROWS, WID_SCMF_EYEBROWS_L, WID_SCMF_EYEBROWS_R);
|
||||
|
||||
/* Lips or (if it a male face with a moustache) moustache buttons */
|
||||
this->SetWidgetsDisabledState(_cmf_info[this->is_moust_male ? CMFV_MOUSTACHE : CMFV_LIPS].valid_values[this->ge] < 2,
|
||||
WID_SCMF_LIPS_MOUSTACHE, WID_SCMF_LIPS_MOUSTACHE_L, WID_SCMF_LIPS_MOUSTACHE_R, WIDGET_LIST_END);
|
||||
WID_SCMF_LIPS_MOUSTACHE, WID_SCMF_LIPS_MOUSTACHE_L, WID_SCMF_LIPS_MOUSTACHE_R);
|
||||
|
||||
/* Nose buttons | male faces with moustache haven't any nose options */
|
||||
this->SetWidgetsDisabledState(_cmf_info[CMFV_NOSE].valid_values[this->ge] < 2 || this->is_moust_male,
|
||||
WID_SCMF_NOSE, WID_SCMF_NOSE_L, WID_SCMF_NOSE_R, WIDGET_LIST_END);
|
||||
WID_SCMF_NOSE, WID_SCMF_NOSE_L, WID_SCMF_NOSE_R);
|
||||
|
||||
/* Hair buttons */
|
||||
this->SetWidgetsDisabledState(_cmf_info[CMFV_HAIR].valid_values[this->ge] < 2,
|
||||
WID_SCMF_HAIR, WID_SCMF_HAIR_L, WID_SCMF_HAIR_R, WIDGET_LIST_END);
|
||||
WID_SCMF_HAIR, WID_SCMF_HAIR_L, WID_SCMF_HAIR_R);
|
||||
|
||||
/* Jacket buttons */
|
||||
this->SetWidgetsDisabledState(_cmf_info[CMFV_JACKET].valid_values[this->ge] < 2,
|
||||
WID_SCMF_JACKET, WID_SCMF_JACKET_L, WID_SCMF_JACKET_R, WIDGET_LIST_END);
|
||||
WID_SCMF_JACKET, WID_SCMF_JACKET_L, WID_SCMF_JACKET_R);
|
||||
|
||||
/* Collar buttons */
|
||||
this->SetWidgetsDisabledState(_cmf_info[CMFV_COLLAR].valid_values[this->ge] < 2,
|
||||
WID_SCMF_COLLAR, WID_SCMF_COLLAR_L, WID_SCMF_COLLAR_R, WIDGET_LIST_END);
|
||||
WID_SCMF_COLLAR, WID_SCMF_COLLAR_L, WID_SCMF_COLLAR_R);
|
||||
|
||||
/* Tie/earring buttons | female faces without earring haven't any earring options */
|
||||
this->SetWidgetsDisabledState(_cmf_info[CMFV_TIE_EARRING].valid_values[this->ge] < 2 ||
|
||||
(this->is_female && GetCompanyManagerFaceBits(this->face, CMFV_HAS_TIE_EARRING, this->ge) == 0),
|
||||
WID_SCMF_TIE_EARRING, WID_SCMF_TIE_EARRING_L, WID_SCMF_TIE_EARRING_R, WIDGET_LIST_END);
|
||||
WID_SCMF_TIE_EARRING, WID_SCMF_TIE_EARRING_L, WID_SCMF_TIE_EARRING_R);
|
||||
|
||||
/* Glasses buttons | faces without glasses haven't any glasses options */
|
||||
this->SetWidgetsDisabledState(_cmf_info[CMFV_GLASSES].valid_values[this->ge] < 2 || GetCompanyManagerFaceBits(this->face, CMFV_HAS_GLASSES, this->ge) == 0,
|
||||
WID_SCMF_GLASSES, WID_SCMF_GLASSES_L, WID_SCMF_GLASSES_R, WIDGET_LIST_END);
|
||||
WID_SCMF_GLASSES, WID_SCMF_GLASSES_L, WID_SCMF_GLASSES_R);
|
||||
|
||||
this->DrawWidgets();
|
||||
}
|
||||
@@ -1671,7 +1671,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) {
|
||||
/* Toggle size, advanced/simple face selection */
|
||||
@@ -1926,7 +1926,7 @@ struct CompanyInfrastructureWindow : Window
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
{
|
||||
const Company *c = Company::Get((CompanyID)this->window_number);
|
||||
|
||||
@@ -2192,7 +2192,7 @@ struct CompanyInfrastructureWindow : 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;
|
||||
|
||||
@@ -2462,7 +2462,7 @@ struct CompanyWindow : Window
|
||||
this->DrawWidgets();
|
||||
}
|
||||
|
||||
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_C_FACE: {
|
||||
@@ -2675,7 +2675,7 @@ struct CompanyWindow : 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
|
||||
{
|
||||
switch (widget) {
|
||||
case WID_C_NEW_FACE: DoSelectCompanyManagerFace(this); break;
|
||||
@@ -2780,7 +2780,7 @@ struct CompanyWindow : Window
|
||||
this->SetDirty();
|
||||
}
|
||||
|
||||
void OnPlaceObject(Point pt, TileIndex tile) override
|
||||
void OnPlaceObject([[maybe_unused]] Point pt, TileIndex tile) override
|
||||
{
|
||||
if (DoCommandP(tile, OBJECT_HQ, 0, CMD_BUILD_OBJECT | CMD_MSG(STR_ERROR_CAN_T_BUILD_COMPANY_HEADQUARTERS)) && !_shift_pressed) {
|
||||
ResetObjectToPlace();
|
||||
@@ -2949,7 +2949,7 @@ struct BuyCompanyWindow : 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
|
||||
{
|
||||
switch (widget) {
|
||||
case WID_BC_NO:
|
||||
|
Reference in New Issue
Block a user