From 360abd9b908d89ce42a2d9cb4f81abf2fc8751f5 Mon Sep 17 00:00:00 2001 From: Evil Eye Date: Mon, 26 May 2025 19:34:03 +0200 Subject: [PATCH] Render openmw.animation inaccessible in menu scripts --- apps/openmw/mwlua/luabindings.cpp | 3 ++- docs/source/reference/lua-scripting/tables/packages.rst | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwlua/luabindings.cpp b/apps/openmw/mwlua/luabindings.cpp index 8debbe153d..30bbab5be7 100644 --- a/apps/openmw/mwlua/luabindings.cpp +++ b/apps/openmw/mwlua/luabindings.cpp @@ -32,7 +32,6 @@ namespace MWLua sol::state_view lua = context.mLua->unsafeState(); MWWorld::DateTimeManager* tm = MWBase::Environment::get().getWorld()->getTimeManager(); return { - { "openmw.animation", initAnimationPackage(context) }, { "openmw.async", LuaUtil::getAsyncPackageInitializer( lua, [tm] { return tm->getSimulationTime(); }, [tm] { return tm->getGameTime(); }) }, @@ -47,6 +46,7 @@ namespace MWLua initObjectBindingsForGlobalScripts(context); initCellBindingsForGlobalScripts(context); return { + { "openmw.animation", initAnimationPackage(context) }, { "openmw.core", initCorePackage(context) }, { "openmw.types", initTypesPackage(context) }, { "openmw.world", initWorldPackage(context) }, @@ -59,6 +59,7 @@ namespace MWLua initCellBindingsForLocalScripts(context); LocalScripts::initializeSelfPackage(context); return { + { "openmw.animation", initAnimationPackage(context) }, { "openmw.core", initCorePackage(context) }, { "openmw.types", initTypesPackage(context) }, { "openmw.nearby", initNearbyPackage(context) }, diff --git a/docs/source/reference/lua-scripting/tables/packages.rst b/docs/source/reference/lua-scripting/tables/packages.rst index d0aa32abea..99edbb8378 100644 --- a/docs/source/reference/lua-scripting/tables/packages.rst +++ b/docs/source/reference/lua-scripting/tables/packages.rst @@ -4,7 +4,8 @@ |:ref:`openmw.ambient ` | by player and menu | | Controls background sounds for given player. | | | scripts | | +------------------------------------------------------------+--------------------+---------------------------------------------------------------+ -|:ref:`openmw.animation ` | everywhere | | Animation controls | +|:ref:`openmw.animation ` | by global, local, | | Animation controls | +| | and player scripts | | +------------------------------------------------------------+--------------------+---------------------------------------------------------------+ |:ref:`openmw.async ` | everywhere | | Timers and callbacks. | +------------------------------------------------------------+--------------------+---------------------------------------------------------------+