Codechange: Use std::initializer_list for NWidgetPart data. (#14749)
Avoids using C/C++ arrays.
This commit is contained in:
@@ -857,7 +857,7 @@ struct BuildRailToolbarWindow : Window {
|
||||
}, RailToolbarGlobalHotkeys};
|
||||
};
|
||||
|
||||
static constexpr NWidgetPart _nested_build_rail_widgets[] = {
|
||||
static constexpr std::initializer_list<NWidgetPart> _nested_build_rail_widgets = {
|
||||
NWidget(NWID_HORIZONTAL),
|
||||
NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
|
||||
NWidget(WWT_CAPTION, COLOUR_DARK_GREEN, WID_RAT_CAPTION), SetTextStyle(TC_WHITE),
|
||||
@@ -1383,7 +1383,7 @@ public:
|
||||
}, BuildRailStationGlobalHotkeys};
|
||||
};
|
||||
|
||||
static constexpr NWidgetPart _nested_station_builder_widgets[] = {
|
||||
static constexpr std::initializer_list<NWidgetPart> _nested_station_builder_widgets = {
|
||||
NWidget(NWID_HORIZONTAL),
|
||||
NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
|
||||
NWidget(WWT_CAPTION, COLOUR_DARK_GREEN), SetStringTip(STR_STATION_BUILD_RAIL_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
|
||||
@@ -1625,7 +1625,7 @@ public:
|
||||
};
|
||||
|
||||
/** Nested widget definition of the build signal window */
|
||||
static constexpr NWidgetPart _nested_signal_builder_widgets[] = {
|
||||
static constexpr std::initializer_list<NWidgetPart> _nested_signal_builder_widgets = {
|
||||
/* Title bar and buttons. */
|
||||
NWidget(NWID_HORIZONTAL),
|
||||
NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
|
||||
@@ -1752,7 +1752,7 @@ struct BuildRailDepotWindow : public PickerWindowBase {
|
||||
};
|
||||
|
||||
/** Nested widget definition of the build rail depot window */
|
||||
static constexpr NWidgetPart _nested_build_depot_widgets[] = {
|
||||
static constexpr std::initializer_list<NWidgetPart> _nested_build_depot_widgets = {
|
||||
NWidget(NWID_HORIZONTAL),
|
||||
NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
|
||||
NWidget(WWT_CAPTION, COLOUR_DARK_GREEN), SetStringTip(STR_BUILD_DEPOT_TRAIN_ORIENTATION_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
|
||||
@@ -1877,7 +1877,7 @@ struct BuildRailWaypointWindow : public PickerWindow {
|
||||
};
|
||||
|
||||
/** Nested widget definition for the build NewGRF rail waypoint window */
|
||||
static constexpr NWidgetPart _nested_build_waypoint_widgets[] = {
|
||||
static constexpr std::initializer_list<NWidgetPart> _nested_build_waypoint_widgets = {
|
||||
NWidget(NWID_HORIZONTAL),
|
||||
NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
|
||||
NWidget(WWT_CAPTION, COLOUR_DARK_GREEN), SetStringTip(STR_WAYPOINT_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
|
||||
|
||||
Reference in New Issue
Block a user