1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-25 21:24:12 +01:00

Codechange: add and use SetString over directly accessing widget_data

This commit is contained in:
Rubidium
2025-01-02 12:46:21 +01:00
committed by rubidium42
parent fb06ddafba
commit b60101853c
16 changed files with 74 additions and 42 deletions

View File

@@ -308,7 +308,7 @@ public:
/* When downloading is finished change cancel in ok */
if (this->downloaded_bytes == this->total_bytes) {
this->GetWidget<NWidgetCore>(WID_NCDS_CANCELOK)->widget_data = STR_BUTTON_OK;
this->GetWidget<NWidgetCore>(WID_NCDS_CANCELOK)->SetString(STR_BUTTON_OK);
}
}
};
@@ -1003,7 +1003,7 @@ public:
this->SetWidgetDisabledState(WID_NCL_TEXTFILE + tft, this->selected == nullptr || this->selected->state != ContentInfo::ALREADY_HERE || !this->selected->GetTextfile(tft).has_value());
}
this->GetWidget<NWidgetCore>(WID_NCL_CANCEL)->widget_data = this->filesize_sum == 0 ? STR_AI_SETTINGS_CLOSE : STR_AI_LIST_CANCEL;
this->GetWidget<NWidgetCore>(WID_NCL_CANCEL)->SetString(this->filesize_sum == 0 ? STR_AI_SETTINGS_CLOSE : STR_AI_LIST_CANCEL);
}
};