diff options
author | frosch <frosch@openttd.org> | 2016-05-22 12:00:36 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2016-05-22 12:00:36 +0000 |
commit | d8b465f5567bb6025d576384e9769f56139a7c3c (patch) | |
tree | 9da3ec354c08c64415142a52ce071fb583af1b5d /src/ai | |
parent | d188d02384387d9cb1e293abc6bc616c72de6850 (diff) | |
download | openttd-d8b465f5567bb6025d576384e9769f56139a7c3c.tar.xz |
(svn r27581) -Fix [FS#6461]: Button size computation in script configuration window. (adf88)
Diffstat (limited to 'src/ai')
-rw-r--r-- | src/ai/ai_gui.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
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; + } } } |