1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-30 09:59:10 +00:00

Codefix: Incorrect NWidgetPart type for NWID_LAYER. (#13357)

Due to function overloads and default parameters, the wrong `NWidget()` function was called, resulting resulting in the wrong `NWidgetPart` being created.
This commit is contained in:
2025-01-22 20:43:54 +00:00
committed by GitHub
parent a40d6cd193
commit 183779c4a2

View File

@@ -102,7 +102,7 @@ static TileIndex GetReferenceTile(NewsReferenceType reftype, uint32_t ref)
static constexpr NWidgetPart _nested_normal_news_widgets[] = {
NWidget(WWT_PANEL, COLOUR_WHITE, WID_N_PANEL),
NWidget(NWID_VERTICAL), SetPadding(WidgetDimensions::unscaled.fullbevel),
NWidget(NWID_LAYER),
NWidget(NWID_LAYER, INVALID_COLOUR),
/* Layer 1 */
NWidget(NWID_VERTICAL), SetPIPRatio(0, 0, 1),
NWidget(NWID_HORIZONTAL), SetPIPRatio(0, 1, 0),
@@ -134,7 +134,7 @@ static WindowDesc _normal_news_desc(
static constexpr NWidgetPart _nested_vehicle_news_widgets[] = {
NWidget(WWT_PANEL, COLOUR_WHITE, WID_N_PANEL),
NWidget(NWID_VERTICAL), SetPadding(WidgetDimensions::unscaled.fullbevel),
NWidget(NWID_LAYER),
NWidget(NWID_LAYER, INVALID_COLOUR),
/* Layer 1 */
NWidget(NWID_VERTICAL), SetPIPRatio(0, 0, 1),
NWidget(NWID_HORIZONTAL), SetPIPRatio(0, 1, 0),
@@ -181,7 +181,7 @@ static WindowDesc _vehicle_news_desc(
static constexpr NWidgetPart _nested_company_news_widgets[] = {
NWidget(WWT_PANEL, COLOUR_WHITE, WID_N_PANEL),
NWidget(NWID_VERTICAL), SetPadding(WidgetDimensions::unscaled.fullbevel),
NWidget(NWID_LAYER),
NWidget(NWID_LAYER, INVALID_COLOUR),
/* Layer 1 */
NWidget(NWID_VERTICAL), SetPIPRatio(0, 0, 1),
NWidget(NWID_HORIZONTAL), SetPIPRatio(0, 1, 0),
@@ -225,7 +225,7 @@ static WindowDesc _company_news_desc(
static constexpr NWidgetPart _nested_thin_news_widgets[] = {
NWidget(WWT_PANEL, COLOUR_WHITE, WID_N_PANEL),
NWidget(NWID_VERTICAL), SetPadding(WidgetDimensions::unscaled.fullbevel),
NWidget(NWID_LAYER),
NWidget(NWID_LAYER, INVALID_COLOUR),
/* Layer 1 */
NWidget(NWID_VERTICAL), SetPIPRatio(0, 0, 1),
NWidget(NWID_HORIZONTAL), SetPIPRatio(0, 1, 0),