mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-21 19:32:54 +01:00
Codechange: Use std::initializer_list for NWidgetPart data. (#14749)
Avoids using C/C++ arrays.
This commit is contained in:
@@ -244,7 +244,7 @@ struct ScriptListWindow : public Window {
|
||||
};
|
||||
|
||||
/** Widgets for the AI list window. */
|
||||
static constexpr NWidgetPart _nested_script_list_widgets[] = {
|
||||
static constexpr std::initializer_list<NWidgetPart> _nested_script_list_widgets = {
|
||||
NWidget(NWID_HORIZONTAL),
|
||||
NWidget(WWT_CLOSEBOX, COLOUR_MAUVE),
|
||||
NWidget(WWT_CAPTION, COLOUR_MAUVE, WID_SCRL_CAPTION),
|
||||
@@ -555,7 +555,7 @@ private:
|
||||
};
|
||||
|
||||
/** Widgets for the Script settings window. */
|
||||
static constexpr NWidgetPart _nested_script_settings_widgets[] = {
|
||||
static constexpr std::initializer_list<NWidgetPart> _nested_script_settings_widgets = {
|
||||
NWidget(NWID_HORIZONTAL),
|
||||
NWidget(WWT_CLOSEBOX, COLOUR_MAUVE),
|
||||
NWidget(WWT_CAPTION, COLOUR_MAUVE, WID_SCRS_CAPTION),
|
||||
@@ -1200,7 +1200,7 @@ std::unique_ptr<NWidgetBase> MakeCompanyButtonRowsScriptDebug()
|
||||
}
|
||||
|
||||
/** Widgets for the Script debug window. */
|
||||
static constexpr NWidgetPart _nested_script_debug_widgets[] = {
|
||||
static constexpr std::initializer_list<NWidgetPart> _nested_script_debug_widgets = {
|
||||
NWidget(NWID_HORIZONTAL),
|
||||
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
|
||||
NWidget(WWT_CAPTION, COLOUR_GREY), SetStringTip(STR_AI_DEBUG, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
|
||||
|
||||
Reference in New Issue
Block a user