diff options
Diffstat (limited to 'src/cheat_gui.cpp')
-rw-r--r-- | src/cheat_gui.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/cheat_gui.cpp b/src/cheat_gui.cpp index d83cd3996..3a40fb21d 100644 --- a/src/cheat_gui.cpp +++ b/src/cheat_gui.cpp @@ -203,12 +203,14 @@ static const NWidgetPart _nested_cheat_widgets[] = { NWidget(WWT_STICKYBOX, COLOUR_GREY), EndContainer(), NWidget(WWT_PANEL, COLOUR_GREY, WID_C_PANEL), SetDataTip(0x0, STR_CHEATS_TOOLTIP), EndContainer(), + NWidget(WWT_PANEL, COLOUR_GREY), + NWidget(WWT_LABEL, COLOUR_GREY, WID_C_NOTE), SetFill(1, 1), SetDataTip(STR_CHEATS_NOTE, STR_NULL), SetPadding(WD_PAR_VSEP_NORMAL, 4, WD_PAR_VSEP_NORMAL, 4), + EndContainer(), }; /** GUI for the cheats. */ struct CheatWindow : Window { int clicked; - int header_height; int clicked_widget; uint line_height; int box_width; @@ -223,8 +225,7 @@ struct CheatWindow : Window { { if (widget != WID_C_PANEL) return; - int y = r.top + WD_FRAMERECT_TOP + this->header_height; - DrawStringMultiLine(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_LEFT, r.top + WD_FRAMERECT_TOP, y, STR_CHEATS_WARNING, TC_FROMSTRING, SA_CENTER); + int y = r.top + WD_FRAMERECT_TOP + WD_PAR_VSEP_NORMAL; bool rtl = _current_text_dir == TD_RTL; uint box_left = rtl ? r.right - this->box_width - 5 : r.left + 5; @@ -324,14 +325,13 @@ struct CheatWindow : Window { 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); + size->height = WD_FRAMERECT_TOP + WD_PAR_VSEP_NORMAL + WD_FRAMERECT_BOTTOM + this->line_height * lengthof(_cheats_ui); } void OnClick(Point pt, int widget, int click_count) override { const NWidgetBase *wid = this->GetWidget<NWidgetBase>(WID_C_PANEL); - uint btn = (pt.y - wid->pos_y - WD_FRAMERECT_TOP - this->header_height) / this->line_height; + uint btn = (pt.y - wid->pos_y - WD_FRAMERECT_TOP - WD_PAR_VSEP_NORMAL) / this->line_height; int x = pt.x - wid->pos_x; bool rtl = _current_text_dir == TD_RTL; if (rtl) x = wid->current_x - x; |