summaryrefslogtreecommitdiff
path: root/src/gui/quitdialog.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-02-02 22:15:55 +0200
committerAndrei Karas <akaras@inbox.ru>2011-02-02 22:15:55 +0200
commit4ead5c9f65ffbf1de9b0cb60cae06b116badbced (patch)
treebc94093b90e7b4d3168259b7404ae2f6236f3925 /src/gui/quitdialog.cpp
parent4b0caea6389ab789ff3ae3a267b9002f8a21e8c3 (diff)
downloadmv-4ead5c9f65ffbf1de9b0cb60cae06b116badbced.tar.gz
mv-4ead5c9f65ffbf1de9b0cb60cae06b116badbced.tar.bz2
mv-4ead5c9f65ffbf1de9b0cb60cae06b116badbced.tar.xz
mv-4ead5c9f65ffbf1de9b0cb60cae06b116badbced.zip
Close npc and other dialogs if reconnecting.
Also save extra layers if network error.
Diffstat (limited to 'src/gui/quitdialog.cpp')
-rw-r--r--src/gui/quitdialog.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gui/quitdialog.cpp b/src/gui/quitdialog.cpp
index 221a94747..24dc953be 100644
--- a/src/gui/quitdialog.cpp
+++ b/src/gui/quitdialog.cpp
@@ -24,6 +24,7 @@
#include "client.h"
#include "gui/chat.h"
+#include "gui/npcdialog.h"
#include "gui/sdlinput.h"
#include "gui/viewport.h"
@@ -34,6 +35,7 @@
#include "net/charhandler.h"
#include "net/gamehandler.h"
+#include "net/npchandler.h"
#include "net/net.h"
#include "utils/gettext.h"
@@ -137,11 +139,13 @@ void QuitDialog::action(const gcn::ActionEvent &event)
}
else if (mLogoutQuit->isSelected())
{
+ Client::closeDialogs();
Client::setState(STATE_EXIT);
}
else if (Net::getGameHandler()->isConnected()
&& mSwitchAccountServer->isSelected())
{
+ Client::closeDialogs();
Client::setState(STATE_SWITCH_SERVER);
}
else if (mSwitchCharacter->isSelected())
@@ -149,6 +153,7 @@ void QuitDialog::action(const gcn::ActionEvent &event)
assert(Client::getState() == STATE_GAME);
Net::getCharHandler()->switchCharacter();
+ Client::closeDialogs();
}
}
scheduleDelete();