232 uint box_left = rtl ? r.right - this->box_width - 5 : r.left + 5;
233 uint button_left = rtl ? r.right - this->box_width - 10 -
SETTING_BUTTON_WIDTH : r.left + this->box_width + 10;
240 for (
int i = 0; i !=
lengthof(_cheats_ui); i++) {
243 DrawSprite((*ce->
been_used) ? SPR_BOX_CHECKED : SPR_BOX_EMPTY, PAL_NONE, box_left, y + icon_y_offset + 2);
250 SetDParam(0, on ? STR_CONFIG_SETTING_ON : STR_CONFIG_SETTING_OFF);
259 DrawArrowButtons(button_left, y + icon_y_offset, COLOUR_YELLOW, clicked - (i * 2),
true,
true);
266 case STR_CHEAT_CHANGE_COMPANY: {
268 GetString(buf, STR_CHEAT_CHANGE_COMPANY,
lastof(buf));
280 DrawString(text_left, text_right, y + text_y_offset, ce->
str);
282 y += this->line_height;
291 for (
int i = 0; i !=
lengthof(_cheats_ui); i++) {
304 case STR_CHEAT_CHANGE_DATE:
310 case STR_CHEAT_CHANGE_COMPANY:
337 int x = pt.x - wid->
pos_x;
341 if (btn >=
lengthof(_cheats_ui))
return;
345 int oldvalue = value;
368 if (ce->
proc != NULL) ce->
proc(value, 0);
376 if (value != oldvalue || btn ==
CHT_MONEY) this->clicked = btn * 2 + 1 + ((x >= 10 + this->box_width +
SETTING_BUTTON_WIDTH / 2) != rtl ? 1 : 0);
396 if (str == NULL ||
StrEmpty(str))
return;
398 const CheatEntry *ce = &_cheats_ui[clicked_widget];
400 int value = atoi(str);
402 value = ce->
proc(value, value - oldvalue);
414 _nested_cheat_widgets,
lengthof(_nested_cheat_widgets)