summaryrefslogtreecommitdiff
path: root/src/intro_gui.cpp
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2009-07-04 15:35:36 +0000
committeralberth <alberth@openttd.org>2009-07-04 15:35:36 +0000
commitd65c6cae545f36e7f25efcee0b28bbfac7d64769 (patch)
tree88411cfe473c05b2abb2c6afdce7932f660312cd /src/intro_gui.cpp
parent2385aeae3c3b065fac37724334469f1ed9ea29f3 (diff)
downloadopenttd-d65c6cae545f36e7f25efcee0b28bbfac7d64769.tar.xz
(svn r16740) -Codechange: Self-sizing widgets in intro screen, town directory, and found town windows.
Diffstat (limited to 'src/intro_gui.cpp')
-rw-r--r--src/intro_gui.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/intro_gui.cpp b/src/intro_gui.cpp
index 0b08be4db..d61f5b252 100644
--- a/src/intro_gui.cpp
+++ b/src/intro_gui.cpp
@@ -83,6 +83,18 @@ struct SelectGameWindow : public Window {
}
}
+ virtual Dimension GetWidgetContentSize(int widget)
+ {
+ Dimension d = {0, 0};
+ if (widget == SGI_DIFFICULTIES) {
+ for (uint i = STR_DIFFICULTY_LEVEL_EASY; i <= STR_DIFFICULTY_LEVEL_CUSTOM; i++) {
+ SetDParam(0, STR_DIFFICULTY_LEVEL_EASY + _settings_newgame.difficulty.diff_level);
+ d = maxdim(d, GetStringBoundingBox(STR_INTRO_DIFFICULTY));
+ }
+ }
+ return d;
+ }
+
virtual void OnClick(Point pt, int widget)
{
#ifdef ENABLE_NETWORK