From 4ead5c9f65ffbf1de9b0cb60cae06b116badbced Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 2 Feb 2011 22:15:55 +0200 Subject: Close npc and other dialogs if reconnecting. Also save extra layers if network error. --- src/net/npchandler.h | 2 ++ src/net/tmwa/npchandler.cpp | 2 +- src/net/tmwa/playerhandler.cpp | 9 +-------- 3 files changed, 4 insertions(+), 9 deletions(-) (limited to 'src/net') diff --git a/src/net/npchandler.h b/src/net/npchandler.h index 1b08a83ec..e12cd9422 100644 --- a/src/net/npchandler.h +++ b/src/net/npchandler.h @@ -59,6 +59,8 @@ class NpcHandler virtual void sellItem(int beingId, int itemId, int amount) = 0; virtual void endShopping(int beingId) = 0; + + virtual void clearDialogs() = 0; }; } // namespace Net diff --git a/src/net/tmwa/npchandler.cpp b/src/net/tmwa/npchandler.cpp index 84fe1789c..22f4c7687 100644 --- a/src/net/tmwa/npchandler.cpp +++ b/src/net/tmwa/npchandler.cpp @@ -112,7 +112,7 @@ void NpcHandler::handleMessage(Net::MessageIn &msg) msg.readString(msg.getLength() - 8); break; - case SMSG_NPC_CLOSE: + case SMSG_NPC_CLOSE: // Show the close button if (dialog) dialog->showCloseButton(); diff --git a/src/net/tmwa/playerhandler.cpp b/src/net/tmwa/playerhandler.cpp index 8ef19c373..528e727a3 100644 --- a/src/net/tmwa/playerhandler.cpp +++ b/src/net/tmwa/playerhandler.cpp @@ -29,12 +29,8 @@ #include "playerinfo.h" #include "units.h" -#include "gui/buy.h" -#include "gui/buysell.h" #include "gui/gui.h" -#include "gui/npcdialog.h" #include "gui/okdialog.h" -#include "gui/sell.h" #include "gui/skilldialog.h" #include "gui/statuswindow.h" #include "gui/viewport.h" @@ -79,10 +75,7 @@ namespace Net::getPlayerHandler()->respawn(); deathNotice = NULL; - BuyDialog::closeAll(); - BuySellDialog::closeAll(); - NpcDialog::closeAll(); - SellDialog::closeAll(); + Client::closeDialogs(); if (viewport) viewport->closePopupMenu(); -- cgit v1.2.3-70-g09d2