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

Lua commands debug.toggleGodMode and debug.toggleCollision

This commit is contained in:
Petr Mikheev 2023-06-07 22:47:05 +02:00
parent 75c371de66
commit e773b9d055
2 changed files with 27 additions and 0 deletions

View File

@ -35,6 +35,15 @@ namespace MWLua
context.mLuaManager->addAction([value] { MWBase::Environment::get().getWorld()->toggleRenderMode(value); });
};
api["toggleGodMode"] = []() { MWBase::Environment::get().getWorld()->toggleGodMode(); };
api["isGodMode"] = []() { return MWBase::Environment::get().getWorld()->getGodModeState(); };
api["toggleCollision"] = []() { MWBase::Environment::get().getWorld()->toggleCollisionMode(); };
api["isCollisionEnabled"] = []() {
auto world = MWBase::Environment::get().getWorld();
return world->isActorCollisionEnabled(world->getPlayerPtr());
};
api["NAV_MESH_RENDER_MODE"]
= LuaUtil::makeStrictReadOnly(context.mLua->tableFromPairs<std::string_view, MWRender::NavMeshMode>({
{ "AreaType", MWRender::NavMeshMode::AreaType },

View File

@ -26,6 +26,24 @@
-- @function [parent=#Debug] toggleRenderMode
-- @param #RENDER_MODE value
---
-- Toggles god mode
-- @function [parent=#Debug] toggleGodMode
---
-- Is god mode enabled
-- @function [parent=#Debug] isGodMode
-- @return #boolean
---
-- Toggles collisions
-- @function [parent=#Debug] toggleCollision
---
-- Is player collision enabled
-- @function [parent=#Debug] isCollisionEnabled
-- @return #boolean
---
-- Navigation mesh rendering modes
-- @type NAV_MESH_RENDER_MODE