From a1e74978a51926870ff47e1f9591d7396a5e3794 Mon Sep 17 00:00:00 2001 From: Vanic Date: Fri, 3 Apr 2026 21:39:19 +0300 Subject: [PATCH] `BaseUI`: Added support for tracking active forms --- mods/CORE/BaseUI/src/BaseUI.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mods/CORE/BaseUI/src/BaseUI.lua b/mods/CORE/BaseUI/src/BaseUI.lua index 0c81278..ebdc453 100644 --- a/mods/CORE/BaseUI/src/BaseUI.lua +++ b/mods/CORE/BaseUI/src/BaseUI.lua @@ -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.