mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-11-30 21:24:44 +00:00
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:
1 parent
01b4c53a9d
commit
115bf702c9
2 files changed
+11
No files matched your search
@@ -10,3 +10,5 @@ interface OptionsProps {
|
|||||||
export const showTextUI = (text: string, options?: OptionsProps): void => exports.ox_lib.showTextUI(text, options);
|
export const showTextUI = (text: string, options?: OptionsProps): void => exports.ox_lib.showTextUI(text, options);
|
||||||
|
|
||||||
export const hideTextUI = (): void => exports.ox_lib.hideTextUI();
|
export const hideTextUI = (): void => exports.ox_lib.hideTextUI();
|
||||||
|
|
||||||
|
export const isTextUIOpen = (): boolean => exports.ox_lib.isTextUIOpen();
|
||||||
@@ -4,6 +4,8 @@
|
|||||||
---@field iconColor? string;
|
---@field iconColor? string;
|
||||||
---@field style? string;
|
---@field style? string;
|
||||||
|
|
||||||
|
local isOpen = false
|
||||||
|
|
||||||
---@param text string
|
---@param text string
|
||||||
---@param options TextUIOptions
|
---@param options TextUIOptions
|
||||||
function lib.showTextUI(text, options)
|
function lib.showTextUI(text, options)
|
||||||
@@ -13,10 +15,17 @@ function lib.showTextUI(text, options)
|
|||||||
action = 'textUi',
|
action = 'textUi',
|
||||||
data = options
|
data = options
|
||||||
})
|
})
|
||||||
|
isOpen = true
|
||||||
end
|
end
|
||||||
|
|
||||||
function lib.hideTextUI()
|
function lib.hideTextUI()
|
||||||
SendNUIMessage({
|
SendNUIMessage({
|
||||||
action = 'textUiHide'
|
action = 'textUiHide'
|
||||||
})
|
})
|
||||||
|
isOpen = false
|
||||||
|
end
|
||||||
|
|
||||||
|
---@return boolean
|
||||||
|
function lib.isTextUIOpen()
|
||||||
|
return isOpen
|
||||||
end
|
end
|
||||||
Reference in new issue
Block a user