From 5a007084e304048549233118707f5ab44f067e1a Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 16 May 2014 17:54:43 +0300 Subject: Move questtype into separate file. --- src/gui/windows/questswindow.cpp | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) (limited to 'src/gui') 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; -- cgit v1.2.3-70-g09d2