summaryrefslogtreecommitdiff
path: root/src/gui/npc_text.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/npc_text.cpp')
-rw-r--r--src/gui/npc_text.cpp37
1 files changed, 27 insertions, 10 deletions
diff --git a/src/gui/npc_text.cpp b/src/gui/npc_text.cpp
index ed75b76e..ea5dbd4c 100644
--- a/src/gui/npc_text.cpp
+++ b/src/gui/npc_text.cpp
@@ -1,9 +1,8 @@
/*
- * Aethyra
+ * The Mana World
* Copyright (C) 2004 The Mana World Development Team
*
- * This file is part of Aethyra based on original code
- * from The Mana World.
+ * This file is part of The Mana World.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -46,8 +45,7 @@ NpcTextDialog::NpcTextDialog():
mTextBox->setOpaque(false);
mScrollArea = new ScrollArea(mTextBox);
- mButton = new Button(_("OK"), "", this);
- mButton->setActionEventId("ok");
+ mButton = new Button(_("Waiting for server"), "", this);
mScrollArea->setHorizontalScrollPolicy(gcn::ScrollArea::SHOW_NEVER);
mScrollArea->setVerticalScrollPolicy(gcn::ScrollArea::SHOW_ALWAYS);
@@ -71,20 +69,39 @@ void NpcTextDialog::setText(const std::string &text)
void NpcTextDialog::addText(const std::string &text)
{
setText(mText + text + "\n");
+ mScrollArea->setVerticalScrollAmount(mScrollArea->getVerticalMaxScroll());
+}
+
+void NpcTextDialog::showNextButton()
+{
+ mButton->setCaption(_("Next"));
+ mButton->setActionEventId("next");
+ mButton->setEnabled(true);
+}
+
+void NpcTextDialog::showCloseButton()
+{
+ mButton->setCaption(_("Close"));
+ mButton->setActionEventId("close");
+ mButton->setEnabled(true);
}
void NpcTextDialog::action(const gcn::ActionEvent &event)
{
- if (event.getId() == "ok")
+ if (event.getId() == "next")
+ {
+ current_npc->nextDialog();
+ addText("\n> Next\n");
+ }
+ else if (event.getId() == "close")
{
setText("");
setVisible(false);
-
- if (current_npc)
- current_npc->nextDialog();
-
current_npc = NULL;
}
+ mButton->setEnabled(false);
+ mButton->setCaption(_("Waiting for server"));
+ mButton->setActionEventId("");
}
void NpcTextDialog::widgetResized(const gcn::Event &event)