diff options
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/quitdialog.cpp | 23 | ||||
-rw-r--r-- | src/gui/quitdialog.h | 3 | ||||
-rw-r--r-- | src/gui/statuswindow.cpp | 4 |
3 files changed, 14 insertions, 16 deletions
diff --git a/src/gui/quitdialog.cpp b/src/gui/quitdialog.cpp index 8003cb2c..4a5cfe33 100644 --- a/src/gui/quitdialog.cpp +++ b/src/gui/quitdialog.cpp @@ -26,10 +26,15 @@ #include "gui/widgets/button.h" #include "gui/widgets/radiobutton.h" +#include "net/charhandler.h" +#include "net/net.h" + #include "utils/gettext.h" -QuitDialog::QuitDialog(bool* quitGame, QuitDialog** pointerToMe): - Window(_("Quit"), true, NULL), mQuitGame(quitGame), mMyPointer(pointerToMe) +#include <assert.h> + +QuitDialog::QuitDialog(QuitDialog** pointerToMe): + Window(_("Quit"), true, NULL), mMyPointer(pointerToMe) { mLogoutQuit = new RadioButton(_("Quit"), "quitdialog"); @@ -104,27 +109,17 @@ void QuitDialog::action(const gcn::ActionEvent &event) } else if (mLogoutQuit->isSelected()) { - if ((state == STATE_GAME) && (mQuitGame)) - { - *mQuitGame = true; - } - state = STATE_EXIT; } else if (mSwitchAccountServer->isSelected()) { - if ((state == STATE_GAME) && (mQuitGame)) - { - *mQuitGame = true; - } - state = STATE_SWITCH_SERVER; } else if (mSwitchCharacter->isSelected()) { - if (mQuitGame) *mQuitGame = true; + assert(state == STATE_GAME); - state = STATE_SWITCH_CHARACTER; + Net::getCharHandler()->switchCharacter(); } } scheduleDelete(); diff --git a/src/gui/quitdialog.h b/src/gui/quitdialog.h index 252c283d..04ce6d16 100644 --- a/src/gui/quitdialog.h +++ b/src/gui/quitdialog.h @@ -43,7 +43,7 @@ class QuitDialog : public Window, public gcn::ActionListener * @quitGame; to be used for getting out of the while loop in Game * @pointerToMe will be set to NULL when the QuitDialog is destroyed */ - QuitDialog(bool *quitGame, QuitDialog **pointerToMe); + QuitDialog(QuitDialog **pointerToMe); /** * Destructor @@ -63,7 +63,6 @@ class QuitDialog : public Window, public gcn::ActionListener gcn::Button *mOkButton; gcn::Button *mCancelButton; - bool *mQuitGame; QuitDialog **mMyPointer; }; diff --git a/src/gui/statuswindow.cpp b/src/gui/statuswindow.cpp index 8e31f350..de70457d 100644 --- a/src/gui/statuswindow.cpp +++ b/src/gui/statuswindow.cpp @@ -183,6 +183,10 @@ StatusWindow::StatusWindow(): std::string StatusWindow::update(int id) { + /*/ TODO get rid of this + if (!player_node) + return "";*/ + if (miniStatusWindow) miniStatusWindow->update(id); |