diff options
author | Ira Rice <irarice@gmail.com> | 2009-02-25 10:29:34 -0700 |
---|---|---|
committer | Ira Rice <irarice@gmail.com> | 2009-02-25 10:29:34 -0700 |
commit | 543166b9d50ebf06bfc83a32fb2bab3b366eb871 (patch) | |
tree | e50f86ef77cad8a5e2801b1aaba33632f5e215ef | |
parent | 0aaf301660a504d94f758ac8a4d50dc33c189fa7 (diff) | |
download | mana-543166b9d50ebf06bfc83a32fb2bab3b366eb871.tar.gz mana-543166b9d50ebf06bfc83a32fb2bab3b366eb871.tar.bz2 mana-543166b9d50ebf06bfc83a32fb2bab3b366eb871.tar.xz mana-543166b9d50ebf06bfc83a32fb2bab3b366eb871.zip |
Make sure that all dialogs are cleared on player death, not just the NPC
text dialog.
Signed-off-by: Ira Rice <irarice@gmail.com>
-rw-r--r-- | src/gui/npc_text.cpp | 1 | ||||
-rw-r--r-- | src/gui/npcintegerdialog.cpp | 5 | ||||
-rw-r--r-- | src/gui/npcintegerdialog.h | 5 | ||||
-rw-r--r-- | src/gui/npclistdialog.cpp | 1 | ||||
-rw-r--r-- | src/net/npchandler.cpp | 2 | ||||
-rw-r--r-- | src/net/playerhandler.cpp | 4 |
6 files changed, 15 insertions, 3 deletions
diff --git a/src/gui/npc_text.cpp b/src/gui/npc_text.cpp index 0b7592c7..c28f1403 100644 --- a/src/gui/npc_text.cpp +++ b/src/gui/npc_text.cpp @@ -75,6 +75,7 @@ void NpcTextDialog::addText(const std::string &text) void NpcTextDialog::clearText() { + NPC::mTalking = false; setText(""); } diff --git a/src/gui/npcintegerdialog.cpp b/src/gui/npcintegerdialog.cpp index d0a7c7be..9c49a630 100644 --- a/src/gui/npcintegerdialog.cpp +++ b/src/gui/npcintegerdialog.cpp @@ -70,6 +70,11 @@ int NpcIntegerDialog::getValue() return mValueField->getValue(); } +void NpcIntegerDialog::reset() +{ + mValueField->reset(); +} + void NpcIntegerDialog::action(const gcn::ActionEvent &event) { bool finish = false; diff --git a/src/gui/npcintegerdialog.h b/src/gui/npcintegerdialog.h index a4ca33cf..cca8cb32 100644 --- a/src/gui/npcintegerdialog.h +++ b/src/gui/npcintegerdialog.h @@ -55,6 +55,11 @@ class NpcIntegerDialog : public Window, public gcn::ActionListener int getValue(); /** + * Resets the integer input field. + */ + void reset(); + + /** * Prepares the NPC dialog. * * @param min The minimum value to allow diff --git a/src/gui/npclistdialog.cpp b/src/gui/npclistdialog.cpp index f3bb949a..2c4dfc04 100644 --- a/src/gui/npclistdialog.cpp +++ b/src/gui/npclistdialog.cpp @@ -86,6 +86,7 @@ void NpcListDialog::parseItems(const std::string &itemString) void NpcListDialog::reset() { + mItemList->setSelected(-1); mItems.clear(); } diff --git a/src/net/npchandler.cpp b/src/net/npchandler.cpp index 26250d9e..a59ee814 100644 --- a/src/net/npchandler.cpp +++ b/src/net/npchandler.cpp @@ -76,12 +76,10 @@ void NPCHandler::handleMessage(MessageIn *msg) id = msg->readInt32(); if (current_npc == dynamic_cast<NPC*>(beingManager->findBeing(id))) current_npc = NULL; - NPC::mTalking = false; break; case SMSG_NPC_NEXT: // Next button in NPC dialog, currently unused - NPC::mTalking = false; break; case SMSG_NPC_INT_INPUT: diff --git a/src/net/playerhandler.cpp b/src/net/playerhandler.cpp index c1e0d033..0637d784 100644 --- a/src/net/playerhandler.cpp +++ b/src/net/playerhandler.cpp @@ -82,14 +82,16 @@ namespace { player_node->revive(); deathNotice = NULL; npcIntegerDialog->setVisible(false); + npcListDialog->reset(); npcListDialog->setVisible(false); + npcStringDialog->setValue(""); npcStringDialog->setVisible(false); npcTextDialog->clearText(); npcTextDialog->setVisible(false); buyDialog->setVisible(false); sellDialog->setVisible(false); buySellDialog->setVisible(false); - current_npc = 0; + current_npc = NULL; } } deathListener; } |