Files
DayZ-Epoch/SQF/dayz_code/compile/ui_updateControls.sqf
icomrade 52c9c7ceda Somewhat better VON Block
Not perfect, occasionally the player can double tap a button to lock VON
on - which now they cannot turn off unless they open the escape menu and
double tap to turn off.

Chat channel changes are now blocked when VON is active.

ActionKeys are now recalculated on key binding change, but it is
important to note that double tap bindings DO NOT work with the
ActionKeys command. This is why inputAction check is neccesary

Summary: Double tapping a key to lock von on (VoiceOverNet) is not
reliably blocked, nor is it blocked at all in secondary
displays/dialogs. otherwise, this works pretty well.
2016-11-26 18:48:11 -05:00

28 lines
1.3 KiB
Plaintext

private ["_holdBreath","_turboKey"];
//Sleep required for actionKeys to update after controls dialog closes
uiSleep 1;
dayz_voiceControls = [];
DayZ_channelChangeKeys = [];
{dayz_voiceControls = dayz_voiceControls + (actionKeys _x)} count ["voiceOverNet","PushToTalk","PushToTalkAll","PushToTalkCommand","PushToTalkDirect","PushToTalkGroup","PushToTalkSide","PushToTalkVehicle"];
{DayZ_channelChangeKeys = DayZ_channelChangeKeys + (actionKeys _x)} count ["NextChannel","PrevChannel"];
//Refresh keyboard_keys after controls change
if (_this) then {
keyboard_keys = nil;
[controlNull,1,false,false,false] call DZ_KeyDown_EH;
};
//ActionKeys includes mouse button and joystick binds
_holdBreath = if (count (actionKeys "HoldBreath") > 1) then { [true,localize "STR_UI_HOLD_BREATH"] } else { [false,""] };
//Prevent easily outrunning zeds and bypassing Arma sprint fatigue (slow to normal running speed after a time) by holding turbo and spamming W
_turboKey = if (count (actionKeys "Turbo") > 0) then { [true,localize "STR_UI_HOLD_TURBO"] } else { [false,""] };
if ((_holdBreath select 0) or (_turboKey select 0)) then {
4100002 cutRsc ["DZ_BlackScreen","PLAIN"];
(uiNamespace getVariable "DZ_BlackScreen") displayCtrl 1 ctrlSetText format ["%1\n%2", (_holdBreath select 1), (_turboKey select 1)];
} else {
4100002 cutText ["","PLAIN"];
};