File diff r27942:f7389062d120 → r27943:23c15817f0a5
src/cheat_gui.cpp
Show inline comments
 
@@ -342,12 +342,14 @@ struct CheatWindow : Window {
 
		size->width = width + WidgetDimensions::scaled.hsep_wide * 4 + this->box.width + SETTING_BUTTON_WIDTH /* stuff on the left */ + WidgetDimensions::scaled.hsep_wide * 2 /* extra spacing on right */;
 
		size->height = WidgetDimensions::scaled.framerect.Vertical() + this->line_height * lengthof(_cheats_ui);
 
	}
 

	
 
	void OnClick([[maybe_unused]] Point pt, int widget, [[maybe_unused]] int click_count) override
 
	{
 
		if (widget != WID_C_PANEL) return;
 

	
 
		Rect r = this->GetWidget<NWidgetBase>(WID_C_PANEL)->GetCurrentRect().Shrink(WidgetDimensions::scaled.framerect);
 
		uint btn = (pt.y - r.top) / this->line_height;
 
		uint x = pt.x - r.left;
 
		bool rtl = _current_text_dir == TD_RTL;
 
		if (rtl) x = r.Width() - 1 - x;