1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-27 14:14:27 +01:00

Codechange: Use only raw strings in drop down lists. (#13667)

Strings with parameters are now pre-formatted, avoiding global parameters.

Helper functions still allow StringID.
This commit is contained in:
Peter Nelson
2025-02-27 21:11:16 +00:00
committed by GitHub
parent fd8c33d051
commit e2c1b9f03e
18 changed files with 55 additions and 67 deletions

View File

@@ -388,7 +388,7 @@ struct NewGRFParametersWindow : public Window {
DropDownList list;
for (const auto &[value, name] : par_info.value_names) {
list.push_back(MakeDropDownListStringItem(GetGRFStringFromGRFText(name), value));
list.push_back(MakeDropDownListStringItem(GetString(STR_JUST_RAW_STRING, GetGRFStringFromGRFText(name)), value));
}
ShowDropDownListAt(this, std::move(list), old_val, WID_NP_SETTING_DROPDOWN, wi_rect, COLOUR_ORANGE);
@@ -942,7 +942,7 @@ struct NewGRFWindow : public Window, NewGRFScanCallback {
list.push_back(MakeDropDownListStringItem(STR_NONE, -1));
for (uint i = 0; i < this->grf_presets.size(); i++) {
list.push_back(MakeDropDownListStringItem(this->grf_presets[i], i));
list.push_back(MakeDropDownListStringItem(std::string{this->grf_presets[i]}, i));
}
this->CloseChildWindows(WC_QUERY_STRING); // Remove the parameter query window