diff options
author | yexo <yexo@openttd.org> | 2010-05-21 06:59:45 +0000 |
---|---|---|
committer | yexo <yexo@openttd.org> | 2010-05-21 06:59:45 +0000 |
commit | 9ed9aa9012fff20c9d73c5fa80e65e64c0925937 (patch) | |
tree | 210b679b8a15e4983c43e46df497e9e10edf8561 /src/intro_gui.cpp | |
parent | 93233a9335aa26404405af54758e164bc0b96b41 (diff) | |
download | openttd-9ed9aa9012fff20c9d73c5fa80e65e64c0925937.tar.xz |
(svn r19871) -Fix [FS#3826]: update the landscape buttons in the main menu / newgame window correctly (planetmaker)
Diffstat (limited to 'src/intro_gui.cpp')
-rw-r--r-- | src/intro_gui.cpp | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/src/intro_gui.cpp b/src/intro_gui.cpp index 5cb4a3890..dc8befb75 100644 --- a/src/intro_gui.cpp +++ b/src/intro_gui.cpp @@ -30,12 +30,6 @@ #include "table/strings.h" #include "table/sprites.h" -static inline void SetNewLandscapeType(byte landscape) -{ - _settings_newgame.game_creation.landscape = landscape; - SetWindowClassesDirty(WC_SELECT_GAME); -} - enum SelectGameIntroWidgets { SGI_GENERATE_GAME, SGI_LOAD_GAME, @@ -61,11 +55,10 @@ struct SelectGameWindow : public Window { SelectGameWindow(const WindowDesc *desc) : Window() { this->InitNested(desc); - this->LowerWidget(_settings_newgame.game_creation.landscape + SGI_TEMPERATE_LANDSCAPE); - this->SetLandscapeButtons(); + this->OnInvalidateData(); } - void SetLandscapeButtons() + virtual void OnInvalidateData(int data = 0) { this->SetWidgetLoweredState(SGI_TEMPERATE_LANDSCAPE, _settings_newgame.game_creation.landscape == LT_TEMPERATE); this->SetWidgetLoweredState(SGI_ARCTIC_LANDSCAPE, _settings_newgame.game_creation.landscape == LT_ARCTIC); @@ -129,9 +122,7 @@ struct SelectGameWindow : public Window { case SGI_TEMPERATE_LANDSCAPE: case SGI_ARCTIC_LANDSCAPE: case SGI_TROPIC_LANDSCAPE: case SGI_TOYLAND_LANDSCAPE: - this->RaiseWidget(_settings_newgame.game_creation.landscape + SGI_TEMPERATE_LANDSCAPE); SetNewLandscapeType(widget - SGI_TEMPERATE_LANDSCAPE); - this->SetLandscapeButtons(); break; case SGI_OPTIONS: ShowGameOptions(); break; |