HelperLib: add active formspecs handler
This commit is contained in:
@@ -3,6 +3,7 @@ Smc = {}
|
||||
local modInfo = Mod.getInfo('smc__system__helper_lib')
|
||||
local require = modInfo.require
|
||||
|
||||
require('Lib.activeFormspecs')
|
||||
require('Lib.globalStep')
|
||||
require('Lib.color')
|
||||
require('Lib.immersiveCraftData')
|
||||
|
||||
19
mods/SYSTEM/HelperLib/src/Lib/activeFormspecs.lua
Normal file
19
mods/SYSTEM/HelperLib/src/Lib/activeFormspecs.lua
Normal file
@@ -0,0 +1,19 @@
|
||||
---@type table<string, string>
|
||||
local activeFormspecsList = {}
|
||||
|
||||
---@param playerName string
|
||||
---@param formName string?
|
||||
function Smc.setActiveFormspec(playerName, formName)
|
||||
activeFormspecsList[playerName] = formName
|
||||
end
|
||||
|
||||
---@param playerName string
|
||||
---@return string?
|
||||
function Smc.getActiveFormspec(playerName)
|
||||
return activeFormspecsList[playerName]
|
||||
end
|
||||
|
||||
---@param playerName string
|
||||
function Smc.clearActiveFormspec(playerName)
|
||||
Smc.setActiveFormspec(playerName, nil)
|
||||
end
|
||||
Reference in New Issue
Block a user