-
Notifications
You must be signed in to change notification settings - Fork 1
/
client.lua
32 lines (27 loc) · 919 Bytes
/
client.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
local currentUi = nil
local function ShowUI(title, content)
currentUi = { title = title or false, content = content or false }
SendNUIMessage({
action = "show",
title = title or false,
content = content or false
})
end exports('ShowUI', ShowUI)
local function EditUI(title, content)
currentUi = { title = title and title or currentUi.title, content = content and content or currentUi.content}
SendNUIMessage({
action = "edit",
title = title and title or false,
content = content and content or false
})
end exports('EditUI', EditUI)
local function HideUI()
currentUi = nil
SendNUIMessage({ action = "hide" })
end exports('HideUI', HideUI)
local function GetCurrentUI()
return currentUi or {}
end exports('GetCurrentUI', GetCurrentUI)
local function IsUIVisible()
return currentUi ~= nil
end exports('IsUIVisible', IsUIVisible)