From 3ecd1187badb2d13564f1e8ac97901c2ef047480 Mon Sep 17 00:00:00 2001 From: Rubidium Date: Fri, 3 Jan 2025 12:55:21 +0100 Subject: [PATCH] Codechange: set sprite once for group UI --- src/group_gui.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/group_gui.cpp b/src/group_gui.cpp index b6e03adf1f..3a46a20cd9 100644 --- a/src/group_gui.cpp +++ b/src/group_gui.cpp @@ -58,16 +58,16 @@ static constexpr NWidgetPart _nested_group_widgets[] = { NWidget(WWT_PANEL, COLOUR_GREY, WID_GL_INFO), SetFill(1, 1), SetMinimalTextLines(3, WidgetDimensions::unscaled.framerect.Vertical()), EndContainer(), NWidget(NWID_HORIZONTAL), NWidget(WWT_PUSHIMGBTN, COLOUR_GREY, WID_GL_CREATE_GROUP), - SetSpriteTip(SPR_GROUP_CREATE_TRAIN, STR_GROUP_CREATE_TOOLTIP), + SetToolTip(STR_GROUP_CREATE_TOOLTIP), NWidget(WWT_PUSHIMGBTN, COLOUR_GREY, WID_GL_DELETE_GROUP), - SetSpriteTip(SPR_GROUP_DELETE_TRAIN, STR_GROUP_DELETE_TOOLTIP), + SetToolTip(STR_GROUP_DELETE_TOOLTIP), NWidget(WWT_PUSHIMGBTN, COLOUR_GREY, WID_GL_RENAME_GROUP), - SetSpriteTip(SPR_GROUP_RENAME_TRAIN, STR_GROUP_RENAME_TOOLTIP), + SetToolTip(STR_GROUP_RENAME_TOOLTIP), NWidget(WWT_PUSHIMGBTN, COLOUR_GREY, WID_GL_LIVERY_GROUP), - SetSpriteTip(SPR_GROUP_LIVERY_TRAIN, STR_GROUP_LIVERY_TOOLTIP), + SetToolTip(STR_GROUP_LIVERY_TOOLTIP), NWidget(WWT_PANEL, COLOUR_GREY), SetFill(1, 0), EndContainer(), NWidget(WWT_PUSHIMGBTN, COLOUR_GREY, WID_GL_REPLACE_PROTECTION), - SetSpriteTip(SPR_GROUP_REPLACE_OFF_TRAIN, STR_GROUP_REPLACE_PROTECTION_TOOLTIP), + SetToolTip(STR_GROUP_REPLACE_PROTECTION_TOOLTIP), EndContainer(), EndContainer(), /* right part */ @@ -408,11 +408,11 @@ public: this->GetWidget(WID_GL_CAPTION)->SetString(STR_VEHICLE_LIST_TRAIN_CAPTION + this->vli.vtype); this->GetWidget(WID_GL_LIST_VEHICLE)->SetToolTip(STR_VEHICLE_LIST_TRAIN_LIST_TOOLTIP + this->vli.vtype); - this->GetWidget(WID_GL_CREATE_GROUP)->widget_data += this->vli.vtype; - this->GetWidget(WID_GL_RENAME_GROUP)->widget_data += this->vli.vtype; - this->GetWidget(WID_GL_DELETE_GROUP)->widget_data += this->vli.vtype; - this->GetWidget(WID_GL_LIVERY_GROUP)->widget_data += this->vli.vtype; - this->GetWidget(WID_GL_REPLACE_PROTECTION)->widget_data += this->vli.vtype; + this->GetWidget(WID_GL_CREATE_GROUP)->SetSprite(SPR_GROUP_CREATE_TRAIN + this->vli.vtype); + this->GetWidget(WID_GL_RENAME_GROUP)->SetSprite(SPR_GROUP_RENAME_TRAIN + this->vli.vtype); + this->GetWidget(WID_GL_DELETE_GROUP)->SetSprite(SPR_GROUP_DELETE_TRAIN + this->vli.vtype); + this->GetWidget(WID_GL_LIVERY_GROUP)->SetSprite(SPR_GROUP_LIVERY_TRAIN + this->vli.vtype); + this->GetWidget(WID_GL_REPLACE_PROTECTION)->SetSprite(SPR_GROUP_REPLACE_OFF_TRAIN + this->vli.vtype); this->FinishInitNested(window_number); this->owner = vli.company;