summaryrefslogtreecommitdiff
path: root/src/gui/npcdialog.cpp
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2009-05-02 22:05:37 -0600
committerJared Adams <jaxad0127@gmail.com>2009-05-02 22:05:37 -0600
commitd592883f61eef2abb7829a6b624d2c85fe54dd5e (patch)
treef5ee4e94f8d57f251e5389a17538573f441aae98 /src/gui/npcdialog.cpp
parent8a3a417e3a3c083414d35de0f0dad91edde09276 (diff)
downloadmana-d592883f61eef2abb7829a6b624d2c85fe54dd5e.tar.gz
mana-d592883f61eef2abb7829a6b624d2c85fe54dd5e.tar.bz2
mana-d592883f61eef2abb7829a6b624d2c85fe54dd5e.tar.xz
mana-d592883f61eef2abb7829a6b624d2c85fe54dd5e.zip
Fix up some things in the NPC dialog
Diffstat (limited to 'src/gui/npcdialog.cpp')
-rw-r--r--src/gui/npcdialog.cpp21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/gui/npcdialog.cpp b/src/gui/npcdialog.cpp
index a595467d..1fe231df 100644
--- a/src/gui/npcdialog.cpp
+++ b/src/gui/npcdialog.cpp
@@ -39,7 +39,7 @@
NpcDialog::NpcDialog()
: Window(_("NPC")),
- mActionState(NPC_ACTION_NEXT),
+ mActionState(NPC_ACTION_WAIT),
mInputState(NPC_INPUT_NONE),
mNpcId(0),
mText("")
@@ -101,6 +101,12 @@ void NpcDialog::addText(const std::string &text)
{
setText(mText + text + "\n");
mScrollArea->setVerticalScrollAmount(mScrollArea->getVerticalMaxScroll());
+ mActionState = NPC_ACTION_WAIT;
+ buildLayout();
+}
+
+void NpcDialog::showNextButton()
+{
mActionState = NPC_ACTION_NEXT;
buildLayout();
}
@@ -237,7 +243,11 @@ void NpcDialog::buildLayout()
if (mActionState != NPC_ACTION_INPUT)
{
- if (mActionState == NPC_ACTION_NEXT)
+ if (mActionState == NPC_ACTION_WAIT)
+ {
+ mButton->setCaption(_("Waiting for server"));
+ }
+ else if (mActionState == NPC_ACTION_NEXT)
{
mButton->setCaption(_("Next"));
}
@@ -269,9 +279,14 @@ void NpcDialog::buildLayout()
place(0, 3, mIntField, 3);
place(3, 4, mButton, 2);
}
- }
+ }
Layout &layout = getLayout();
layout.setRowHeight(0, Layout::AUTO_SET);
+
+ mButton->setEnabled(mActionState != NPC_ACTION_WAIT);
+
redraw();
+
+ mScrollArea->setVerticalScrollAmount(mScrollArea->getVerticalMaxScroll());
}