From 7457ac2414e25077a44ac6bc603544f4f09f7f21 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 18 Nov 2012 15:50:57 +0300 Subject: Extend quests window text message types. New type for rewards. Now it same like . --- src/gui/questswindow.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/gui/questswindow.cpp b/src/gui/questswindow.cpp index 914dab466..2e77da8ac 100644 --- a/src/gui/questswindow.cpp +++ b/src/gui/questswindow.cpp @@ -43,6 +43,13 @@ #include "debug.h" +enum QuestType +{ + QUEST_TEXT = 0, + QUEST_NAME = 1, + QUEST_REWARD = 2 +}; + struct QuestItemText final { QuestItemText(std::string text0, const int type0) : @@ -223,9 +230,11 @@ void QuestsWindow::loadQuest(const int var, const XmlNodePtr node) std::string str = translator->getStr(data); if (xmlNameEqual(dataNode, "text")) - quest->texts.push_back(QuestItemText(str, 0)); + quest->texts.push_back(QuestItemText(str, QuestType::QUEST_TEXT)); else if (xmlNameEqual(dataNode, "name")) - quest->texts.push_back(QuestItemText(str, 1)); + quest->texts.push_back(QuestItemText(str, QuestType::QUEST_NAME)); + else if (xmlNameEqual(dataNode, "reward")) + quest->texts.push_back(QuestItemText(str, QuestType::QUEST_REWARD)); } mQuests[var].push_back(quest); } @@ -369,11 +378,11 @@ void QuestsWindow::showQuest(const QuestItem *const quest) const QuestItemText &data = *it; switch (data.type) { - case 0: + case QuestType::QUEST_TEXT: default: mText->addRow(translator->getStr(data.text)); break; - case 1: + case QuestType::QUEST_NAME: mText->addRow("[" + translator->getStr(data.text) + "]"); break; } -- cgit v1.2.3-70-g09d2