ADD - open unique phones by item and hotkey

Register a configurable F1 phone toggle through a server-authoritative open request and retain the selected unique handset by IMEI. Verify usable-item support for every inventory adapter, fail visibly on registration errors, and document the behavior.
This commit is contained in:
Leon.Schmidt
2026-08-17 15:57:56 +02:00
parent 1b453e3456
commit e5a1c2bf40
8 changed files with 186 additions and 34 deletions
+18 -1
View File
@@ -435,7 +435,7 @@ end
if Config.Phone.DevelopmentCommand then
RegisterCommand(Config.Command, function()
if is_open then
if is_open or open_requested then
close_phone()
return
end
@@ -443,6 +443,23 @@ if Config.Phone.DevelopmentCommand then
end, false)
end
RegisterCommand("sky_phone_toggle", function()
if is_open or open_requested then
close_phone()
return
end
Bridge.Callbacks.Trigger("sky_phone:device:open-request", {})
end, false)
if Config.Phone.Keybind then
if type(Config.Phone.Keybind) ~= "string" or Config.Phone.Keybind == "" then
error("[sky_phone] Config.Phone.Keybind must be a non-empty keyboard key name or false.")
end
RegisterKeyMapping("sky_phone_toggle", locale.Controls.OpenPhone, "keyboard", Config.Phone.Keybind)
end
RegisterNetEvent("sky_phone:testdata:feedback", function(success, detail)
local test_data_locale = locale.TestData
local message = success and test_data_locale.Success or test_data_locale.Failed