diff --git a/resource/interface/client/textui.lua b/resource/interface/client/textui.lua index 6095e43..9f86e44 100644 --- a/resource/interface/client/textui.lua +++ b/resource/interface/client/textui.lua @@ -5,16 +5,23 @@ ---@field style? string | table; local isOpen = false +local currentText ---@param text string ---@param options? TextUIOptions function lib.showTextUI(text, options) + if currentText == text then return end + if not options then options = {} end + options.text = text + currentText = text + SendNUIMessage({ action = 'textUi', data = options }) + isOpen = true end @@ -22,7 +29,9 @@ function lib.hideTextUI() SendNUIMessage({ action = 'textUiHide' }) + isOpen = false + currentText = nil end ---@return boolean