Files
ox_lib/resource/interface/client/textui.lua
BerkieBb 115bf702c9 feat(client/textui): open state getter for textUI (#126)
* feat(package/interface/textui): text ui open getter

* feat(resource/interface/textui): text ui open getter
2022-10-14 17:17:57 +02:00

32 lines
628 B
Lua

---@class TextUIOptions
---@field position? 'right-center' | 'left-center' | 'top-center';
---@field icon? string;
---@field iconColor? string;
---@field style? string;
local isOpen = false
---@param text string
---@param options TextUIOptions
function lib.showTextUI(text, options)
if not options then options = {} end
options.text = text
SendNUIMessage({
action = 'textUi',
data = options
})
isOpen = true
end
function lib.hideTextUI()
SendNUIMessage({
action = 'textUiHide'
})
isOpen = false
end
---@return boolean
function lib.isTextUIOpen()
return isOpen
end