mirror of
https://github.com/OpenMW/openmw.git
synced 2025-12-08 21:34:31 +00:00
Merge branch 'theimpossibletrap' into 'master'
Don't use ESM::Spell::mData::mCost directly See merge request OpenMW/openmw!4854
This commit is contained in:
commit
792e494335
3 changed files with 4 additions and 4 deletions
|
|
@ -78,7 +78,7 @@ namespace MWGui
|
||||||
toAdd->eventMouseWheel += MyGUI::newDelegate(this, &SpellBuyingWindow::onMouseWheel);
|
toAdd->eventMouseWheel += MyGUI::newDelegate(this, &SpellBuyingWindow::onMouseWheel);
|
||||||
toAdd->setUserString("ToolTipType", "Spell");
|
toAdd->setUserString("ToolTipType", "Spell");
|
||||||
toAdd->setUserString("Spell", spell.mId.serialize());
|
toAdd->setUserString("Spell", spell.mId.serialize());
|
||||||
toAdd->setUserString("SpellCost", std::to_string(spell.mData.mCost));
|
toAdd->setUserString("SpellCost", "true");
|
||||||
toAdd->eventMouseButtonClick += MyGUI::newDelegate(this, &SpellBuyingWindow::onSpellButtonClick);
|
toAdd->eventMouseButtonClick += MyGUI::newDelegate(this, &SpellBuyingWindow::onSpellButtonClick);
|
||||||
mSpellsWidgetMap.insert(std::make_pair(toAdd, spell.mId));
|
mSpellsWidgetMap.insert(std::make_pair(toAdd, spell.mId));
|
||||||
if (price <= playerGold)
|
if (price <= playerGold)
|
||||||
|
|
|
||||||
|
|
@ -248,8 +248,7 @@ namespace MWGui
|
||||||
info.text = "#{sSchool}: " + MyGUI::TextIterator::toTagsString(school->mName).asUTF8();
|
info.text = "#{sSchool}: " + MyGUI::TextIterator::toTagsString(school->mName).asUTF8();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
auto cost = focus->getUserString("SpellCost");
|
if (focus->getUserString("SpellCost") == "true")
|
||||||
if (!cost.empty() && cost != "0")
|
|
||||||
info.text
|
info.text
|
||||||
+= MWGui::ToolTips::getValueString(MWMechanics::calcSpellCost(*spell), "#{sCastCost}");
|
+= MWGui::ToolTips::getValueString(MWMechanics::calcSpellCost(*spell), "#{sCastCost}");
|
||||||
info.effects = std::move(effects);
|
info.effects = std::move(effects);
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@
|
||||||
#include "../mwbase/world.hpp"
|
#include "../mwbase/world.hpp"
|
||||||
|
|
||||||
#include "creaturestats.hpp"
|
#include "creaturestats.hpp"
|
||||||
|
#include "spellutil.hpp"
|
||||||
|
|
||||||
namespace MWMechanics
|
namespace MWMechanics
|
||||||
{
|
{
|
||||||
|
|
@ -89,7 +90,7 @@ namespace MWMechanics
|
||||||
|
|
||||||
const ESM::Spell* trapSpell
|
const ESM::Spell* trapSpell
|
||||||
= MWBase::Environment::get().getESMStore()->get<ESM::Spell>().find(trap.getCellRef().getTrap());
|
= MWBase::Environment::get().getESMStore()->get<ESM::Spell>().find(trap.getCellRef().getTrap());
|
||||||
int trapSpellPoints = trapSpell->mData.mCost;
|
int trapSpellPoints = MWMechanics::calcSpellCost(*trapSpell);
|
||||||
|
|
||||||
float fTrapCostMult = MWBase::Environment::get()
|
float fTrapCostMult = MWBase::Environment::get()
|
||||||
.getESMStore()
|
.getESMStore()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue