(svn r16740) -Codechange: Self-sizing widgets in intro screen, town directory, and found town windows.

This commit is contained in:
alberth
2009-07-04 15:35:36 +00:00
parent 9cfbe11e3a
commit 43ee12137b
6 changed files with 173 additions and 34 deletions

View File

@@ -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