mirror of
https://github.com/sky-systems/sky_phone.git
synced 2026-09-04 16:23:22 +00:00
feat: unify phone apps with Sky UI
This commit is contained in:
@@ -1,25 +1,34 @@
|
||||
SkyPhoneFocus = {}
|
||||
|
||||
local blocked_phone_controls = { 19, 24, 140, 141, 142, 257, 263, 264 }
|
||||
|
||||
function SkyPhoneFocus.ApplyGameInputControls()
|
||||
for _, control in ipairs(blocked_phone_controls) do
|
||||
DisableControlAction(0, control, true)
|
||||
end
|
||||
DisablePlayerFiring(PlayerId(), true)
|
||||
end
|
||||
|
||||
function SkyPhoneFocus.Resolve(state)
|
||||
if state.activity_suspended then
|
||||
return { cursor = false, focused = false, keep_input = false, movement_only = false }
|
||||
return { cursor = false, focused = false, game_input = false, keep_input = false }
|
||||
end
|
||||
if state.call_focus then
|
||||
return { cursor = true, focused = true, keep_input = false, movement_only = false }
|
||||
return { cursor = true, focused = true, game_input = false, keep_input = false }
|
||||
end
|
||||
if state.camera_active and not state.camera_nui_focused then
|
||||
return { cursor = false, focused = true, keep_input = true, movement_only = false }
|
||||
return { cursor = false, focused = true, game_input = false, keep_input = true }
|
||||
end
|
||||
local movement_only = state.is_open and state.allow_movement and not state.camera_active
|
||||
local game_input = state.is_open and state.allow_movement and not state.camera_active
|
||||
local focused = state.is_open
|
||||
or state.notification_focus
|
||||
or state.payphone_focus
|
||||
or state.sim_picker_open
|
||||
or (state.camera_active and state.camera_nui_focused)
|
||||
return {
|
||||
cursor = focused,
|
||||
cursor = focused and not (game_input and state.cursor_disabled),
|
||||
focused = focused,
|
||||
keep_input = movement_only,
|
||||
movement_only = movement_only,
|
||||
game_input = game_input,
|
||||
keep_input = game_input,
|
||||
}
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user