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 dP
parent c80d21a41a
commit 8ea007df21
62 changed files with 157 additions and 157 deletions
+2 -2
View File
@@ -316,7 +316,7 @@ struct TerraformToolbarWindow : Window {
}, TerraformToolbarGlobalHotkeys};
};
static constexpr NWidgetPart _nested_terraform_widgets[] = {
static constexpr std::initializer_list<NWidgetPart> _nested_terraform_widgets = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
NWidget(WWT_CAPTION, COLOUR_DARK_GREEN), SetStringTip(STR_LANDSCAPING_TOOLBAR, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
@@ -445,7 +445,7 @@ static const int8_t _multi_terraform_coords[][2] = {
{-28, 0}, {-24, -2}, {-20, -4}, {-16, -6}, {-12, -8}, { -8,-10}, { -4,-12}, { 0,-14}, { 4,-12}, { 8,-10}, { 12, -8}, { 16, -6}, { 20, -4}, { 24, -2}, { 28, 0},
};
static constexpr NWidgetPart _nested_scen_edit_land_gen_widgets[] = {
static constexpr std::initializer_list<NWidgetPart> _nested_scen_edit_land_gen_widgets = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
NWidget(WWT_CAPTION, COLOUR_DARK_GREEN), SetStringTip(STR_TERRAFORM_TOOLBAR_LAND_GENERATION_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),