Codechange: Build engine preview strings from separate strings. (#13579)

This replaces stuffing substrings and parameters in various global parameters and uses local parameters instead.
This commit is contained in:
Peter Nelson
2025-02-16 19:02:02 +00:00
committed by GitHub
parent af00b835a1
commit d13b0e0813
4 changed files with 90 additions and 85 deletions

View File

@@ -430,7 +430,7 @@ struct NewsWindow : Window {
void UpdateWidgetSize(WidgetID widget, Dimension &size, [[maybe_unused]] const Dimension &padding, [[maybe_unused]] Dimension &fill, [[maybe_unused]] Dimension &resize) override
{
StringID str = STR_NULL;
std::string str;
switch (widget) {
case WID_N_CAPTION: {
/* Caption is not a real caption (so that the window cannot be moved)
@@ -447,16 +447,16 @@ struct NewsWindow : Window {
case WID_N_MESSAGE:
CopyInDParam(this->ni->params);
str = this->ni->string_id;
str = GetString(this->ni->string_id);
break;
case WID_N_COMPANY_MSG:
str = this->GetCompanyMessageString();
str = GetString(this->GetCompanyMessageString());
break;
case WID_N_VEH_NAME:
case WID_N_VEH_TITLE:
str = this->GetNewVehicleMessageString(widget);
str = GetString(this->GetNewVehicleMessageString(widget));
break;
case WID_N_VEH_INFO: {