1
0
Fork 0

Fix 4389321623: Invalid string parameters in cheat window. (#13696)

Strings unnecessarily consumed an extra parameter, and change company use unformatted string.
pull/13697/head
Peter Nelson 2025-03-02 09:02:14 +00:00 committed by GitHub
parent edf9f597ec
commit 321debf7b1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 6 deletions

View File

@ -304,9 +304,9 @@ struct CheatWindow : Window {
/* Draw coloured flag for change company cheat */
case STR_CHEAT_CHANGE_COMPANY: {
uint offset = WidgetDimensions::scaled.hsep_indent + GetStringBoundingBox(ce->str).width;
DrawCompanyIcon(_local_company, rtl ? text_right - offset - WidgetDimensions::scaled.hsep_indent : text_left + offset, y + icon_y_offset);
str = GetString(ce->str, val + 1);
uint offset = WidgetDimensions::scaled.hsep_indent + GetStringBoundingBox(str).width;
DrawCompanyIcon(_local_company, rtl ? text_right - offset - WidgetDimensions::scaled.hsep_indent : text_left + offset, y + icon_y_offset);
break;
}

View File

@ -2265,15 +2265,15 @@ STR_HELP_WINDOW_COMMUNITY :{BLACK}Communit
STR_CHEATS :{WHITE}Sandbox Options
STR_CHEAT_MONEY :{LTBLUE}Increase money by {CURRENCY_LONG}
STR_CHEAT_CHANGE_COMPANY :{LTBLUE}Playing as company: {ORANGE}{COMMA}
STR_CHEAT_EXTRA_DYNAMITE :{LTBLUE}Magic bulldozer (remove industries, unmovable objects): {ORANGE}{STRING1}
STR_CHEAT_CROSSINGTUNNELS :{LTBLUE}Tunnels may cross each other: {ORANGE}{STRING1}
STR_CHEAT_EXTRA_DYNAMITE :{LTBLUE}Magic bulldozer (remove industries, unmovable objects): {ORANGE}{STRING}
STR_CHEAT_CROSSINGTUNNELS :{LTBLUE}Tunnels may cross each other: {ORANGE}{STRING}
STR_CHEAT_NO_JETCRASH :{LTBLUE}Jetplanes will not crash (frequently) on small airports: {ORANGE}{STRING}
STR_CHEAT_EDIT_MAX_HL :{LTBLUE}Edit the maximum map height: {ORANGE}{NUM}
STR_CHEAT_EDIT_MAX_HL_QUERY_CAPT :{WHITE}Edit the maximum height of mountains on the map
STR_CHEAT_CHANGE_DATE :{LTBLUE}Change date: {ORANGE}{DATE_SHORT}
STR_CHEAT_CHANGE_DATE_QUERY_CAPT :{WHITE}Change current year
STR_CHEAT_SETUP_PROD :{LTBLUE}Enable modifying production values: {ORANGE}{STRING1}
STR_CHEAT_STATION_RATING :{LTBLUE}Fix station ratings at 100%: {ORANGE}{STRING1}
STR_CHEAT_SETUP_PROD :{LTBLUE}Enable modifying production values: {ORANGE}{STRING}
STR_CHEAT_STATION_RATING :{LTBLUE}Fix station ratings at 100%: {ORANGE}{STRING}
# Livery window
STR_LIVERY_CAPTION :{WHITE}{COMPANY} - Colour Scheme