mirror of
https://github.com/sky-systems/sky_phone.git
synced 2026-09-04 16:23:22 +00:00
Merge branch 'dev' into feature/funk
This commit is contained in:
@@ -8,6 +8,10 @@ local call_channel = 0
|
||||
Bridge.Debug("debug", "[sky_phone] Client script initialized.", { always = true })
|
||||
|
||||
local server_callbacks = {
|
||||
"security:unlock",
|
||||
"security:set-passcode",
|
||||
"security:change-passcode",
|
||||
"security:disable-passcode",
|
||||
"device:save",
|
||||
"device:factory-reset",
|
||||
"account:login",
|
||||
@@ -124,6 +128,7 @@ end
|
||||
|
||||
local function close_phone()
|
||||
open_requested = false
|
||||
TriggerEvent("sky_phone:animation:phone", false)
|
||||
if not is_open then
|
||||
return
|
||||
end
|
||||
@@ -193,6 +198,7 @@ RegisterNUICallback("ui:opened", function(_, cb)
|
||||
is_open = true
|
||||
notification_focus = false
|
||||
SetNuiFocus(true, true)
|
||||
TriggerEvent("sky_phone:animation:phone", true)
|
||||
cb({ success = true })
|
||||
end)
|
||||
|
||||
@@ -352,6 +358,7 @@ end)
|
||||
RegisterNetEvent("sky_phone:device:invalidated", function()
|
||||
open_requested = false
|
||||
device_payload = nil
|
||||
TriggerEvent("sky_phone:animation:reset")
|
||||
close_phone()
|
||||
end)
|
||||
|
||||
@@ -466,6 +473,7 @@ end)
|
||||
RegisterNetEvent("sky_phone:call:incoming", function(data)
|
||||
notification_focus = true
|
||||
SetNuiFocus(true, true)
|
||||
TriggerEvent("sky_phone:animation:call", data)
|
||||
SendNUIMessage({ type = "call:incoming", data = data })
|
||||
end)
|
||||
|
||||
@@ -477,6 +485,7 @@ RegisterNetEvent("sky_phone:call:state", function(data)
|
||||
elseif data.state ~= "ringing" then
|
||||
leave_call_voice()
|
||||
end
|
||||
TriggerEvent("sky_phone:animation:call", data)
|
||||
SendNUIMessage({ type = "call:state", data = data })
|
||||
end)
|
||||
|
||||
@@ -495,6 +504,7 @@ AddEventHandler("onResourceStop", function(resource_name)
|
||||
SetNuiFocus(false, false)
|
||||
end
|
||||
|
||||
TriggerEvent("sky_phone:animation:reset")
|
||||
leave_call_voice()
|
||||
|
||||
if Config.Phone.DevelopmentCommand then
|
||||
|
||||
Reference in New Issue
Block a user