Files
2023-11-16 20:26:05 -08:00

41 lines
779 B
Lua

---@class TextUIOptions
---@field position? 'right-center' | 'left-center' | 'top-center';
---@field icon? string | {[1]: IconProp, [2]: string};
---@field iconColor? string;
---@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
function lib.hideTextUI()
SendNUIMessage({
action = 'textUiHide'
})
isOpen = false
currentText = nil
end
---@return boolean
function lib.isTextUIOpen()
return isOpen
end