diff options
author | Jared Adams <jaxad0127@gmail.com> | 2009-10-30 07:55:47 -0600 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2009-10-30 07:55:47 -0600 |
commit | d5d10a30ceb4a9d6bbb19fe8cbcf878cd841cd53 (patch) | |
tree | ab809df771094d860c5f2b4f1ad0f1083c6a4dca /src/gui/quitdialog.cpp | |
parent | 1c0ee2fc301d88c5c696392d9959e82e2acd0086 (diff) | |
download | mana-d5d10a30ceb4a9d6bbb19fe8cbcf878cd841cd53.tar.gz mana-d5d10a30ceb4a9d6bbb19fe8cbcf878cd841cd53.tar.bz2 mana-d5d10a30ceb4a9d6bbb19fe8cbcf878cd841cd53.tar.xz mana-d5d10a30ceb4a9d6bbb19fe8cbcf878cd841cd53.zip |
Support switching characters under eAthena
Diffstat (limited to 'src/gui/quitdialog.cpp')
-rw-r--r-- | src/gui/quitdialog.cpp | 23 |
1 files changed, 9 insertions, 14 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(); |