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 49dd74ea89
commit c2d92433c6
62 changed files with 160 additions and 158 deletions

View File

@@ -181,7 +181,7 @@ static std::unique_ptr<NWidgetBase> MakeNWidgetCompanyLines()
return vert;
}
static /* CM constexpr */ NWidgetPart _nested_graph_legend_widgets[] = {
static NWidgetPart _nested_graph_legend_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
NWidget(WWT_CAPTION, COLOUR_BROWN), SetStringTip(STR_GRAPH_KEY_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
@@ -1156,7 +1156,7 @@ struct OperatingProfitGraphWindow : BaseCompanyGraphWindow {
}
};
static /* CM constexpr */ NWidgetPart _nested_operating_profit_widgets[] = {
static NWidgetPart _nested_operating_profit_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
NWidget(WWT_CAPTION, COLOUR_BROWN), SetStringTip(STR_GRAPH_OPERATING_PROFIT_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
@@ -1227,7 +1227,7 @@ struct IncomeGraphWindow : citymania::BaseCompanyCargoGraphWindow {
};
static /* CM constexpr */ NWidgetPart _nested_income_graph_widgets[] = {
static NWidgetPart _nested_income_graph_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
NWidget(WWT_CAPTION, COLOUR_BROWN), SetStringTip(STR_GRAPH_INCOME_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
@@ -1316,7 +1316,7 @@ struct DeliveredCargoGraphWindow : citymania::BaseCompanyCargoGraphWindow {
}
};
static /* CM constexpr */ NWidgetPart _nested_delivered_cargo_graph_widgets[] = {
static NWidgetPart _nested_delivered_cargo_graph_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
NWidget(WWT_CAPTION, COLOUR_BROWN), SetStringTip(STR_GRAPH_CARGO_DELIVERED_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
@@ -1393,7 +1393,7 @@ struct PerformanceHistoryGraphWindow : BaseCompanyGraphWindow {
}
};
static /* CM constexpr */ NWidgetPart _nested_performance_history_widgets[] = {
static NWidgetPart _nested_performance_history_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
NWidget(WWT_CAPTION, COLOUR_BROWN), SetStringTip(STR_GRAPH_COMPANY_PERFORMANCE_RATINGS_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
@@ -1446,7 +1446,7 @@ struct CompanyValueGraphWindow : BaseCompanyGraphWindow {
}
};
static /* CM constexpr */ NWidgetPart _nested_company_value_graph_widgets[] = {
static NWidgetPart _nested_company_value_graph_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
NWidget(WWT_CAPTION, COLOUR_BROWN), SetStringTip(STR_GRAPH_COMPANY_VALUES_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
@@ -1712,7 +1712,7 @@ struct PaymentRatesGraphWindow : BaseCargoGraphWindow {
}
};
static /* CM constexpr */ NWidgetPart _nested_cargo_payment_rates_widgets[] = {
static NWidgetPart _nested_cargo_payment_rates_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
NWidget(WWT_CAPTION, COLOUR_BROWN), SetStringTip(STR_GRAPH_CARGO_PAYMENT_RATES_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
@@ -2118,7 +2118,7 @@ struct IndustryProductionGraphWindow : BaseCargoGraphWindow {
}
};
static /* constexpr */ NWidgetPart _nested_industry_production_widgets[] = {
static NWidgetPart _nested_industry_production_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
NWidget(WWT_CAPTION, COLOUR_BROWN, WID_GRAPH_CAPTION),
@@ -2263,7 +2263,7 @@ struct TownCargoGraphWindow : BaseCargoGraphWindow {
}
};
static /* CM constexpr */ NWidgetPart _nested_town_cargo_graph_widgets[] = {
static NWidgetPart _nested_town_cargo_graph_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
NWidget(WWT_CAPTION, COLOUR_BROWN, WID_GRAPH_CAPTION),
@@ -2349,7 +2349,7 @@ std::unique_ptr<NWidgetBase> MakeCompanyButtonRowsGraphGUI()
return MakeCompanyButtonRows(WID_PRD_COMPANY_FIRST, WID_PRD_COMPANY_LAST, CM_WINDOW_BG, 8, STR_PERFORMANCE_DETAIL_SELECT_COMPANY_TOOLTIP);
}
static /* CM constexpr */ NWidgetPart _nested_performance_rating_detail_widgets[] = {
static NWidgetPart _nested_performance_rating_detail_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
NWidget(WWT_CAPTION, COLOUR_BROWN), SetStringTip(STR_PERFORMANCE_DETAIL, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),