summaryrefslogtreecommitdiff
path: root/src/gui/npc_text.cpp
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2009-02-16 14:41:24 +0000
committerIra Rice <irarice@gmail.com>2009-02-16 15:42:48 -0700
commitd2c175c2d5fba8b78a45d70fbaf24d7b7afe7a3c (patch)
treed02c3e0451df5d997e841a865943d411f1dc786e /src/gui/npc_text.cpp
parent4924e4a50ae31c30f783285f6e10ac3651c1e6e8 (diff)
downloadmana-client-d2c175c2d5fba8b78a45d70fbaf24d7b7afe7a3c.tar.gz
mana-client-d2c175c2d5fba8b78a45d70fbaf24d7b7afe7a3c.tar.bz2
mana-client-d2c175c2d5fba8b78a45d70fbaf24d7b7afe7a3c.tar.xz
mana-client-d2c175c2d5fba8b78a45d70fbaf24d7b7afe7a3c.zip
Fixed up NPC dialogs to behave more like eAthena expects.
Diffstat (limited to 'src/gui/npc_text.cpp')
-rw-r--r--src/gui/npc_text.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/gui/npc_text.cpp b/src/gui/npc_text.cpp
index 88db46b3..ed75b76e 100644
--- a/src/gui/npc_text.cpp
+++ b/src/gui/npc_text.cpp
@@ -45,14 +45,15 @@ NpcTextDialog::NpcTextDialog():
mTextBox->setEditable(false);
mTextBox->setOpaque(false);
- scrollArea = new ScrollArea(mTextBox);
- okButton = new Button(_("OK"), "ok", this);
+ mScrollArea = new ScrollArea(mTextBox);
+ mButton = new Button(_("OK"), "", this);
+ mButton->setActionEventId("ok");
- scrollArea->setHorizontalScrollPolicy(gcn::ScrollArea::SHOW_NEVER);
- scrollArea->setVerticalScrollPolicy(gcn::ScrollArea::SHOW_ALWAYS);
+ mScrollArea->setHorizontalScrollPolicy(gcn::ScrollArea::SHOW_NEVER);
+ mScrollArea->setVerticalScrollPolicy(gcn::ScrollArea::SHOW_ALWAYS);
- place(0, 0, scrollArea, 5).setPadding(3);
- place(4, 1, okButton);
+ place(0, 0, mScrollArea, 5).setPadding(3);
+ place(4, 1, mButton);
Layout &layout = getLayout();
layout.setRowHeight(0, Layout::AUTO_SET);
@@ -64,7 +65,7 @@ NpcTextDialog::NpcTextDialog():
void NpcTextDialog::setText(const std::string &text)
{
mText = text;
- mTextBox->setTextWrapped(mText, scrollArea->getWidth() - 15);
+ mTextBox->setTextWrapped(mText, mScrollArea->getWidth() - 15);
}
void NpcTextDialog::addText(const std::string &text)
@@ -78,9 +79,11 @@ void NpcTextDialog::action(const gcn::ActionEvent &event)
{
setText("");
setVisible(false);
+
if (current_npc)
current_npc->nextDialog();
- current_npc = 0;
+
+ current_npc = NULL;
}
}