From b82c39c8be6976e3386b413e4a49298dd6e49e3a Mon Sep 17 00:00:00 2001 From: scrawl Date: Mon, 30 Apr 2012 01:08:10 +0200 Subject: [PATCH] renamed Widgets::MWEnchantment to Widgets::MWEffectList so it can be reused for potion effects --- apps/openmw/mwclass/potion.cpp | 2 ++ apps/openmw/mwgui/tooltips.cpp | 2 +- apps/openmw/mwgui/widgets.cpp | 14 +++++++------- apps/openmw/mwgui/widgets.hpp | 10 +++++----- apps/openmw/mwgui/window_manager.cpp | 2 +- 5 files changed, 16 insertions(+), 14 deletions(-) diff --git a/apps/openmw/mwclass/potion.cpp b/apps/openmw/mwclass/potion.cpp index 12ce622ee1..edf82cee45 100644 --- a/apps/openmw/mwclass/potion.cpp +++ b/apps/openmw/mwclass/potion.cpp @@ -124,6 +124,8 @@ namespace MWClass text += "\n" + store.gameSettings.search("sWeight")->str + ": " + MWGui::ToolTips::toString(ref->base->data.weight); text += MWGui::ToolTips::getValueString(ref->base->data.value, store.gameSettings.search("sValue")->str); + ESM::EffectList list = ref->base->effects; + if (MWBase::Environment::get().getWindowManager()->getFullHelp()) { text += MWGui::ToolTips::getMiscString(ref->ref.owner, "Owner"); text += MWGui::ToolTips::getMiscString(ref->base->script, "Script"); diff --git a/apps/openmw/mwgui/tooltips.cpp b/apps/openmw/mwgui/tooltips.cpp index f5b140ec1c..0cab26b2c7 100644 --- a/apps/openmw/mwgui/tooltips.cpp +++ b/apps/openmw/mwgui/tooltips.cpp @@ -233,7 +233,7 @@ IntSize ToolTips::createToolTip(const ToolTipInfo& info) IntCoord coord(0, 6, totalSize.width, 24); - Widgets::MWEnchantmentPtr enchantWidget = enchantArea->createWidget + Widgets::MWEffectListPtr enchantWidget = enchantArea->createWidget ("MW_StatName", coord, Align::Default, "ToolTipEnchantWidget"); enchantWidget->setWindowManager(mWindowManager); enchantWidget->setEnchantmentId(info.enchant); diff --git a/apps/openmw/mwgui/widgets.cpp b/apps/openmw/mwgui/widgets.cpp index 769220f7bb..f327a9c1ec 100644 --- a/apps/openmw/mwgui/widgets.cpp +++ b/apps/openmw/mwgui/widgets.cpp @@ -266,20 +266,20 @@ MWSpell::~MWSpell() { } -/* MWEnchantment */ +/* MWEffectList */ -MWEnchantment::MWEnchantment() +MWEffectList::MWEffectList() : mWindowManager(nullptr) { } -void MWEnchantment::setEnchantmentId(const std::string &enchantId) +void MWEffectList::setEnchantmentId(const std::string &enchantId) { id = enchantId; updateWidgets(); } -void MWEnchantment::createEffectWidgets(std::vector &effects, MyGUI::WidgetPtr creator, MyGUI::IntCoord &coord, bool center, bool constant) +void MWEffectList::createEffectWidgets(std::vector &effects, MyGUI::WidgetPtr creator, MyGUI::IntCoord &coord, bool center, bool constant) { const ESMS::ESMStore &store = mWindowManager->getStore(); const ESM::Enchantment *enchant = store.enchants.search(id); @@ -324,16 +324,16 @@ void MWEnchantment::createEffectWidgets(std::vector &effects, coord.width = maxwidth; } -void MWEnchantment::updateWidgets() +void MWEffectList::updateWidgets() { } -void MWEnchantment::initialiseOverride() +void MWEffectList::initialiseOverride() { Base::initialiseOverride(); } -MWEnchantment::~MWEnchantment() +MWEffectList::~MWEffectList() { } diff --git a/apps/openmw/mwgui/widgets.hpp b/apps/openmw/mwgui/widgets.hpp index b4915ac6aa..51ad516786 100644 --- a/apps/openmw/mwgui/widgets.hpp +++ b/apps/openmw/mwgui/widgets.hpp @@ -145,11 +145,11 @@ namespace MWGui }; typedef MWSpell* MWSpellPtr; - class MYGUI_EXPORT MWEnchantment : public Widget + class MYGUI_EXPORT MWEffectList : public Widget { - MYGUI_RTTI_DERIVED( MWEnchantment ); + MYGUI_RTTI_DERIVED( MWEffectList ); public: - MWEnchantment(); + MWEffectList(); typedef MWMechanics::Stat EnchantmentValue; @@ -168,7 +168,7 @@ namespace MWGui const std::string &getSpellId() const { return id; } protected: - virtual ~MWEnchantment(); + virtual ~MWEffectList(); virtual void initialiseOverride(); @@ -178,7 +178,7 @@ namespace MWGui WindowManager* mWindowManager; std::string id; }; - typedef MWEnchantment* MWEnchantmentPtr; + typedef MWEffectList* MWEffectListPtr; class MYGUI_EXPORT MWSpellEffect : public Widget { diff --git a/apps/openmw/mwgui/window_manager.cpp b/apps/openmw/mwgui/window_manager.cpp index ccf558de50..0f2df53e1a 100644 --- a/apps/openmw/mwgui/window_manager.cpp +++ b/apps/openmw/mwgui/window_manager.cpp @@ -104,7 +104,7 @@ WindowManager::WindowManager( MyGUI::FactoryManager::getInstance().registerFactory("Widget"); MyGUI::FactoryManager::getInstance().registerFactory("Widget"); MyGUI::FactoryManager::getInstance().registerFactory("Widget"); - MyGUI::FactoryManager::getInstance().registerFactory("Widget"); + MyGUI::FactoryManager::getInstance().registerFactory("Widget"); MyGUI::FactoryManager::getInstance().registerFactory("Widget"); MyGUI::FactoryManager::getInstance().registerFactory("Widget");