Include all controls in VON block

Moved to display 46 keydown since keydown on 63 only fires after the VON
transmission has already started (slight delay).

Added mouseButtonDown so it can not be bypassed via assigning a mouse
button.
This commit is contained in:
ebaydayz
2016-11-25 18:22:41 -05:00
parent b6d88b1329
commit b9a5c59660
5 changed files with 29 additions and 24 deletions

View File

@@ -99,7 +99,7 @@ class RscDisplayChat
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 {[(_this select 1),false] call DZE_FilterCheats} else {false}; _handle";
class controls;
};
class RscPictureGUI

View File

@@ -148,6 +148,13 @@ if (isNil "keyboard_keys") then {
dayz_lastCheckBit = diag_ticktime;
[player,20,true,(getPosATL player)] call player_alertZombies;
};
};
_checkVoice = {
if (diag_ticktime - dayz_lastCheckBit > 10) then {
dayz_lastCheckBit = diag_ticktime;
[player,20,true,(getPosATL player)] call player_alertZombies;
};
_handled = if (!isNil "DZE_FilterCheats") then {[-999,false] call DZE_FilterCheats} else {false};
};
_journal = {
if (!dayz_isSwimming and !dialog) then {
@@ -280,9 +287,14 @@ if (isNil "keyboard_keys") then {
[actionKeys "MoveBack", _interrupt] call _addArray;
[actionKeys "TurnLeft", _interrupt] call _addArray;
[actionKeys "TurnRight", _interrupt] call _addArray;
[actionKeys "PushToTalk", _noise] call _addArray;
[actionKeys "VoiceOverNet", _noise] call _addArray;
[actionKeys "PushToTalkDirect", _noise] call _addArray;
[actionKeys "PushToTalk", _checkVoice] call _addArray;
[actionKeys "PushToTalkAll", _checkVoice] call _addArray;
[actionKeys "PushToTalkCommand", _checkVoice] call _addArray;
[actionKeys "PushToTalkDirect", _checkVoice] call _addArray;
[actionKeys "PushToTalkGroup", _checkVoice] call _addArray;
[actionKeys "PushToTalkSide", _checkVoice] call _addArray;
[actionKeys "PushToTalkVehicle", _checkVoice] call _addArray;
[actionKeys "VoiceOverNet", _checkVoice] call _addArray;
[actionKeys "Chat", _noise] call _addArray;
[actionKeys "User20", _journal] call _addArray;
[actionKeys "Diary", _journal] call _addArray;

View File

@@ -33,7 +33,7 @@ DZE_NoBuildNear = []; //Array of object class names that are blacklisted to buil
DZE_GemOccurance = [["ItemTopaz",10], ["ItemObsidian",8], ["ItemSapphire",6], ["ItemAmethyst",4], ["ItemEmerald",3], ["ItemCitrine",2], ["ItemRuby",1]]; //Sets how rare each gem is in the order shown when mining (whole numbers only)
DZE_GodModeBaseExclude = []; //Array of object class names excluded from the god mode bases feature
DZE_salvageLocked = true; //Enable or disable salvaging of locked vehicles, useful for stopping griefing on locked vehicles.
DZE_DisabledChannels = ["str_channel_side","str_channel_global","str_channel_command"]; //list of stringTable.xml definiitions to disable voice channels. available channels are: ["str_channel_side", "str_channel_group","str_channel_global","str_channel_direct","str_channel_command","str_channel_vehicle"]
DZE_DisabledChannels = [(localize "str_channel_side"),(localize "str_channel_global"),(localize "str_channel_command")]; //List of disabled voice channels. Other channels are: "str_channel_group","str_channel_direct","str_channel_vehicle"
// Death Messages
DZE_DeathMsgChat = "none"; //"none","global","side","system" Display death messages in selected chat channel.
@@ -109,11 +109,4 @@ dayz_requireRadio = false; // Require players to have a radio on their toolbelt
Variables that are map specific or frequently changed should be included in init.sqf by default
with a corresponding if(isNil)then{}; in variables.sqf.
*/
//DO NOT TOUCH BELOW! We need to get local channel names that varry upon every player's selected language
DZE_LocalizedDisabledChannels = [];
{
_localizedText = localize _x;
DZE_LocalizedDisabledChannels set [(count DZE_LocalizedDisabledChannels), _localizedText];
} forEach DZE_DisabledChannels;
*/

View File

@@ -695,20 +695,19 @@ dayz_groupInvite = compile preprocessFileLineNumbers "\z\addons\dayz_code\groups
DZE_FilterCheats = {
#define DIK_NUMPADMINUS 0x4A
#define DIK_CAPSLOCK 0x3A
disableSerialization;
_dik = _this select 1;
_shift = _this select 2;
_isVoiceChat = ((_dik == DIK_CAPSLOCK) && {(ctrlText ((findDisplay 63) displayCtrl 101)) in DZE_LocalizedDisabledChannels}); //getting display directly from _this select 0 isn't reliable for chat channels!
_isVoiceChat = (_dik in dayz_voiceControls && {ctrlText (findDisplay 63 displayCtrl 101) in DZE_DisabledChannels}); //getting display directly from _this select 0 isn't reliable for chat channels!
if ((_dik == DIK_NUMPADMINUS && _shift) || _isVoiceChat) then {
call player_forceSave;
if (!_isVoiceChat) then {call player_forceSave;};
disableUserInput true;disableUserInput true;
[_isVoiceChat] spawn { //disable input, this is unfortunately the only way to stop cheat input
_isVoiceChat spawn { //disable input, this is unfortunately the only way to stop cheat input
_testTime = diag_tickTime;
CheatsDisabled = _testTime;
if (_this select 0) then {
titleText [(Format ["No voice chat in: %1", DZE_LocalizedDisabledChannels]), "PLAIN", 1];
uiSleep 1;
if (_this) then {
titleText [(Format ["No voice chat in: %1", DZE_DisabledChannels]), "PLAIN", 1];
uiSleep 2;
} else {
titleText ["DO NOT ENTER CHEATS, WAIT 5 SECONDS TO CONTINUE!", "PLAIN", 1];
uiSleep 5;
@@ -719,8 +718,7 @@ DZE_FilterCheats = {
};
};
};
_handle = if (_isVoiceChat) then {true;} else {false;};
_handle;
_isVoiceChat
};
player_sumMedical = {

View File

@@ -684,7 +684,9 @@ if (!isDedicated) then {
Dayz_freefall = [ time, 0, 0.1 ];
dayz_getout = objNull;
dayz_getoutTime = 0;
dayz_HitBy = objNull;
dayz_HitBy = objNull;
dayz_voiceControls = [-999];
{dayz_voiceControls = dayz_voiceControls + (actionKeys _x)} count ["VoiceOverNet","PushToTalk","PushToTalkAll","PushToTalkCommand","PushToTalkDirect","PushToTalkGroup","PushToTalkSide","PushToTalkVehicle"];
// EPOCH ADDITIONS
if (isNil "DZE_BackpackAntiTheft") then {DZE_BackpackAntiTheft = false;};