Add icon path to core.MagicEffect

revert-6246b479
Zackhasacat 2 years ago committed by psi29a
parent 0b9bcf58e2
commit 835a67d876

@ -300,6 +300,10 @@ namespace MWLua
auto name = ESM::MagicEffect::indexToName(rec.mIndex);
return Misc::StringUtils::lowerCase(name);
});
magicEffectT["icon"] = sol::readonly_property([](const ESM::MagicEffect& rec) -> std::string {
auto vfs = MWBase::Environment::get().getResourceSystem()->getVFS();
return Misc::ResourceHelpers::correctIconPath(rec.mIcon, vfs);
});
magicEffectT["name"] = sol::readonly_property([](const ESM::MagicEffect& rec) -> std::string_view {
return MWBase::Environment::get()
.getWorld()

@ -627,7 +627,8 @@
---
-- @type MagicEffect
-- @field #string Effect id string
-- @field #string id Effect ID
-- @field #string icon Effect Icon Path
-- @field #string name Localized name of the effect
-- @field #number school @{#MagicSchool}
-- @field #number baseCost

Loading…
Cancel
Save