BaseUI: Added support for tracking active forms

This commit is contained in:
Van
2026-04-03 21:39:19 +03:00
parent 1dc6fb3f39
commit a1e74978a5

View File

@@ -30,6 +30,10 @@ function BaseUI:new(name, getFormSpecString, clearContex)
end)
end
instance:registerOnFormQuit(function(player)
Smc.clearActiveFormspec(player:get_player_name())
end)
return instance
end
@@ -117,6 +121,7 @@ end
---@param playerName string
function BaseUI:showForm(playerName, ...)
core.show_formspec(playerName, self.name, self:getFormSpecString(playerName, ...))
Smc.setActiveFormspec(playerName, self.name)
end
---Close the player the FormSpec registered by the instance of this UI.