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
This commit is contained in:
BerkieBb
2022-10-14 17:17:57 +02:00
committed by GitHub
parent 01b4c53a9d
commit 115bf702c9
2 changed files with 12 additions and 1 deletions

View File

@@ -10,3 +10,5 @@ interface OptionsProps {
export const showTextUI = (text: string, options?: OptionsProps): void => exports.ox_lib.showTextUI(text, options);
export const hideTextUI = (): void => exports.ox_lib.hideTextUI();
export const isTextUIOpen = (): boolean => exports.ox_lib.isTextUIOpen();

View File

@@ -4,6 +4,8 @@
---@field iconColor? string;
---@field style? string;
local isOpen = false
---@param text string
---@param options TextUIOptions
function lib.showTextUI(text, options)
@@ -13,10 +15,17 @@ function lib.showTextUI(text, options)
action = 'textUi',
data = options
})
isOpen = true
end
function lib.hideTextUI()
SendNUIMessage({
action = 'textUiHide'
})
end
isOpen = false
end
---@return boolean
function lib.isTextUIOpen()
return isOpen
end