mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-01 03:21:41 +00:00
Merge branch 'toggleai' into 'master'
Add a way to toggle AI to Lua debug package See merge request OpenMW/openmw!3429
This commit is contained in:
commit
1c8198242e
@ -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…
Reference in New Issue
Block a user