1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-01 03:21:41 +00:00

Changed lua enum name, tweaked docs

This commit is contained in:
Max Yari 2024-06-21 16:53:11 +02:00
parent 7d659ae64c
commit 2ef0568dda
2 changed files with 10 additions and 3 deletions

View File

@ -63,8 +63,8 @@ namespace MWLua
selfAPI["controls"] = sol::readonly_property([](SelfObject& self) { return &self.mControls; }); selfAPI["controls"] = sol::readonly_property([](SelfObject& self) { return &self.mControls; });
selfAPI["isActive"] = [](SelfObject& self) { return &self.mIsActive; }; selfAPI["isActive"] = [](SelfObject& self) { return &self.mIsActive; };
selfAPI["enableAI"] = [](SelfObject& self, bool v) { self.mControls.mDisableAI = !v; }; selfAPI["enableAI"] = [](SelfObject& self, bool v) { self.mControls.mDisableAI = !v; };
selfAPI["attackType"] = LuaUtil::makeStrictReadOnly(context.mLua->tableFromPairs<std::string_view, int>( selfAPI["AttackTYPE"] = LuaUtil::makeStrictReadOnly(context.mLua->tableFromPairs<std::string_view, int>(
{ { "NoAttack", 0 }, { "Chop", 1 }, { "Slash", 2 }, { "Thrust", 3 } })); { { "NoAttack", 0 }, { "Attack", 1 }, { "Chop", 1 }, { "Slash", 2 }, { "Thrust", 3 } }));
using AiPackage = MWMechanics::AiPackage; using AiPackage = MWMechanics::AiPackage;
sol::usertype<AiPackage> aiPackage = context.mLua->sol().new_usertype<AiPackage>("AiPackage"); sol::usertype<AiPackage> aiPackage = context.mLua->sol().new_usertype<AiPackage>("AiPackage");

View File

@ -37,7 +37,14 @@
-- @field [parent=#ActorControls] #boolean run true - run, false - walk -- @field [parent=#ActorControls] #boolean run true - run, false - walk
-- @field [parent=#ActorControls] #boolean sneak If true - sneak -- @field [parent=#ActorControls] #boolean sneak If true - sneak
-- @field [parent=#ActorControls] #boolean jump If true - initiate a jump -- @field [parent=#ActorControls] #boolean jump If true - initiate a jump
-- @field [parent=#ActorControls] #number use Possible values: 0 - 3. If above 0 - activates the readied weapon/spell. For weapons, keeping at a non-zero value will charge the attack until set to 0. For melee weapons on AI-disabled actors - values 1 - 3 determine an attack type: 1 - chop, 2 - slash, 3 - thrust. -- @field [parent=#ActorControls] #number Accepts an @{#AttackTYPE} value. Activates the readied weapon/spell according to a provided value. For weapons, keeping this value modified will charge the attack until set to @{#AttackTYPE.NoAttack}.
-- @type AttackTYPE
-- @field #number NoAttack
-- @field #number Attack
-- @field #number Chop
-- @field #number Swing
-- @field #number Thrust
--- ---
-- Enables or disables standard AI (enabled by default). -- Enables or disables standard AI (enabled by default).