diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-11-18 15:50:57 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-11-18 15:50:57 +0300 |
commit | 7457ac2414e25077a44ac6bc603544f4f09f7f21 (patch) | |
tree | 8188e3f410c07439e1a265a34bb1fc3018e5b240 | |
parent | a0fc90c20fb1a654e2c0106af9f47d1af2f3f29f (diff) | |
download | plus-7457ac2414e25077a44ac6bc603544f4f09f7f21.tar.gz plus-7457ac2414e25077a44ac6bc603544f4f09f7f21.tar.bz2 plus-7457ac2414e25077a44ac6bc603544f4f09f7f21.tar.xz plus-7457ac2414e25077a44ac6bc603544f4f09f7f21.zip |
Extend quests window text message types.
New type <reward> for rewards. Now it same like <text>.
-rw-r--r-- | src/gui/questswindow.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
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; } |