HelperLib: add active formspecs handler

This commit is contained in:
Van
2026-04-03 21:36:08 +03:00
parent 0e59cf799a
commit 7af83a87d8
2 changed files with 20 additions and 0 deletions

View File

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

View 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