mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-26 13:44:16 +01:00
Codechange: Use std::initializer_list for NWidgetPart data. (#14749)
Avoids using C/C++ arrays.
This commit is contained in:
@@ -1586,7 +1586,7 @@ public:
|
||||
};
|
||||
|
||||
/** Nested widget definition for "your" train orders. */
|
||||
static constexpr NWidgetPart _nested_orders_train_widgets[] = {
|
||||
static constexpr std::initializer_list<NWidgetPart> _nested_orders_train_widgets = {
|
||||
NWidget(NWID_HORIZONTAL),
|
||||
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
|
||||
NWidget(WWT_CAPTION, COLOUR_GREY, WID_O_CAPTION),
|
||||
@@ -1663,7 +1663,7 @@ static WindowDesc _orders_train_desc(
|
||||
);
|
||||
|
||||
/** Nested widget definition for "your" orders (non-train). */
|
||||
static constexpr NWidgetPart _nested_orders_widgets[] = {
|
||||
static constexpr std::initializer_list<NWidgetPart> _nested_orders_widgets = {
|
||||
NWidget(NWID_HORIZONTAL),
|
||||
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
|
||||
NWidget(WWT_CAPTION, COLOUR_GREY, WID_O_CAPTION), SetStringTip(STR_ORDERS_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
|
||||
@@ -1736,7 +1736,7 @@ static WindowDesc _orders_desc(
|
||||
);
|
||||
|
||||
/** Nested widget definition for competitor orders. */
|
||||
static constexpr NWidgetPart _nested_other_orders_widgets[] = {
|
||||
static constexpr std::initializer_list<NWidgetPart> _nested_other_orders_widgets = {
|
||||
NWidget(NWID_HORIZONTAL),
|
||||
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
|
||||
NWidget(WWT_CAPTION, COLOUR_GREY, WID_O_CAPTION), SetStringTip(STR_ORDERS_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
|
||||
|
||||
Reference in New Issue
Block a user