1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-22 19:54:06 +01:00

Codechange: Use std::initializer_list for NWidgetPart data. (#14749)

Avoids using C/C++ arrays.
This commit is contained in:
Peter Nelson
2025-11-01 22:33:00 +00:00
committed by GitHub
parent 34bbae05db
commit 66b6d71e32
62 changed files with 157 additions and 157 deletions

View File

@@ -202,7 +202,7 @@ static constexpr TextColour GAME_OPTIONS_LABEL = TC_LIGHT_BLUE;
/** Colour for selected text of game options. */
static constexpr TextColour GAME_OPTIONS_SELECTED = TC_WHITE;
static constexpr NWidgetPart _nested_social_plugins_widgets[] = {
static constexpr std::initializer_list<NWidgetPart> _nested_social_plugins_widgets = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_FRAME, GAME_OPTIONS_BACKGROUND, WID_GO_SOCIAL_PLUGIN_TITLE), SetTextStyle(GAME_OPTIONS_FRAME),
NWidget(NWID_HORIZONTAL), SetPIP(0, WidgetDimensions::unscaled.hsep_normal, 0),
@@ -217,7 +217,7 @@ static constexpr NWidgetPart _nested_social_plugins_widgets[] = {
EndContainer(),
};
static constexpr NWidgetPart _nested_social_plugins_none_widgets[] = {
static constexpr std::initializer_list<NWidgetPart> _nested_social_plugins_none_widgets = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_TEXT, INVALID_COLOUR), SetResize(1, 0), SetFill(1, 0), SetStringTip(STR_GAME_OPTIONS_SOCIAL_PLUGINS_NONE), SetTextStyle(GAME_OPTIONS_LABEL),
EndContainer(),
@@ -1602,7 +1602,7 @@ struct GameOptionsWindow : Window {
}
};
static constexpr NWidgetPart _nested_game_options_widgets[] = {
static constexpr std::initializer_list<NWidgetPart> _nested_game_options_widgets = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, GAME_OPTIONS_BACKGROUND),
NWidget(WWT_CAPTION, GAME_OPTIONS_BACKGROUND), SetStringTip(STR_GAME_OPTIONS_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
@@ -2142,7 +2142,7 @@ struct CustomCurrencyWindow : Window {
}
};
static constexpr NWidgetPart _nested_cust_currency_widgets[] = {
static constexpr std::initializer_list<NWidgetPart> _nested_cust_currency_widgets = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
NWidget(WWT_CAPTION, COLOUR_GREY), SetStringTip(STR_CURRENCY_WINDOW, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),