From 94d782c4bee5a11492648bad4e7761add3518934 Mon Sep 17 00:00:00 2001 From: uramer Date: Sun, 14 Jan 2024 13:38:35 +0100 Subject: [PATCH] Fix doc typos and add menu package to necessary lists --- docs/source/reference/lua-scripting/api.rst | 1 + docs/source/reference/lua-scripting/engine_handlers.rst | 6 +++++- docs/source/reference/lua-scripting/openmw_menu.rst | 2 +- docs/source/reference/lua-scripting/tables/packages.rst | 2 ++ files/data/scripts/omw/settings/player.lua | 2 +- files/lua_api/openmw/menu.lua | 5 +++++ 6 files changed, 15 insertions(+), 3 deletions(-) diff --git a/docs/source/reference/lua-scripting/api.rst b/docs/source/reference/lua-scripting/api.rst index 6d27db0515..857374b2b7 100644 --- a/docs/source/reference/lua-scripting/api.rst +++ b/docs/source/reference/lua-scripting/api.rst @@ -27,6 +27,7 @@ Lua API reference openmw_camera openmw_postprocessing openmw_debug + openmw_menu openmw_aux_calendar openmw_aux_util openmw_aux_time diff --git a/docs/source/reference/lua-scripting/engine_handlers.rst b/docs/source/reference/lua-scripting/engine_handlers.rst index bcadfeb295..754a63b314 100644 --- a/docs/source/reference/lua-scripting/engine_handlers.rst +++ b/docs/source/reference/lua-scripting/engine_handlers.rst @@ -9,6 +9,7 @@ Engine handler is a function defined by a script, that can be called by the engi .. list-table:: :widths: 20 80 + * - onInterfaceOverride(base) - | Called if the current script has an interface and overrides an interface | (``base``) of another script. @@ -87,6 +88,7 @@ Engine handler is a function defined by a script, that can be called by the engi .. list-table:: :widths: 20 80 + * - onFrame(dt) - | Called every frame (even if the game is paused) right after | processing user input. Use it only for latency-critical stuff @@ -96,7 +98,7 @@ Engine handler is a function defined by a script, that can be called by the engi - | `Key `_ is pressed. | Usage example: | ``if key.symbol == 'z' and key.withShift then ...`` - * - onKeyRelease(key) + * - onKeyRelease(key) - | `Key `_ is released. | Usage example: | ``if key.symbol == 'z' and key.withShift then ...`` @@ -131,6 +133,7 @@ Engine handler is a function defined by a script, that can be called by the engi .. list-table:: :widths: 20 80 + * - onKeyPress(key) - | `Key `_ is pressed. | Usage example: @@ -142,6 +145,7 @@ Engine handler is a function defined by a script, that can be called by the engi .. list-table:: :widths: 20 80 + * - onStateChanged() - | Called whenever the current game changes | (i. e. the result of `getState `_ changes) diff --git a/docs/source/reference/lua-scripting/openmw_menu.rst b/docs/source/reference/lua-scripting/openmw_menu.rst index 587e4337e0..ae1803a4f2 100644 --- a/docs/source/reference/lua-scripting/openmw_menu.rst +++ b/docs/source/reference/lua-scripting/openmw_menu.rst @@ -4,4 +4,4 @@ Package openmw.menu .. include:: version.rst .. raw:: html - :file: generated_html/openmw_ambient.html + :file: generated_html/openmw_menu.html diff --git a/docs/source/reference/lua-scripting/tables/packages.rst b/docs/source/reference/lua-scripting/tables/packages.rst index 67709bbf7b..667b91ef63 100644 --- a/docs/source/reference/lua-scripting/tables/packages.rst +++ b/docs/source/reference/lua-scripting/tables/packages.rst @@ -29,6 +29,8 @@ +------------------------------------------------------------+--------------------+---------------------------------------------------------------+ |:ref:`openmw.ui ` | by player scripts | | Controls :ref:`user interface `. | +------------------------------------------------------------+--------------------+---------------------------------------------------------------+ +|:ref:`openmw.menu ` | by menu scripts | | Main menu functionality, such as managing game saves | ++------------------------------------------------------------+--------------------+---------------------------------------------------------------+ |:ref:`openmw.camera ` | by player scripts | | Controls camera. | +------------------------------------------------------------+--------------------+---------------------------------------------------------------+ |:ref:`openmw.postprocessing `| by player scripts | | Controls post-process shaders. | diff --git a/files/data/scripts/omw/settings/player.lua b/files/data/scripts/omw/settings/player.lua index 9f397c923d..4ec61a73c7 100644 --- a/files/data/scripts/omw/settings/player.lua +++ b/files/data/scripts/omw/settings/player.lua @@ -91,7 +91,7 @@ return { registerPage = registerPage, --- -- @function [parent=#Settings] registerRenderer Register a renderer, - -- only avaialable in menu scripts (DEPRECATED in player scripts) + -- only available in menu scripts (DEPRECATED in player scripts) -- @param #string key -- @param #function renderer A renderer function, receives setting's value, -- a function to change it and an argument from the setting options diff --git a/files/lua_api/openmw/menu.lua b/files/lua_api/openmw/menu.lua index c1a1a65a62..3e2e02954a 100644 --- a/files/lua_api/openmw/menu.lua +++ b/files/lua_api/openmw/menu.lua @@ -9,6 +9,9 @@ -- @field [parent=#STATE] Running -- @field [parent=#STATE] Ended +--- +-- All possible game states returned by @{#menu.getState} +-- @field [parent=#menu] #STATE STATE --- -- Current game state @@ -63,3 +66,5 @@ --- -- Exit the game -- @function [parent=#menu] quit + +return nil