Add a way to toggle AI to Lua debug package

macos_ci_fix
Andrei Kortunov 1 year ago
parent 12159d95f3
commit 56ea3e3879

@ -3,7 +3,9 @@
#include "luamanagerimp.hpp"
#include "../mwbase/environment.hpp"
#include "../mwbase/mechanicsmanager.hpp"
#include "../mwbase/world.hpp"
#include "../mwrender/postprocessor.hpp"
#include "../mwrender/renderingmanager.hpp"
@ -38,6 +40,9 @@ namespace MWLua
api["toggleGodMode"] = []() { MWBase::Environment::get().getWorld()->toggleGodMode(); };
api["isGodMode"] = []() { return MWBase::Environment::get().getWorld()->getGodModeState(); };
api["toggleAI"] = []() { MWBase::Environment::get().getMechanicsManager()->toggleAI(); };
api["isAIEnabled"] = []() { return MWBase::Environment::get().getMechanicsManager()->isAIActive(); };
api["toggleCollision"] = []() { MWBase::Environment::get().getWorld()->toggleCollisionMode(); };
api["isCollisionEnabled"] = []() {
auto world = MWBase::Environment::get().getWorld();

@ -35,6 +35,15 @@
-- @function [parent=#Debug] isGodMode
-- @return #boolean
---
-- Toggles AI
-- @function [parent=#Debug] toggleAI
---
-- Is AI enabled
-- @function [parent=#Debug] isAIEnabled
-- @return #boolean
---
-- Toggles collisions
-- @function [parent=#Debug] toggleCollision

Loading…
Cancel
Save