From d8b465f5567bb6025d576384e9769f56139a7c3c Mon Sep 17 00:00:00 2001 From: frosch Date: Sun, 22 May 2016 12:00:36 +0000 Subject: (svn r27581) -Fix [FS#6461]: Button size computation in script configuration window. (adf88) --- src/ai/ai_gui.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src') diff --git a/src/ai/ai_gui.cpp b/src/ai/ai_gui.cpp index 8944e8bc4..a0720e2ea 100644 --- a/src/ai/ai_gui.cpp +++ b/src/ai/ai_gui.cpp @@ -28,6 +28,7 @@ #include "../widgets/dropdown_type.h" #include "../widgets/dropdown_func.h" #include "../hotkeys.h" +#include "../core/geometry_func.hpp" #include "ai.hpp" #include "ai_gui.hpp" @@ -766,6 +767,22 @@ struct AIConfigWindow : public Window { this->line_height = FONT_HEIGHT_NORMAL + WD_MATRIX_TOP + WD_MATRIX_BOTTOM; size->height = 8 * this->line_height; break; + + case WID_AIC_CHANGE: { + SetDParam(0, STR_AI_CONFIG_CHANGE_GAMESCRIPT); + Dimension dim = GetStringBoundingBox(STR_AI_CONFIG_CHANGE); + + SetDParam(0, STR_AI_CONFIG_CHANGE_NONE); + dim = maxdim(dim, GetStringBoundingBox(STR_AI_CONFIG_CHANGE)); + + SetDParam(0, STR_AI_CONFIG_CHANGE_AI); + dim = maxdim(dim, GetStringBoundingBox(STR_AI_CONFIG_CHANGE)); + + dim.width += padding.width; + dim.height += padding.height; + *size = maxdim(*size, dim); + break; + } } } -- cgit v1.2.3-70-g09d2