mirror of
https://github.com/sky-systems/sky_phone.git
synced 2026-09-04 17:23:25 +00:00
FIX - complete LB custom app compatibility (#11)
* FIX - preserve LB custom app lifecycle * FIX - reset LB export aliases before startup * FIX - report competing custom app providers * FIX - identify LB app frames as live NUI * FIX - complete LB custom app compatibility * FIX - provide LB PicChat runtime exports * FIX - route LB PicChat through Sky Phone * FIX - return cached LB equipped phone number * FIX - harden PicChat compatibility migration * ENH - complete modular phone provider and Creator APIs * DOC - document the Sky Phone Creator API --------- Co-authored-by: DerEchteAlec <bycraky@gmail.com> Co-authored-by: DerEchteAlec <alec.schitzkat@luwan.io>
This commit is contained in:
co-authored by
DerEchteAlec
DerEchteAlec
parent
9aec3eefef
commit
30559048fd
@@ -0,0 +1,50 @@
|
||||
local net_events = {}
|
||||
local nui_callbacks = {}
|
||||
local nui_messages = {}
|
||||
local picker_focus = false
|
||||
|
||||
Bridge = {
|
||||
Callbacks = {
|
||||
Trigger = function(name)
|
||||
assert(name == "sky_phone:sim:picker-close", "SIM picker must close through the server")
|
||||
return { success = true }
|
||||
end,
|
||||
},
|
||||
Debug = function() end,
|
||||
}
|
||||
|
||||
SkyPhoneFocus = {
|
||||
SetSimPicker = function(active)
|
||||
picker_focus = active
|
||||
end,
|
||||
}
|
||||
|
||||
function RegisterNetEvent(name, callback)
|
||||
net_events[name] = callback
|
||||
end
|
||||
|
||||
function RegisterNUICallback(name, callback)
|
||||
nui_callbacks[name] = callback
|
||||
end
|
||||
|
||||
function SendNUIMessage(message)
|
||||
nui_messages[#nui_messages + 1] = message
|
||||
end
|
||||
|
||||
dofile("sky_phone/source/client/sim.lua")
|
||||
|
||||
net_events["sky_phone:sim:picker"]({ number = "5550101", choices = { "sim-1" } })
|
||||
assert(picker_focus and nui_messages[#nui_messages].type == "sim:picker", "valid SIM picker must claim focus")
|
||||
|
||||
nui_messages = {}
|
||||
SkyPhoneSimPicker.ReplayNui()
|
||||
assert(nui_messages[1].type == "sim:picker", "NUI reload must replay the active SIM picker")
|
||||
|
||||
local close_result
|
||||
nui_callbacks["sim:picker-close"]({}, function(result)
|
||||
close_result = result
|
||||
end)
|
||||
assert(close_result.success and not picker_focus, "SIM picker close must release focus")
|
||||
assert(nui_messages[#nui_messages].type == "sim:picker-close", "SIM picker close must reach NUI")
|
||||
|
||||
print("Client SIM picker tests passed")
|
||||
Reference in New Issue
Block a user