BaseUI: Added support for tracking active forms
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user