Merge branch 'debug_tgm_tcl' into 'master'

Lua commands debug.toggleGodMode and debug.toggleCollision

See merge request OpenMW/openmw!3113
revert-6246b479
psi29a 2 years ago
commit ca57bbe644

@ -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 },

@ -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

Loading…
Cancel
Save