mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2026-02-18 22:22:57 +03:00
Improve filterCheats and VON block
Filter cheats is now added to the main options menus that needed it.
It is not needed on the map (display 12) because KeyDown for display 46
also fires when it is open. So filterCheats was firing twice (once on
each display) in that case.
KeyDown does not fire on display 63 at all
regardless of whether PTT or VON is held down, toggled or chat open.
Keydown does fire on 55, but only after the mic icon is locked on, so it
is of limited use. MouseButtonDown does not fire on 55 or 63. So it is
useless to add to those displays. You can confirm this with:
(findDisplay 63) displayAddEventHandler ["KeyDown","systemchat
'fired';"];
Filter cheats is now only checked on display 46 when a
voice, channel, or cheat key is pressed instead of on every key press.
This still works 100% of the time for blocking cheat input. For
performance reasons it's probably not worth checking all the conditions
in filterCheats with every key press on display46 just for the VON
block. Doing so covers some edge combination bind cases better, so it
may be worth considering again if no better alternative is found. For
now this solution is good enough to cover the majority of cases without
slowing down the keyhandler during normal usage.
The VON message now
tells you exactly which channel block you triggered instead of listing
all of them.
Fixed issue mentioned in 52c9c7c with VON getting stuck on when using a
double tap keybind.
Tested:
1. Talk in side with regular/combo/mouse bind
2. Change channels
while mic is locked on with regular/combo/mouse bind
3. Change channels
with Up/Down arrows while chat is open.
4. Trying all cases in steps 1-3
with a dialog open.
It is possible to bypass the VON block with some different control
settings and combinations of the above, but for default controls and
common usage it works the majority of the time.
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
class RscDisplayMainMap
|
||||
{
|
||||
onKeyDown = "if (!isNil 'DZE_FilterCheats') then {_this call DZE_FilterCheats;}; false";
|
||||
class controls
|
||||
{
|
||||
delete CA_MainBackground;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#define FILTER_CHEATS "_handled = if (isNil 'dze_filterCheats') then {false} else {_this call dze_filterCheats}; _handled"
|
||||
class RscPicture;
|
||||
class RscButton;
|
||||
class CA_IGUI_Title;
|
||||
@@ -37,18 +38,19 @@ class RscDisplayMission: RscDisplayEmpty
|
||||
{
|
||||
access = 0;
|
||||
idd = 46;
|
||||
onKeyDown = "if (!isNil 'DZ_KeyDown_EH') then {_this call DZ_KeyDown_EH;};"; //assigned much quicker than spawning init_keyboard
|
||||
onKeyDown = "_handled = if (isNil 'DZ_KeyDown_EH') then {false} else {_this call DZ_KeyDown_EH}; _handled"; //assigned much quicker than spawning init_keyboard
|
||||
};
|
||||
class RscDisplayConfigure {
|
||||
idd = 4;
|
||||
onUnload = "if (!isNil 'updateControlsHandle') then {terminate updateControlsHandle;}; if (!isNil 'ui_updateControls') then {updateControlsHandle = true spawn ui_updateControls;};";
|
||||
class controlsBackground;
|
||||
class controls;
|
||||
onKeyDown = FILTER_CHEATS;
|
||||
};
|
||||
class RscDisplayGameOptions {
|
||||
onLoad = "{(_this select 0) displayCtrl 140 lbAdd _x;} forEach [localize 'STR_DISABLED',localize 'STR_ENABLED']; (_this select 0) displayCtrl 140 lbSetCurSel (profileNamespace getVariable ['streamerMode',0]); uiNamespace setVariable ['streamerMode',(profileNamespace getVariable ['streamerMode',0])];";
|
||||
onUnload = "call ui_changeDisplay;";
|
||||
onKeyDown = FILTER_CHEATS;
|
||||
class controls {
|
||||
delete CA_ButtonDefault; //Opens non-functional difficulty selection dialog, player can not select difficulty in MP
|
||||
class CA_TextLanguage : RscText {
|
||||
x = 0.159803;
|
||||
y = (0.420549 + -2*0.069854);
|
||||
@@ -91,26 +93,19 @@ class RscDisplayGameOptions {
|
||||
};
|
||||
};
|
||||
};
|
||||
class RscDisplayChat
|
||||
{
|
||||
idd = 24;
|
||||
onKeyDown = "if (!isNil 'DZE_FilterCheats') then {_this call DZE_FilterCheats;}; false";
|
||||
class controls;
|
||||
};
|
||||
class RscDisplayChat {onKeyDown = FILTER_CHEATS;};
|
||||
class RscDisplayOptions {onKeyDown = FILTER_CHEATS;};
|
||||
class RscDisplayOptionsAudio {onKeyDown = FILTER_CHEATS;};
|
||||
class RscDisplayOptionsVideo {onKeyDown = FILTER_CHEATS;};
|
||||
class RscDisplayConfigureControllers {onKeyDown = FILTER_CHEATS;};
|
||||
class RscDisplayChannel
|
||||
{
|
||||
idd = 63;
|
||||
onKeyDown = "_handle = if (!isNil 'DZE_FilterCheats') then {_this call DZE_FilterCheats} else {false}; _handle";
|
||||
onMouseButtonDown = "_handle = if (!isNil 'DZE_FilterCheats') then {[0,(_this select 1),false] call DZE_FilterCheats} else {false}; _handle";
|
||||
class controls;
|
||||
};
|
||||
class RscDisplayVoiceChat
|
||||
{
|
||||
idd = 55;
|
||||
onKeyDown = "_handle = if (!isNil 'DZE_FilterCheats') then {_this call DZE_FilterCheats} else {false}; _handle";
|
||||
onMouseButtonDown = "_handle = if (!isNil 'DZE_FilterCheats') then {[0,(_this select 1),false] call DZE_FilterCheats} else {false}; _handle";
|
||||
class controls;
|
||||
//Channel name text is nil when checking unscheduled in onLoad of display 55 and 63. Spawn gives it time to set.
|
||||
//This will fire when a mouse button is assigned. KeyDown EHs will not.
|
||||
onLoad = "if (!isNil 'dze_filterCheats' && !isNil 'channel_keys') then {[(_this select 0),-1,false] spawn dze_filterCheats;};";
|
||||
};
|
||||
|
||||
class RscPictureGUI
|
||||
{
|
||||
access = 0;
|
||||
@@ -332,7 +327,7 @@ class RscDisplayMain : RscStandardDisplay
|
||||
class RscDisplayDiary {
|
||||
idd = 129;
|
||||
movingEnable = 0;
|
||||
onKeyDown = "if (!isNil 'DZE_FilterCheats') then {_this call DZE_FilterCheats;}; false";
|
||||
onKeyDown = FILTER_CHEATS;
|
||||
|
||||
class Controls {
|
||||
delete Diary;
|
||||
@@ -442,8 +437,8 @@ class RscDisplayMPInterrupt : RscStandardDisplay {
|
||||
//onLoad = "_dummy = ['Init', _this] execVM '\ca\ui\scripts\pauseLoadinit.sqf'; [(_this select 0)] execVM '\z\addons\dayz_code\compile\player_onPause.sqf';"; _respawn = (_this select 0) displayCtrl 1010); _respawn ctrlEnable false; _abort = (_this select 0) displayCtrl 104); _abort ctrlEnable false;
|
||||
onLoad = "uiNamespace setVariable ['RscDisplayMPInterrupt', _this select 0]; _this call fn_pauseMenuChecks; [] spawn player_onPause; _dummy = ['Init', _this] execVM '\ca\ui\scripts\pauseLoadinit.sqf';"; /*diag_log[diag_tickTime,'RscDisplayMPInterrupt'];*/
|
||||
onUnload = "uiNamespace setVariable ['RscDisplayMPInterrupt', nil];['Unload', _this] execVM '\ca\ui\scripts\pauseOnUnload.sqf';";
|
||||
onKeyDown = "_handle = if (!isNil 'DZE_FilterCheats') then {_this call DZE_FilterCheats} else {false}; _handle";
|
||||
|
||||
onKeyDown = FILTER_CHEATS;
|
||||
|
||||
class controlsBackground {
|
||||
class Mainback : RscPicture {
|
||||
idc = 1104;
|
||||
|
||||
Reference in New Issue
Block a user