mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-04 21:40:03 +00:00
Merge branch 'npc_model_lua' into 'master'
Add model to NPC lua record See merge request OpenMW/openmw!3818
This commit is contained in:
commit
4ebedaca99
@ -4,6 +4,7 @@
|
|||||||
#include <components/esm3/loadfact.hpp>
|
#include <components/esm3/loadfact.hpp>
|
||||||
#include <components/esm3/loadnpc.hpp>
|
#include <components/esm3/loadnpc.hpp>
|
||||||
#include <components/lua/luastate.hpp>
|
#include <components/lua/luastate.hpp>
|
||||||
|
#include <components/misc/resourcehelpers.hpp>
|
||||||
|
|
||||||
#include "apps/openmw/mwbase/environment.hpp"
|
#include "apps/openmw/mwbase/environment.hpp"
|
||||||
#include "apps/openmw/mwbase/mechanicsmanager.hpp"
|
#include "apps/openmw/mwbase/mechanicsmanager.hpp"
|
||||||
@ -78,6 +79,8 @@ namespace MWLua
|
|||||||
= sol::readonly_property([](const ESM::NPC& rec) -> int { return (int)rec.mNpdt.mDisposition; });
|
= sol::readonly_property([](const ESM::NPC& rec) -> int { return (int)rec.mNpdt.mDisposition; });
|
||||||
record["head"]
|
record["head"]
|
||||||
= sol::readonly_property([](const ESM::NPC& rec) -> std::string { return rec.mHead.serializeText(); });
|
= sol::readonly_property([](const ESM::NPC& rec) -> std::string { return rec.mHead.serializeText(); });
|
||||||
|
record["model"] = sol::readonly_property(
|
||||||
|
[](const ESM::NPC& rec) -> std::string { return Misc::ResourceHelpers::correctMeshPath(rec.mModel); });
|
||||||
record["isMale"] = sol::readonly_property([](const ESM::NPC& rec) -> bool { return rec.isMale(); });
|
record["isMale"] = sol::readonly_property([](const ESM::NPC& rec) -> bool { return rec.isMale(); });
|
||||||
record["baseGold"] = sol::readonly_property([](const ESM::NPC& rec) -> int { return rec.mNpdt.mGold; });
|
record["baseGold"] = sol::readonly_property([](const ESM::NPC& rec) -> int { return rec.mNpdt.mGold; });
|
||||||
addActorServicesBindings<ESM::NPC>(record, context);
|
addActorServicesBindings<ESM::NPC>(record, context);
|
||||||
|
@ -939,6 +939,7 @@
|
|||||||
-- @field #string name
|
-- @field #string name
|
||||||
-- @field #string race
|
-- @field #string race
|
||||||
-- @field #string class Name of the NPC's class (e. g. Acrobat)
|
-- @field #string class Name of the NPC's class (e. g. Acrobat)
|
||||||
|
-- @field #string model Path to the model associated with this NPC, used for animations.
|
||||||
-- @field #string mwscript MWScript that is attached to this NPC
|
-- @field #string mwscript MWScript that is attached to this NPC
|
||||||
-- @field #string hair Path to the hair body part model
|
-- @field #string hair Path to the hair body part model
|
||||||
-- @field #string head Path to the head body part model
|
-- @field #string head Path to the head body part model
|
||||||
|
Loading…
x
Reference in New Issue
Block a user