From fbb304c23c29d0db758a048629286e3a589b1e67 Mon Sep 17 00:00:00 2001 From: "Leon.Schmidt" Date: Sun, 16 Aug 2026 18:17:12 +0200 Subject: [PATCH] FIX - block all phone input groups Disable control groups 0, 1, and 2 while the phone cursor owns focus so movement, combat, camera, and mapped actions such as hands-up cannot leak through. Update the focus contract test to verify every group. --- sky_phone/source/client/focus.lua | 5 ++++- tests/client_focus.lua | 11 ++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/sky_phone/source/client/focus.lua b/sky_phone/source/client/focus.lua index 979af41..01a3bd3 100644 --- a/sky_phone/source/client/focus.lua +++ b/sky_phone/source/client/focus.lua @@ -2,9 +2,12 @@ SkyPhoneFocus = {} local blocked_phone_controls = { 19, 24, 140, 141, 142, 257, 263, 264 } local blocked_phone_look_controls = { 1, 2, 3, 4, 5, 6 } +local focused_control_groups = { 0, 1, 2 } function SkyPhoneFocus.ApplyFocusedControls() - DisableAllControlActions(0) + for _, group in ipairs(focused_control_groups) do + DisableAllControlActions(group) + end DisablePlayerFiring(PlayerId(), true) end diff --git a/tests/client_focus.lua b/tests/client_focus.lua index be0b11c..081434f 100644 --- a/tests/client_focus.lua +++ b/tests/client_focus.lua @@ -1,5 +1,5 @@ local disabled_controls = {} -local all_controls_disabled = false +local all_controls_disabled = {} local firing_disabled = false function DisableControlAction(group, control, disabled) @@ -8,8 +8,7 @@ function DisableControlAction(group, control, disabled) end function DisableAllControlActions(group) - assert(group == 0, "focused phone input must block the primary input group") - all_controls_disabled = true + all_controls_disabled[group] = true end function PlayerId() @@ -91,10 +90,12 @@ assert( ) SkyPhoneFocus.ApplyFocusedControls() -assert(all_controls_disabled, "focused phone cursor must block every GTA control while typing") +for _, group in ipairs({ 0, 1, 2 }) do + assert(all_controls_disabled[group], ("focused phone cursor must block input group %d while typing"):format(group)) +end assert(firing_disabled, "focused phone cursor must block attacks while typing") -all_controls_disabled = false +all_controls_disabled = {} firing_disabled = false SkyPhoneFocus.ApplyGameInputControls(true) for _, control in ipairs({ 19, 24, 140, 141, 142, 257, 263, 264 }) do