diff options
Diffstat (limited to 'src/gui/setup.cpp')
-rw-r--r-- | src/gui/setup.cpp | 55 |
1 files changed, 41 insertions, 14 deletions
diff --git a/src/gui/setup.cpp b/src/gui/setup.cpp index c8b7f900..72dfbce5 100644 --- a/src/gui/setup.cpp +++ b/src/gui/setup.cpp @@ -34,19 +34,27 @@ #include "../utils/gettext.h" extern Window *chatWindow; -extern Window *equipmentWindow; -extern Window *helpWindow; +extern Window *statusWindow; +extern Window *buyDialog; +extern Window *sellDialog; +extern Window *buySellDialog; extern Window *inventoryWindow; -extern Window *minimap; +extern Window *emoteWindow; +extern Window *npcTextDialog; +extern Window *npcStringDialog; extern Window *skillDialog; -extern Window *statusWindow; +extern Window *minimap; +extern Window *equipmentWindow; +extern Window *tradeWindow; +extern Window *helpWindow; +extern Window *debugWindow; extern Window *itemShortcutWindow; extern Window *emoteShortcutWindow; -extern Window *emoteWindow; -extern Window *tradeWindow; #ifdef TMWSERV_SUPPORT extern Window *magicDialog; extern Window *guildWindow; +#else +extern Window *storageWindow; #endif Setup::Setup(): @@ -68,9 +76,9 @@ Setup::Setup(): btn->setPosition(x, height - btn->getHeight() - 5); add(btn); - // Disable this button when the windows aren't created yet + // Store this button, as it needs to be enabled/disabled if (!strcmp(*curBtn, "Reset Windows")) - btn->setEnabled(statusWindow != NULL); + mResetWindows = btn; } TabbedArea *panel = new TabbedArea; @@ -104,7 +112,9 @@ Setup::Setup(): add(panel); - setLocationRelativeTo(getParent()); + center(); + + setInGame(false); } Setup::~Setup() @@ -131,20 +141,37 @@ void Setup::action(const gcn::ActionEvent &event) if (!statusWindow) return; - statusWindow->resetToDefaultSize(); - minimap->resetToDefaultSize(); chatWindow->resetToDefaultSize(); + statusWindow->resetToDefaultSize(); + buyDialog->resetToDefaultSize(); + sellDialog->resetToDefaultSize(); +#ifdef EATHENA_SUPPORT + buySellDialog->resetToDefaultSize(); +#endif inventoryWindow->resetToDefaultSize(); + emoteWindow->resetToDefaultSize(); + npcTextDialog->resetToDefaultSize(); + npcStringDialog->resetToDefaultSize(); + skillDialog->resetToDefaultSize(); + minimap->resetToDefaultSize(); equipmentWindow->resetToDefaultSize(); + tradeWindow->resetToDefaultSize(); helpWindow->resetToDefaultSize(); - skillDialog->resetToDefaultSize(); + debugWindow->resetToDefaultSize(); itemShortcutWindow->resetToDefaultSize(); emoteShortcutWindow->resetToDefaultSize(); - emoteWindow->resetToDefaultSize(); - tradeWindow->resetToDefaultSize(); #ifdef TMWSERV_SUPPORT magicDialog->resetToDefaultSize(); guildWindow->resetToDefaultSize(); +#else + storageWindow->resetToDefaultSize(); #endif } } + +void Setup::setInGame(bool inGame) +{ + mResetWindows->setEnabled(inGame); +} + +Setup* setupWindow; |