Skip to content

Commit

Permalink
Codechange: Make all NWidgetPart arrays constexpr.
Browse files Browse the repository at this point in the history
This ensures that the arrays are not created at runtime and prevents using non-constexpr values.
  • Loading branch information
PeterN committed Jan 16, 2024
1 parent 71b7ba0 commit 7737aa6
Show file tree
Hide file tree
Showing 61 changed files with 154 additions and 154 deletions.
2 changes: 1 addition & 1 deletion src/ai/ai_gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@


/** Widgets for the configure AI window. */
static const NWidgetPart _nested_ai_config_widgets[] = {
static constexpr NWidgetPart _nested_ai_config_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_MAUVE),
NWidget(WWT_CAPTION, COLOUR_MAUVE), SetDataTip(STR_AI_CONFIG_CAPTION_AI, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
Expand Down
4 changes: 2 additions & 2 deletions src/airport_gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ struct BuildAirToolbarWindow : Window {
}, AirportToolbarGlobalHotkeys};
};

static const NWidgetPart _nested_air_toolbar_widgets[] = {
static constexpr NWidgetPart _nested_air_toolbar_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
NWidget(WWT_CAPTION, COLOUR_DARK_GREEN), SetDataTip(STR_TOOLBAR_AIRCRAFT_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
Expand Down Expand Up @@ -581,7 +581,7 @@ class BuildAirportWindow : public PickerWindowBase {
}};
};

