mirror of
https://github.com/sky-systems/sky_phone.git
synced 2026-09-04 09:13:24 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user