diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-05-16 17:54:43 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-05-16 17:54:43 +0300 |
commit | 5a007084e304048549233118707f5ab44f067e1a (patch) | |
tree | bf4ae0fc5296b8275f1d66a0b08044ed5f8b88a2 /src/gui | |
parent | 56b2915de96cf2a94f876b5e56fad2f34cff8052 (diff) | |
download | mv-5a007084e304048549233118707f5ab44f067e1a.tar.gz mv-5a007084e304048549233118707f5ab44f067e1a.tar.bz2 mv-5a007084e304048549233118707f5ab44f067e1a.tar.xz mv-5a007084e304048549233118707f5ab44f067e1a.zip |
Move questtype into separate file.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/windows/questswindow.cpp | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/src/gui/windows/questswindow.cpp b/src/gui/windows/questswindow.cpp index 6ed7d6650..f07d6f6b2 100644 --- a/src/gui/windows/questswindow.cpp +++ b/src/gui/windows/questswindow.cpp @@ -49,18 +49,12 @@ #include "resources/beingcommon.h" #include "resources/questeffect.h" #include "resources/questitem.h" +#include "resources/questtype.h" #include "resources/map/map.h" #include "debug.h" -enum QuestType -{ - QUEST_TEXT = 0, - QUEST_NAME = 1, - QUEST_REWARD = 2 -}; - QuestsWindow::QuestsWindow() : // TRANSLATORS: quests window name Window(_("Quests"), false, nullptr, "quests.xml"), @@ -230,11 +224,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, QUEST_TEXT)); + quest->texts.push_back(QuestItemText(str, QuestType::TEXT)); else if (xmlNameEqual(dataNode, "name")) - quest->texts.push_back(QuestItemText(str, QUEST_NAME)); + quest->texts.push_back(QuestItemText(str, QuestType::NAME)); else if (xmlNameEqual(dataNode, "reward")) - quest->texts.push_back(QuestItemText(str, QUEST_REWARD)); + quest->texts.push_back(QuestItemText(str, QuestType::REWARD)); } mQuests[var].push_back(quest); } @@ -406,12 +400,12 @@ void QuestsWindow::showQuest(const QuestItem *const quest) const QuestItemText &data = *it; switch (data.type) { - case QUEST_TEXT: - case QUEST_REWARD: + case QuestType::TEXT: + case QuestType::REWARD: default: mText->addRow(translator->getStr(data.text)); break; - case QUEST_NAME: + case QuestType::NAME: mText->addRow(std::string("[").append(translator->getStr( data.text)).append("]")); break; |