From 040ce8288ee0ad22fbb7bedcac44acea581f239f Mon Sep 17 00:00:00 2001 From: the-real-herowl Date: Sun, 10 Dec 2023 00:34:31 +0100 Subject: [PATCH] Script and documentation cleanup --- mods/PLAYER/mcl_fovapi/api.md | 5 ++--- mods/PLAYER/mcl_fovapi/init.lua | 6 ------ 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/mods/PLAYER/mcl_fovapi/api.md b/mods/PLAYER/mcl_fovapi/api.md index 5d49bc349..d4a9cb1fb 100644 --- a/mods/PLAYER/mcl_fovapi/api.md +++ b/mods/PLAYER/mcl_fovapi/api.md @@ -37,7 +37,7 @@ def = { Used to smoothly move between FOVs. Use 0 for an immediate FOV Shift. (Transition time.) * Reset Time: A float value defining the number of seconds to take when removing the FOV Factor. Used to smoothly move between FOVs. Use 0 for an immediate FOV Shift. (Reset transition time.) - *If not provided, defaults to **Time*** + Defaults to `time` if not defined. * Is Multiplier: A bool value used to specify if the FOV Factor is an absolute FOV value or if it should be a percentage of the current FOV. Defaults to `true` if not defined. * Exclusive: A bool value used to specify whether the modifier will override all other FOV modifiers. An example of this @@ -57,8 +57,7 @@ There are three tables that are accessible via the API. They are `registered_mod `mcl_fovapi.registered_modifiers` has the definitions of all the registered FOV Modifiers. Indexed by Modifier Name. And, `mcl_fovapi.applied_modifiers` is indexed by the Player Name. It contains the names of all the modifiers applied to the -player. The `mcl_fovapi.default_fov` table is indexed by the Player Name, and contains the Default FOVs of the player from the -settings. (Expressed as a value usable in `player:set_fov`.) +player. #### Namespaces `mcl_fovapi` is the default API Namespace. diff --git a/mods/PLAYER/mcl_fovapi/init.lua b/mods/PLAYER/mcl_fovapi/init.lua index 84817e382..19fa393c0 100644 --- a/mods/PLAYER/mcl_fovapi/init.lua +++ b/mods/PLAYER/mcl_fovapi/init.lua @@ -12,15 +12,10 @@ local pairs = pairs -- Globals mcl_fovapi = {} -mcl_fovapi.default_fov = {} -- Handles default fov for players mcl_fovapi.registered_modifiers = {} mcl_fovapi.applied_modifiers = {} minetest.register_on_joinplayer(function(player) - local name = player:get_player_name() - -- Assign default FOV - mcl_fovapi.default_fov[name] = player:get_fov() - if DEBUG then minetest.log("FOV::Player: " .. name .. "\nFOV: " .. player:get_fov()) end @@ -31,7 +26,6 @@ minetest.register_on_leaveplayer(function(player) local name = player:get_player_name() -- handle clean up - mcl_fovapi.default_fov[name] = nil mcl_fovapi.applied_modifiers[name] = nil end)