diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-03-04 01:09:39 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-03-04 01:11:34 +0300 |
commit | 310e966a513f456538d8fd1bb02e5878ce24bc2d (patch) | |
tree | 2673cd202f6de11cbd003e73cf4374ed43274517 /src | |
parent | ccec760783c589bf7be58be75522ad985fd98210 (diff) | |
download | manaverse-310e966a513f456538d8fd1bb02e5878ce24bc2d.tar.gz manaverse-310e966a513f456538d8fd1bb02e5878ce24bc2d.tar.bz2 manaverse-310e966a513f456538d8fd1bb02e5878ce24bc2d.tar.xz manaverse-310e966a513f456538d8fd1bb02e5878ce24bc2d.zip |
Add new tags for quests questgiver, npc.
Also improver existing tag reward.
Diffstat (limited to 'src')
-rw-r--r-- | src/enums/resources/questtype.h | 9 | ||||
-rw-r--r-- | src/gui/windows/questswindow.cpp | 42 |
2 files changed, 47 insertions, 4 deletions
diff --git a/src/enums/resources/questtype.h b/src/enums/resources/questtype.h index 4e83d0f14..bfc85314c 100644 --- a/src/enums/resources/questtype.h +++ b/src/enums/resources/questtype.h @@ -25,9 +25,12 @@ enumStart(QuestType) { - TEXT = 0, - NAME = 1, - REWARD = 2 + TEXT = 0, + NAME = 1, + REWARD = 2, + GIVER = 3, + COORDINATES = 4, + NPC = 5 } enumEnd(QuestType); diff --git a/src/gui/windows/questswindow.cpp b/src/gui/windows/questswindow.cpp index e117a8e00..5bdf85b36 100644 --- a/src/gui/windows/questswindow.cpp +++ b/src/gui/windows/questswindow.cpp @@ -234,11 +234,30 @@ void QuestsWindow::loadQuest(const int var, const XmlNodePtr node) replaceItemLinks(str); if (xmlNameEqual(dataNode, "text")) + { quest->texts.push_back(QuestItemText(str, QuestType::TEXT)); + } else if (xmlNameEqual(dataNode, "name")) + { quest->texts.push_back(QuestItemText(str, QuestType::NAME)); + } else if (xmlNameEqual(dataNode, "reward")) + { quest->texts.push_back(QuestItemText(str, QuestType::REWARD)); + } + else if (xmlNameEqual(dataNode, "questgiver") || + xmlNameEqual(dataNode, "giver")) + { + quest->texts.push_back(QuestItemText(str, QuestType::GIVER)); + } + else if (xmlNameEqual(dataNode, "coordinates")) + { + quest->texts.push_back(QuestItemText(str, QuestType::COORDINATES)); + } + else if (xmlNameEqual(dataNode, "npc")) + { + quest->texts.push_back(QuestItemText(str, QuestType::NPC)); + } } mQuests[var].push_back(quest); } @@ -409,14 +428,35 @@ void QuestsWindow::showQuest(const QuestItem *const quest) const QuestItemText &data = *it; switch (data.type) { + case QuestType::COORDINATES: case QuestType::TEXT: - case QuestType::REWARD: default: mText->addRow(data.text); break; case QuestType::NAME: mText->addRow(std::string("[").append(data.text).append("]")); break; + case QuestType::REWARD: + mText->addRow(std::string( + // TRANSLATORS: quest reward + _("Reward:")).append( + " ").append( + data.text)); + break; + case QuestType::GIVER: + mText->addRow(std::string( + // TRANSLATORS: quest giver name + _("Quest Giver:")).append( + " ").append( + data.text)); + break; + case QuestType::NPC: + mText->addRow(std::string( + // TRANSLATORS: npc name + _("Npc:")).append( + " ").append( + data.text)); + break; } } } |