diff options
author | Jared Adams <jaxad0127@gmail.com> | 2009-03-10 12:43:56 -0600 |
---|---|---|
committer | Ira Rice <irarice@gmail.com> | 2009-03-10 12:59:03 -0600 |
commit | 4676d0fe6ee938031ce13a65927718f9b53810cf (patch) | |
tree | e0cbcf26a8814d69826627528b7eb813ae789ed2 /src | |
parent | cabb9735f2e31b9f1f64b2496e1775d54861da36 (diff) | |
download | mana-client-4676d0fe6ee938031ce13a65927718f9b53810cf.tar.gz mana-client-4676d0fe6ee938031ce13a65927718f9b53810cf.tar.bz2 mana-client-4676d0fe6ee938031ce13a65927718f9b53810cf.tar.xz mana-client-4676d0fe6ee938031ce13a65927718f9b53810cf.zip |
Remove some SetupWindow weirdness
Diffstat (limited to 'src')
-rw-r--r-- | src/game.cpp | 2 | ||||
-rw-r--r-- | src/gui/setup.cpp | 13 | ||||
-rw-r--r-- | src/gui/setup.h | 8 | ||||
-rw-r--r-- | src/main.cpp | 3 |
4 files changed, 18 insertions, 8 deletions
diff --git a/src/game.cpp b/src/game.cpp index 144b059f..3b621acd 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -122,7 +122,6 @@ NpcListDialog *npcListDialog; NpcTextDialog *npcTextDialog; NpcStringDialog *npcStringDialog; SkillDialog *skillDialog; -Setup* setupWindow; Minimap *minimap; EquipmentWindow *equipmentWindow; TradeWindow *tradeWindow; @@ -261,7 +260,6 @@ void destroyGuiWindows() delete npcTextDialog; delete npcStringDialog; delete skillDialog; - delete setupWindow; delete minimap; delete equipmentWindow; delete tradeWindow; diff --git a/src/gui/setup.cpp b/src/gui/setup.cpp index 4798f598..f1e7a6d9 100644 --- a/src/gui/setup.cpp +++ b/src/gui/setup.cpp @@ -65,12 +65,12 @@ 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(); + TabbedArea *panel = new TabbedArea; panel->setDimension(gcn::Rectangle(5, 5, width - 10, height - 40)); SetupTab *tab; @@ -141,3 +141,10 @@ void Setup::action(const gcn::ActionEvent &event) tradeWindow->resetToDefaultSize(); } } + +void Setup::setInGame(bool inGame) +{ + mResetWindows->setEnabled(inGame); +} + +Setup* setupWindow; diff --git a/src/gui/setup.h b/src/gui/setup.h index 9f1bafc7..663bdfcb 100644 --- a/src/gui/setup.h +++ b/src/gui/setup.h @@ -56,8 +56,16 @@ class Setup : public Window, public gcn::ActionListener */ void action(const gcn::ActionEvent &event); + /** + * Enables the reset button when in game. + */ + void setInGame(bool inGame); + private: std::list<SetupTab*> mTabs; + gcn::Button* mResetWindows; }; +extern Setup* setupWindow; + #endif diff --git a/src/main.cpp b/src/main.cpp index f7468d84..9e7c91c0 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -101,8 +101,6 @@ namespace { - Window *setupWindow = 0; - struct SetupListener : public gcn::ActionListener { /** @@ -1020,7 +1018,6 @@ int main(int argc, char *argv[]) progressLabel = NULL; currentDialog = NULL; setup = NULL; - setupWindow = NULL; login_wallpaper->decRef(); login_wallpaper = NULL; |