2022-09-18 09:06:32 +10:00
|
|
|
---@class TextUIOptions
|
|
|
|
|
---@field position? 'right-center' | 'left-center' | 'top-center';
|
|
|
|
|
---@field icon? string;
|
|
|
|
|
---@field iconColor? string;
|
|
|
|
|
---@field style? string;
|
|
|
|
|
|
2022-10-14 17:17:57 +02:00
|
|
|
local isOpen = false
|
|
|
|
|
|
2022-09-18 09:06:32 +10:00
|
|
|
---@param text string
|
2022-10-14 17:08:20 -06:00
|
|
|
---@param options? TextUIOptions
|
2022-04-11 15:59:18 +02:00
|
|
|
function lib.showTextUI(text, options)
|
|
|
|
|
if not options then options = {} end
|
|
|
|
|
options.text = text
|
|
|
|
|
SendNUIMessage({
|
|
|
|
|
action = 'textUi',
|
|
|
|
|
data = options
|
|
|
|
|
})
|
2022-10-14 17:17:57 +02:00
|
|
|
isOpen = true
|
2022-04-11 15:59:18 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function lib.hideTextUI()
|
|
|
|
|
SendNUIMessage({
|
|
|
|
|
action = 'textUiHide'
|
|
|
|
|
})
|
2022-10-14 17:17:57 +02:00
|
|
|
isOpen = false
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
---@return boolean
|
|
|
|
|
function lib.isTextUIOpen()
|
|
|
|
|
return isOpen
|
|
|
|
|
end
|