BaseUI: Added support for tracking active forms
This commit is contained in:
@@ -30,6 +30,10 @@ function BaseUI:new(name, getFormSpecString, clearContex)
|
|||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
instance:registerOnFormQuit(function(player)
|
||||||
|
Smc.clearActiveFormspec(player:get_player_name())
|
||||||
|
end)
|
||||||
|
|
||||||
return instance
|
return instance
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -117,6 +121,7 @@ end
|
|||||||
---@param playerName string
|
---@param playerName string
|
||||||
function BaseUI:showForm(playerName, ...)
|
function BaseUI:showForm(playerName, ...)
|
||||||
core.show_formspec(playerName, self.name, self:getFormSpecString(playerName, ...))
|
core.show_formspec(playerName, self.name, self:getFormSpecString(playerName, ...))
|
||||||
|
Smc.setActiveFormspec(playerName, self.name)
|
||||||
end
|
end
|
||||||
|
|
||||||
---Close the player the FormSpec registered by the instance of this UI.
|
---Close the player the FormSpec registered by the instance of this UI.
|
||||||
|
|||||||
Reference in New Issue
Block a user