231 uint box_left = rtl ? r.right - this->box_width - 5 : r.left + 5;
232 uint button_left = rtl ? r.right - this->box_width - 10 -
SETTING_BUTTON_WIDTH : r.left + this->box_width + 10;
239 for (
int i = 0; i !=
lengthof(_cheats_ui); i++) {
242 DrawSprite((*ce->
been_used) ? SPR_BOX_CHECKED : SPR_BOX_EMPTY, PAL_NONE, box_left, y + icon_y_offset + 2);
249 SetDParam(0, on ? STR_CONFIG_SETTING_ON : STR_CONFIG_SETTING_OFF);
258 DrawArrowButtons(button_left, y + icon_y_offset, COLOUR_YELLOW, clicked - (i * 2),
true,
true);
265 case STR_CHEAT_CHANGE_COMPANY: {
267 GetString(buf, STR_CHEAT_CHANGE_COMPANY,
lastof(buf));
279 DrawString(text_left, text_right, y + text_y_offset, ce->
str);
281 y += this->line_height;
290 for (
int i = 0; i !=
lengthof(_cheats_ui); i++) {
303 case STR_CHEAT_CHANGE_DATE:
309 case STR_CHEAT_CHANGE_COMPANY:
336 int x = pt.x - wid->
pos_x;
340 if (btn >=
lengthof(_cheats_ui))
return;
344 int oldvalue = value;
367 if (ce->
proc != NULL) ce->
proc(value, 0);
375 if (value != oldvalue || btn ==
CHT_MONEY) this->clicked = btn * 2 + 1 + ((x >= 10 + this->box_width +
SETTING_BUTTON_WIDTH / 2) != rtl ? 1 : 0);
395 if (str == NULL ||
StrEmpty(str))
return;
397 const CheatEntry *ce = &_cheats_ui[clicked_widget];
399 int value = atoi(str);
401 value = ce->
proc(value, value - oldvalue);
413 _nested_cheat_widgets,
lengthof(_nested_cheat_widgets)