mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-18 09:52:44 +01:00
Codechange: add and use SetSprite over directly accessing widget_data
This commit is contained in:
@@ -585,7 +585,7 @@ public:
|
||||
/* If not a default group and the group has replace protection, show an enabled replace sprite. */
|
||||
uint16_t protect_sprite = SPR_GROUP_REPLACE_OFF_TRAIN;
|
||||
if (!IsDefaultGroupID(this->vli.index) && !IsAllGroupID(this->vli.index) && HasBit(Group::Get(this->vli.index)->flags, GroupFlags::GF_REPLACE_PROTECTION)) protect_sprite = SPR_GROUP_REPLACE_ON_TRAIN;
|
||||
this->GetWidget<NWidgetCore>(WID_GL_REPLACE_PROTECTION)->widget_data = protect_sprite + this->vli.vtype;
|
||||
this->GetWidget<NWidgetCore>(WID_GL_REPLACE_PROTECTION)->SetSprite(protect_sprite + this->vli.vtype);
|
||||
|
||||
/* Set text of "group by" dropdown widget. */
|
||||
this->GetWidget<NWidgetCore>(WID_GL_GROUP_BY_DROPDOWN)->widget_data = std::data(this->vehicle_group_by_names)[this->grouping];
|
||||
|
||||
Reference in New Issue
Block a user