mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-21 10:23:56 +00:00
Merge branch 'lua_effect_icon' into 'master'
Add icon path to core.MagicEffect See merge request OpenMW/openmw!3154
This commit is contained in:
commit
bbfd906f08
2 changed files with 6 additions and 1 deletions
|
@ -346,6 +346,10 @@ namespace MWLua
|
||||||
auto name = ESM::MagicEffect::indexToName(rec.mIndex);
|
auto name = ESM::MagicEffect::indexToName(rec.mIndex);
|
||||||
return Misc::StringUtils::lowerCase(name);
|
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 {
|
magicEffectT["name"] = sol::readonly_property([](const ESM::MagicEffect& rec) -> std::string_view {
|
||||||
return MWBase::Environment::get()
|
return MWBase::Environment::get()
|
||||||
.getWorld()
|
.getWorld()
|
||||||
|
|
|
@ -672,7 +672,8 @@
|
||||||
|
|
||||||
---
|
---
|
||||||
-- @type MagicEffect
|
-- @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 #string name Localized name of the effect
|
||||||
-- @field #number school @{#MagicSchool}
|
-- @field #number school @{#MagicSchool}
|
||||||
-- @field #number baseCost
|
-- @field #number baseCost
|
||||||
|
|
Loading…
Reference in a new issue