summaryrefslogtreecommitdiff
path: root/src/gui/npcdialog.cpp
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2011-12-13 05:08:17 +0800
committerErik Schilling <ablu.erikschilling@googlemail.com>2012-01-07 03:00:43 +0800
commit734cf89900cde0526043429c3028cb69616f7cb8 (patch)
tree9bdedb341b5dde0971cec8fbc8d10125ae50735f /src/gui/npcdialog.cpp
parent845d9acbfcd41728c6c6a747b19db40374854147 (diff)
downloadmana-734cf89900cde0526043429c3028cb69616f7cb8.tar.gz
mana-734cf89900cde0526043429c3028cb69616f7cb8.tar.bz2
mana-734cf89900cde0526043429c3028cb69616f7cb8.tar.xz
mana-734cf89900cde0526043429c3028cb69616f7cb8.zip
Made the first choice item be selected at the beginning
Resolves Mana-Mantis: #432. Reviewed-by: Bertram, Ablu.
Diffstat (limited to 'src/gui/npcdialog.cpp')
-rw-r--r--src/gui/npcdialog.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gui/npcdialog.cpp b/src/gui/npcdialog.cpp
index 61e2204d..ec863c79 100644
--- a/src/gui/npcdialog.cpp
+++ b/src/gui/npcdialog.cpp
@@ -307,6 +307,11 @@ void NpcDialog::addChoice(const std::string &choice)
mItems.push_back(choice);
}
+void NpcDialog::initChoiceSelection()
+{
+ mItemList->setSelected(0);
+}
+
void NpcDialog::textRequest(const std::string &defaultText)
{
mActionState = NPC_ACTION_INPUT;
@@ -542,6 +547,7 @@ void NpcEventListener::event(Event::Channel channel,
int count = event.getInt("choiceCount");
for (int i = 1; i <= count; i++)
dialog->addChoice(event.getString("choice" + toString(i)));
+ dialog->initChoiceSelection();
}
else if (event.getType() == Event::IntegerInput)
{