summaryrefslogtreecommitdiff
path: root/src/gui/npc_text.cpp
diff options
context:
space:
mode:
authorBjörn Steinbrink <B.Steinbrink@gmx.de>2006-01-22 13:31:13 +0000
committerBjörn Steinbrink <B.Steinbrink@gmx.de>2006-01-22 13:31:13 +0000
commitbd56bf8afdab16383ed8ad08412a8c807f84af85 (patch)
tree0e963ada63bcbe3c50dd77986aaa15b9ba49816a /src/gui/npc_text.cpp
parent5359640b6f271af31f6423df9d661433eff89a3e (diff)
downloadmana-bd56bf8afdab16383ed8ad08412a8c807f84af85.tar.gz
mana-bd56bf8afdab16383ed8ad08412a8c807f84af85.tar.bz2
mana-bd56bf8afdab16383ed8ad08412a8c807f84af85.tar.xz
mana-bd56bf8afdab16383ed8ad08412a8c807f84af85.zip
Merged NETWORK branch (includes BEING_OVERHAUL).
Diffstat (limited to 'src/gui/npc_text.cpp')
-rw-r--r--src/gui/npc_text.cpp23
1 files changed, 10 insertions, 13 deletions
diff --git a/src/gui/npc_text.cpp b/src/gui/npc_text.cpp
index f4bdfb0f..0769021e 100644
--- a/src/gui/npc_text.cpp
+++ b/src/gui/npc_text.cpp
@@ -23,22 +23,21 @@
#include "npc_text.h"
+#include <string>
+
#include "scrollarea.h"
#include "button.h"
#include "textbox.h"
-#include "../game.h"
-
-#include "../net/messageout.h"
-#include "../net/protocol.h"
+#include "../npc.h"
NpcTextDialog::NpcTextDialog():
Window("NPC")
{
- textBox = new TextBox();
- textBox->setEditable(false);
- scrollArea = new ScrollArea(textBox);
- okButton = new Button("OK");
+ mTextBox = new TextBox();
+ mTextBox->setEditable(false);
+ gcn::ScrollArea *scrollArea = new ScrollArea(mTextBox);
+ Button *okButton = new Button("OK");
setContentSize(260, 175);
scrollArea->setHorizontalScrollPolicy(gcn::ScrollArea::SHOW_NEVER);
@@ -61,13 +60,13 @@ NpcTextDialog::NpcTextDialog():
void
NpcTextDialog::setText(const char *text)
{
- textBox->setText(text);
+ mTextBox->setText(text);
}
void
NpcTextDialog::addText(const std::string &text)
{
- textBox->setText(textBox->getText() + text + "\n");
+ mTextBox->setText(mTextBox->getText() + text + "\n");
}
void
@@ -75,11 +74,9 @@ NpcTextDialog::action(const std::string& eventId)
{
if (eventId == "ok")
{
- MessageOut outMsg;
- outMsg.writeInt16(CMSG_NPC_NEXT_REQUEST);
- outMsg.writeInt32(current_npc);
setText("");
setVisible(false);
+ current_npc->nextDialog();
current_npc = 0;
}
}