From 8519fc5cb5d95e1ed753912aaa70a8f041c31abc Mon Sep 17 00:00:00 2001 From: Jared Adams Date: Fri, 27 Mar 2009 06:30:42 -0600 Subject: Fix some problems with NPC dialogs NPCListDialog couldn't be opened because of infinite recursion, and it and NPCTextDialog both had resize bugs. --- src/gui/npc_text.cpp | 6 ------ src/gui/npc_text.h | 7 ------- src/gui/npclistdialog.cpp | 3 --- src/net/ea/npchandler.cpp | 2 ++ 4 files changed, 2 insertions(+), 16 deletions(-) diff --git a/src/gui/npc_text.cpp b/src/gui/npc_text.cpp index 5158e966..9fa57be8 100644 --- a/src/gui/npc_text.cpp +++ b/src/gui/npc_text.cpp @@ -157,9 +157,3 @@ void NpcTextDialog::widgetResized(const gcn::Event &event) setText(mText); } - -void NpcTextDialog::requestFocus() -{ - loadWindowState(); - setVisible(true); -} diff --git a/src/gui/npc_text.h b/src/gui/npc_text.h index 4c0c31e3..16c1d5fd 100644 --- a/src/gui/npc_text.h +++ b/src/gui/npc_text.h @@ -93,13 +93,6 @@ class NpcTextDialog : public Window, public gcn::ActionListener */ void closeDialog(int npcID = current_npc); - /** - * Initializes window width to the last known setting. Since the dialog - * doesn't need any extra focus outside of what it's given in the Game - * class, this is all it does for now. - */ - void requestFocus(); - /** * Called when resizing the window. * diff --git a/src/gui/npclistdialog.cpp b/src/gui/npclistdialog.cpp index 968e2514..ff91c9fc 100644 --- a/src/gui/npclistdialog.cpp +++ b/src/gui/npclistdialog.cpp @@ -155,7 +155,6 @@ void NpcListDialog::setVisible(bool visible) { if (visible) { npcTextDialog->setVisible(true); - requestFocus(); } Window::setVisible(visible); @@ -165,6 +164,4 @@ void NpcListDialog::requestFocus() { mItemList->requestFocus(); mItemList->setSelected(0); - loadWindowState(); - setVisible(true); } diff --git a/src/net/ea/npchandler.cpp b/src/net/ea/npchandler.cpp index 165cc2d3..0e0bc53d 100644 --- a/src/net/ea/npchandler.cpp +++ b/src/net/ea/npchandler.cpp @@ -61,6 +61,7 @@ void NPCHandler::handleMessage(MessageIn &msg) current_npc = msg.readInt32(); player_node->setAction(LocalPlayer::STAND); npcListDialog->parseItems(msg.readString(msg.getLength() - 8)); + npcListDialog->setVisible(true); npcListDialog->requestFocus(); break; @@ -69,6 +70,7 @@ void NPCHandler::handleMessage(MessageIn &msg) current_npc = msg.readInt32(); player_node->setAction(LocalPlayer::STAND); npcTextDialog->addText(msg.readString(msg.getLength() - 8)); + npcTextDialog->setVisible(true); npcTextDialog->requestFocus(); break; -- cgit v1.2.3-60-g2f50