summaryrefslogtreecommitdiff
path: root/src/gui/npclistdialog.cpp
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2009-02-16 14:41:24 +0000
committerJared Adams <jaxad0127@gmail.com>2009-02-16 14:43:19 +0000
commit9dfc4ea2f30f43fb5ffd239b90b2a7259fbe0330 (patch)
tree37b2da3fc74946fb180b8e60d6e32b1190775a3f /src/gui/npclistdialog.cpp
parenta1a5ebb9ef14e013ae63a71c2c28609f2a65cdaa (diff)
downloadmana-9dfc4ea2f30f43fb5ffd239b90b2a7259fbe0330.tar.gz
mana-9dfc4ea2f30f43fb5ffd239b90b2a7259fbe0330.tar.bz2
mana-9dfc4ea2f30f43fb5ffd239b90b2a7259fbe0330.tar.xz
mana-9dfc4ea2f30f43fb5ffd239b90b2a7259fbe0330.zip
Add next/close buttons for NPCs
And keep the text dialog open for the whole transaction, logging user input and keep a full record of text from the NPC (for the current transaction only).
Diffstat (limited to 'src/gui/npclistdialog.cpp')
-rw-r--r--src/gui/npclistdialog.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/gui/npclistdialog.cpp b/src/gui/npclistdialog.cpp
index fe924da1..78d43fd2 100644
--- a/src/gui/npclistdialog.cpp
+++ b/src/gui/npclistdialog.cpp
@@ -23,6 +23,7 @@
#include "button.h"
#include "listbox.h"
+#include "npc_text.h"
#include "npclistdialog.h"
#include "scrollarea.h"
@@ -31,6 +32,9 @@
#include "../npc.h"
#include "../utils/gettext.h"
+#include "../utils/strprintf.h"
+
+extern NpcTextDialog *npcTextDialog;
NpcListDialog::NpcListDialog():
Window(_("NPC"))
@@ -89,7 +93,6 @@ void NpcListDialog::reset()
void NpcListDialog::action(const gcn::ActionEvent &event)
{
int choice = 0;
-
if (event.getId() == "ok")
{
// Send the selected index back to the server
@@ -97,11 +100,14 @@ void NpcListDialog::action(const gcn::ActionEvent &event)
if (selectedIndex > -1)
{
choice = selectedIndex + 1;
+ npcTextDialog->addText(strprintf("\n> \"%s\"\n",
+ mItems[selectedIndex].c_str()));
}
}
else if (event.getId() == "cancel")
{
choice = 0xff; // 0xff means cancel
+ npcTextDialog->addText(_("\n> Cancel\n"));
}
if (choice)
@@ -109,6 +115,5 @@ void NpcListDialog::action(const gcn::ActionEvent &event)
setVisible(false);
reset();
current_npc->dialogChoice(choice);
- current_npc = 0;
}
}