|
@@ -288,43 +288,43 @@ struct CheatWindow : Window {
|
|
|
uint width = 0;
|
|
|
for (int i = 0; i != lengthof(_cheats_ui); i++) {
|
|
|
const CheatEntry *ce = &_cheats_ui[i];
|
|
|
switch (ce->type) {
|
|
|
case SLE_BOOL:
|
|
|
SetDParam(0, STR_CONFIG_SETTING_ON);
|
|
|
width = max(width, GetStringBoundingBox(ce->str).width);
|
|
|
width = std::max(width, GetStringBoundingBox(ce->str).width);
|
|
|
SetDParam(0, STR_CONFIG_SETTING_OFF);
|
|
|
width = max(width, GetStringBoundingBox(ce->str).width);
|
|
|
width = std::max(width, GetStringBoundingBox(ce->str).width);
|
|
|
break;
|
|
|
|
|
|
default:
|
|
|
switch (ce->str) {
|
|
|
/* Display date for change date cheat */
|
|
|
case STR_CHEAT_CHANGE_DATE:
|
|
|
SetDParam(0, ConvertYMDToDate(MAX_YEAR, 11, 31));
|
|
|
width = max(width, GetStringBoundingBox(ce->str).width);
|
|
|
width = std::max(width, GetStringBoundingBox(ce->str).width);
|
|
|
break;
|
|
|
|
|
|
/* Draw coloured flag for change company cheat */
|
|
|
case STR_CHEAT_CHANGE_COMPANY:
|
|
|
SetDParamMaxValue(0, MAX_COMPANIES);
|
|
|
width = max(width, GetStringBoundingBox(ce->str).width + 10 + 10);
|
|
|
width = std::max(width, GetStringBoundingBox(ce->str).width + 10 + 10);
|
|
|
break;
|
|
|
|
|
|
default:
|
|
|
SetDParam(0, INT64_MAX);
|
|
|
width = max(width, GetStringBoundingBox(ce->str).width);
|
|
|
width = std::max(width, GetStringBoundingBox(ce->str).width);
|
|
|
break;
|
|
|
}
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
this->line_height = max(GetSpriteSize(SPR_BOX_CHECKED).height, GetSpriteSize(SPR_BOX_EMPTY).height);
|
|
|
this->line_height = max<uint>(this->line_height, SETTING_BUTTON_HEIGHT);
|
|
|
this->line_height = max<uint>(this->line_height, FONT_HEIGHT_NORMAL) + WD_PAR_VSEP_NORMAL;
|
|
|
this->line_height = std::max(GetSpriteSize(SPR_BOX_CHECKED).height, GetSpriteSize(SPR_BOX_EMPTY).height);
|
|
|
this->line_height = std::max<uint>(this->line_height, SETTING_BUTTON_HEIGHT);
|
|
|
this->line_height = std::max<uint>(this->line_height, FONT_HEIGHT_NORMAL) + WD_PAR_VSEP_NORMAL;
|
|
|
|
|
|
size->width = width + 20 + this->box_width + SETTING_BUTTON_WIDTH /* stuff on the left */ + 10 /* extra spacing on right */;
|
|
|
this->header_height = GetStringHeight(STR_CHEATS_WARNING, size->width - WD_FRAMERECT_LEFT - WD_FRAMERECT_RIGHT) + WD_PAR_VSEP_WIDE;
|
|
|
size->height = this->header_height + WD_FRAMERECT_TOP + WD_PAR_VSEP_NORMAL + WD_FRAMERECT_BOTTOM + this->line_height * lengthof(_cheats_ui);
|
|
|
}
|
|
|
|