(svn r16740) -Codechange: Self-sizing widgets in intro screen, town directory, and found town windows.
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user