static const NWidgetPart _nested_build_airport_widgets[] = {
static constexpr NWidgetPart _nested_build_airport_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
NWidget(WWT_CAPTION, COLOUR_DARK_GREEN), SetDataTip(STR_STATION_BUILD_AIRPORT_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
Expand Down
6 changes: 3 additions & 3 deletions src/autoreplace_gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ class ReplaceVehicleWindow : public Window {
}
};

static const NWidgetPart _nested_replace_rail_vehicle_widgets[] = {
static constexpr NWidgetPart _nested_replace_rail_vehicle_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
NWidget(WWT_CAPTION, COLOUR_GREY, WID_RV_CAPTION), SetDataTip(STR_REPLACE_VEHICLES_WHITE, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
Expand Down Expand Up @@ -796,7 +796,7 @@ static WindowDesc _replace_rail_vehicle_desc(__FILE__, __LINE__,
std::begin(_nested_replace_rail_vehicle_widgets), std::end(_nested_replace_rail_vehicle_widgets)
);

static const NWidgetPart _nested_replace_road_vehicle_widgets[] = {
static constexpr NWidgetPart _nested_replace_road_vehicle_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
NWidget(WWT_CAPTION, COLOUR_GREY, WID_RV_CAPTION), SetDataTip(STR_REPLACE_VEHICLES_WHITE, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
Expand Down Expand Up @@ -854,7 +854,7 @@ static WindowDesc _replace_road_vehicle_desc(__FILE__, __LINE__,
std::begin(_nested_replace_road_vehicle_widgets), std::end(_nested_replace_road_vehicle_widgets)
);

static const NWidgetPart _nested_replace_vehicle_widgets[] = {
static constexpr NWidgetPart _nested_replace_vehicle_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
NWidget(WWT_CAPTION, COLOUR_GREY, WID_RV_CAPTION), SetMinimalSize(433, 14), SetDataTip(STR_REPLACE_VEHICLES_WHITE, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
Expand Down
8 changes: 4 additions & 4 deletions src/bootstrap_gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include "safeguards.h"

/** Widgets for the background window to prevent smearing. */
static const NWidgetPart _background_widgets[] = {
static constexpr NWidgetPart _background_widgets[] = {
NWidget(WWT_PANEL, COLOUR_DARK_BLUE, WID_BB_BACKGROUND), SetResize(1, 1),
EndContainer(),
};
Expand Down Expand Up @@ -65,7 +65,7 @@ class BootstrapBackground : public Window {
};

/** Nested widgets for the error window. */
static const NWidgetPart _nested_bootstrap_errmsg_widgets[] = {
static constexpr NWidgetPart _nested_bootstrap_errmsg_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CAPTION, COLOUR_GREY, WID_BEM_CAPTION), SetDataTip(STR_MISSING_GRAPHICS_ERROR_TITLE, STR_NULL),
EndContainer(),
Expand Down Expand Up @@ -122,7 +122,7 @@ class BootstrapErrorWindow : public Window {
};

/** Nested widgets for the download window. */
static const NWidgetPart _nested_bootstrap_download_status_window_widgets[] = {
static constexpr NWidgetPart _nested_bootstrap_download_status_window_widgets[] = {
NWidget(WWT_CAPTION, COLOUR_GREY), SetDataTip(STR_CONTENT_DOWNLOAD_TITLE, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
NWidget(WWT_PANEL, COLOUR_GREY),
NWidget(NWID_VERTICAL), SetPIP(0, WidgetDimensions::unscaled.vsep_wide, 0), SetPadding(WidgetDimensions::unscaled.modalpopup),
Expand Down Expand Up @@ -173,7 +173,7 @@ struct BootstrapContentDownloadStatusWindow : public BaseNetworkContentDownloadS
};

/** The widgets for the query. It has no close box as that sprite does not exist yet. */
static const NWidgetPart _bootstrap_query_widgets[] = {
static constexpr NWidgetPart _bootstrap_query_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CAPTION, COLOUR_GREY), SetDataTip(STR_MISSING_GRAPHICS_SET_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
EndContainer(),
Expand Down
2 changes: 1 addition & 1 deletion src/bridge_gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ const StringID BuildBridgeWindow::sorter_names[] = {
};

/** Widgets of the bridge gui. */
static const NWidgetPart _nested_build_bridge_widgets[] = {
static constexpr NWidgetPart _nested_build_bridge_widgets[] = {
/* Header */
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
Expand Down
2 changes: 1 addition & 1 deletion src/build_vehicle_gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ uint GetEngineListHeight(VehicleType type)
return std::max<uint>(GetCharacterHeight(FS_NORMAL) + WidgetDimensions::scaled.matrix.Vertical(), GetVehicleImageCellSize(type, EIT_PURCHASE).height);
}

static const NWidgetPart _nested_build_vehicle_widgets[] = {
static constexpr NWidgetPart _nested_build_vehicle_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
NWidget(WWT_CAPTION, COLOUR_GREY, WID_BV_CAPTION), SetDataTip(STR_JUST_STRING, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS), SetTextStyle(TC_WHITE),
Expand Down
2 changes: 1 addition & 1 deletion src/cheat_gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ static const CheatEntry _cheats_ui[] = {
static_assert(CHT_NUM_CHEATS == lengthof(_cheats_ui));

/** Widget definitions of the cheat GUI. */
static const NWidgetPart _nested_cheat_widgets[] = {
static constexpr NWidgetPart _nested_cheat_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
NWidget(WWT_CAPTION, COLOUR_GREY), SetDataTip(STR_CHEATS, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
Expand Down
12 changes: 6 additions & 6 deletions src/company_gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ static void DrawYearColumn(const Rect &r, TimerGameCalendar::Year year, const Ex
DrawPrice(sum, r.left, r.right, y, TC_WHITE);
}

static const NWidgetPart _nested_company_finances_widgets[] = {
static constexpr NWidgetPart _nested_company_finances_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
NWidget(WWT_CAPTION, COLOUR_GREY, WID_CF_CAPTION), SetDataTip(STR_FINANCES_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
Expand Down Expand Up @@ -1097,7 +1097,7 @@ struct SelectCompanyLiveryWindow : public Window {
}
};

static const NWidgetPart _nested_select_company_livery_widgets[] = {
static constexpr NWidgetPart _nested_select_company_livery_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
NWidget(WWT_CAPTION, COLOUR_GREY, WID_SCL_CAPTION), SetDataTip(STR_LIVERY_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
Expand Down Expand Up @@ -1192,7 +1192,7 @@ void DrawCompanyManagerFace(CompanyManagerFace cmf, int colour, const Rect &r)
}

/** Nested widget description for the company manager face selection dialog */
static const NWidgetPart _nested_select_company_manager_face_widgets[] = {
static constexpr NWidgetPart _nested_select_company_manager_face_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
NWidget(WWT_CAPTION, COLOUR_GREY, WID_SCMF_CAPTION), SetDataTip(STR_FACE_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
Expand Down Expand Up @@ -1771,7 +1771,7 @@ static void DoSelectCompanyManagerFace(Window *parent)
new SelectCompanyManagerFaceWindow(&_select_company_manager_face_desc, parent);
}

static const NWidgetPart _nested_company_infrastructure_widgets[] = {
static constexpr NWidgetPart _nested_company_infrastructure_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
NWidget(WWT_CAPTION, COLOUR_GREY, WID_CI_CAPTION), SetDataTip(STR_COMPANY_INFRASTRUCTURE_VIEW_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
Expand Down Expand Up @@ -2140,7 +2140,7 @@ static void ShowCompanyInfrastructure(CompanyID company)
AllocateWindowDescFront<CompanyInfrastructureWindow>(&_company_infrastructure_desc, company);
}

static const NWidgetPart _nested_company_widgets[] = {
static constexpr NWidgetPart _nested_company_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
NWidget(WWT_CAPTION, COLOUR_GREY, WID_C_CAPTION), SetDataTip(STR_COMPANY_VIEW_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
Expand Down Expand Up @@ -2726,7 +2726,7 @@ struct BuyCompanyWindow : Window {
Money company_value; ///< The value of the company for which the user can buy it.
};

static const NWidgetPart _nested_buy_company_widgets[] = {
static constexpr NWidgetPart _nested_buy_company_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_LIGHT_BLUE),
NWidget(WWT_CAPTION, COLOUR_LIGHT_BLUE, WID_BC_CAPTION), SetDataTip(STR_ERROR_MESSAGE_CAPTION_OTHER_COMPANY, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
Expand Down
2 changes: 1 addition & 1 deletion src/console_gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ static inline void IConsoleResetHistoryPos()
static const char *IConsoleHistoryAdd(const char *cmd);
static void IConsoleHistoryNavigate(int direction);

static const NWidgetPart _nested_console_window_widgets[] = {
static constexpr NWidgetPart _nested_console_window_widgets[] = {
NWidget(WWT_EMPTY, INVALID_COLOUR, WID_C_BACKGROUND), SetResize(1, 1),
};

Expand Down
2 changes: 1 addition & 1 deletion src/date_gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ struct SetDateWindow : Window {
};

/** Widgets for the date setting window. */
static const NWidgetPart _nested_set_date_widgets[] = {
static constexpr NWidgetPart _nested_set_date_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
NWidget(WWT_CAPTION, COLOUR_BROWN), SetDataTip(STR_DATE_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
Expand Down
2 changes: 1 addition & 1 deletion src/depot_gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
*/

/** Nested widget definition for train depots. */
static const NWidgetPart _nested_train_depot_widgets[] = {
static constexpr NWidgetPart _nested_train_depot_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
NWidget(NWID_SELECTION, INVALID_COLOUR, WID_D_SHOW_RENAME), // rename button
Expand Down
8 changes: 4 additions & 4 deletions src/dock_gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ struct BuildDocksToolbarWindow : Window {
* Nested widget parts of docks toolbar, game version.
* Position of #WID_DT_RIVER widget has changed.
*/
static const NWidgetPart _nested_build_docks_toolbar_widgets[] = {
static constexpr NWidgetPart _nested_build_docks_toolbar_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
NWidget(WWT_CAPTION, COLOUR_DARK_GREEN), SetDataTip(STR_WATERWAYS_TOOLBAR_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
Expand Down Expand Up @@ -371,7 +371,7 @@ Window *ShowBuildDocksToolbar()
* Nested widget parts of docks toolbar, scenario editor version.
* Positions of #WID_DT_DEPOT, #WID_DT_STATION, and #WID_DT_BUOY widgets have changed.
*/
static const NWidgetPart _nested_build_docks_scen_toolbar_widgets[] = {
static constexpr NWidgetPart _nested_build_docks_scen_toolbar_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
NWidget(WWT_CAPTION, COLOUR_DARK_GREEN), SetDataTip(STR_WATERWAYS_TOOLBAR_CAPTION_SE, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
Expand Down Expand Up @@ -479,7 +479,7 @@ struct BuildDocksStationWindow : public PickerWindowBase {
};

/** Nested widget parts of a build dock station window. */
static const NWidgetPart _nested_build_dock_station_widgets[] = {
static constexpr NWidgetPart _nested_build_dock_station_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
NWidget(WWT_CAPTION, COLOUR_DARK_GREEN), SetDataTip(STR_STATION_BUILD_DOCK_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
Expand Down Expand Up @@ -580,7 +580,7 @@ struct BuildDocksDepotWindow : public PickerWindowBase {
}
};

static const NWidgetPart _nested_build_docks_depot_widgets[] = {
static constexpr NWidgetPart _nested_build_docks_depot_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
NWidget(WWT_CAPTION, COLOUR_DARK_GREEN), SetDataTip(STR_DEPOT_BUILD_SHIP_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
Expand Down
2 changes: 1 addition & 1 deletion src/engine_gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ StringID GetEngineCategoryName(EngineID engine)
}
}

static const NWidgetPart _nested_engine_preview_widgets[] = {
static constexpr NWidgetPart _nested_engine_preview_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_LIGHT_BLUE),
NWidget(WWT_CAPTION, COLOUR_LIGHT_BLUE), SetDataTip(STR_ENGINE_PREVIEW_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
Expand Down
4 changes: 2 additions & 2 deletions src/error_gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

#include "safeguards.h"

static const NWidgetPart _nested_errmsg_widgets[] = {
static constexpr NWidgetPart _nested_errmsg_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_RED),
NWidget(WWT_CAPTION, COLOUR_RED, WID_EM_CAPTION), SetDataTip(STR_ERROR_MESSAGE_CAPTION, STR_NULL),
Expand All @@ -50,7 +50,7 @@ static WindowDesc _errmsg_desc(__FILE__, __LINE__,
std::begin(_nested_errmsg_widgets), std::end(_nested_errmsg_widgets)
);

static const NWidgetPart _nested_errmsg_face_widgets[] = {
static constexpr NWidgetPart _nested_errmsg_face_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_RED),
NWidget(WWT_CAPTION, COLOUR_RED, WID_EM_CAPTION), SetDataTip(STR_ERROR_MESSAGE_CAPTION_OTHER_COMPANY, STR_NULL),
Expand Down
6 changes: 3 additions & 3 deletions src/fios_gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ void LoadCheckData::Clear()
}

/** Load game/scenario with optional content download */
static const NWidgetPart _nested_load_dialog_widgets[] = {
static constexpr NWidgetPart _nested_load_dialog_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
NWidget(WWT_CAPTION, COLOUR_GREY, WID_SL_CAPTION),
Expand Down Expand Up @@ -124,7 +124,7 @@ static const NWidgetPart _nested_load_dialog_widgets[] = {
};

/** Load heightmap with content download */
static const NWidgetPart _nested_load_heightmap_dialog_widgets[] = {
static constexpr NWidgetPart _nested_load_heightmap_dialog_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
NWidget(WWT_CAPTION, COLOUR_GREY, WID_SL_CAPTION),
Expand Down Expand Up @@ -169,7 +169,7 @@ static const NWidgetPart _nested_load_heightmap_dialog_widgets[] = {
};

/** Save game/scenario */
static const NWidgetPart _nested_save_dialog_widgets[] = {
static constexpr NWidgetPart _nested_save_dialog_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
NWidget(WWT_CAPTION, COLOUR_GREY, WID_SL_CAPTION),
Expand Down
4 changes: 2 additions & 2 deletions src/framerate_gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ static const char * GetAIName(int ai_index)
}

/** @hideinitializer */
static const NWidgetPart _framerate_window_widgets[] = {
static constexpr NWidgetPart _framerate_window_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
NWidget(WWT_CAPTION, COLOUR_GREY, WID_FRW_CAPTION), SetDataTip(STR_FRAMERATE_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
Expand Down Expand Up @@ -735,7 +735,7 @@ static WindowDesc _framerate_display_desc(__FILE__, __LINE__,


/** @hideinitializer */
static const NWidgetPart _frametime_graph_window_widgets[] = {
static constexpr NWidgetPart _frametime_graph_window_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
NWidget(WWT_CAPTION, COLOUR_GREY, WID_FGW_CAPTION), SetDataTip(STR_JUST_STRING2, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS), SetTextStyle(TC_WHITE),
Expand Down
2 changes: 1 addition & 1 deletion src/game/game_gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@


/** Widgets for the configure GS window. */
static const NWidgetPart _nested_gs_config_widgets[] = {
static constexpr NWidgetPart _nested_gs_config_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_MAUVE),
NWidget(WWT_CAPTION, COLOUR_MAUVE), SetDataTip(STR_AI_CONFIG_CAPTION_GAMESCRIPT, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
Expand Down
8 changes: 4 additions & 4 deletions src/genworld_gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ void SetNewLandscapeType(byte landscape)
}

/** Widgets of GenerateLandscapeWindow when generating world */
static const NWidgetPart _nested_generate_landscape_widgets[] = {
static constexpr NWidgetPart _nested_generate_landscape_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
NWidget(WWT_CAPTION, COLOUR_BROWN), SetDataTip(STR_MAPGEN_WORLD_GENERATION_CAPTION, STR_NULL),
Expand Down Expand Up @@ -193,7 +193,7 @@ static const NWidgetPart _nested_generate_landscape_widgets[] = {
};

/** Widgets of GenerateLandscapeWindow when loading heightmap */
static const NWidgetPart _nested_heightmap_load_widgets[] = {
static constexpr NWidgetPart _nested_heightmap_load_widgets[] = {
/* Window header. */
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
Expand Down Expand Up @@ -1254,7 +1254,7 @@ struct CreateScenarioWindow : public Window
}
};

static const NWidgetPart _nested_create_scenario_widgets[] = {
static constexpr NWidgetPart _nested_create_scenario_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
NWidget(WWT_CAPTION, COLOUR_BROWN), SetDataTip(STR_SE_MAPGEN_CAPTION, STR_NULL),
Expand Down Expand Up @@ -1327,7 +1327,7 @@ void ShowCreateScenario()
new CreateScenarioWindow(&_create_scenario_desc, GLWM_SCENARIO);
}

static const NWidgetPart _nested_generate_progress_widgets[] = {
static constexpr NWidgetPart _nested_generate_progress_widgets[] = {
NWidget(WWT_CAPTION, COLOUR_GREY), SetDataTip(STR_GENERATION_WORLD, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
NWidget(WWT_PANEL, COLOUR_GREY),
NWidget(NWID_VERTICAL), SetPIP(0, WidgetDimensions::unscaled.vsep_wide, 0), SetPadding(WidgetDimensions::unscaled.modalpopup),
Expand Down
10 changes: 5 additions & 5 deletions src/goal_gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ struct GoalListWindow : public Window {
};

/** Widgets of the #GoalListWindow. */
static const NWidgetPart _nested_goals_list_widgets[] = {
static constexpr NWidgetPart _nested_goals_list_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
NWidget(WWT_CAPTION, COLOUR_BROWN, WID_GOAL_CAPTION), SetDataTip(STR_JUST_STRING1, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
Expand Down Expand Up @@ -406,7 +406,7 @@ struct GoalQuestionWindow : public Window {
};

/** Widgets of the goal question window. */
static const NWidgetPart _nested_goal_question_widgets_question[] = {
static constexpr NWidgetPart _nested_goal_question_widgets_question[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_LIGHT_BLUE),
NWidget(WWT_CAPTION, COLOUR_LIGHT_BLUE, WID_GQ_CAPTION), SetDataTip(STR_GOAL_QUESTION_CAPTION_QUESTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
Expand All @@ -432,7 +432,7 @@ static const NWidgetPart _nested_goal_question_widgets_question[] = {
EndContainer(),
};

static const NWidgetPart _nested_goal_question_widgets_info[] = {
static constexpr NWidgetPart _nested_goal_question_widgets_info[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_LIGHT_BLUE),
NWidget(WWT_CAPTION, COLOUR_LIGHT_BLUE, WID_GQ_CAPTION), SetDataTip(STR_GOAL_QUESTION_CAPTION_INFORMATION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
Expand All @@ -458,7 +458,7 @@ static const NWidgetPart _nested_goal_question_widgets_info[] = {
EndContainer(),
};

static const NWidgetPart _nested_goal_question_widgets_warning[] = {
static constexpr NWidgetPart _nested_goal_question_widgets_warning[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_YELLOW),
NWidget(WWT_CAPTION, COLOUR_YELLOW, WID_GQ_CAPTION), SetDataTip(STR_GOAL_QUESTION_CAPTION_WARNING, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
Expand All @@ -484,7 +484,7 @@ static const NWidgetPart _nested_goal_question_widgets_warning[] = {
EndContainer(),
};

static const NWidgetPart _nested_goal_question_widgets_error[] = {
static constexpr NWidgetPart _nested_goal_question_widgets_error[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_RED),
NWidget(WWT_CAPTION, COLOUR_RED, WID_GQ_CAPTION), SetDataTip(STR_GOAL_QUESTION_CAPTION_ERROR, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
Expand Down
Loading

0 comments on commit 7737aa6

Please sign in to comment.