Add block for voice channels

use DZE_DisabledChannels as decribed in configvariables.sqf
This commit is contained in:
icomrade
2016-11-25 13:05:27 -05:00
parent cf64805d10
commit 1097eaba0c
3 changed files with 29 additions and 7 deletions

View File

@@ -96,7 +96,12 @@ class RscDisplayChat
onKeyDown = "if (!isNil 'DZE_FilterCheats') then {_this call DZE_FilterCheats;}; false"; onKeyDown = "if (!isNil 'DZE_FilterCheats') then {_this call DZE_FilterCheats;}; false";
class controls; class controls;
}; };
class RscDisplayChannel
{
idd = 63;
onKeyDown = "_handle = if (!isNil 'DZE_FilterCheats') then {_this call DZE_FilterCheats;} else {false;}; _handle";
class controls;
};
class RscPictureGUI class RscPictureGUI
{ {
access = 0; access = 0;

View File

@@ -33,6 +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_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_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_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"]
// Death Messages // Death Messages
DZE_DeathMsgChat = "none"; //"none","global","side","system" Display death messages in selected chat channel. DZE_DeathMsgChat = "none"; //"none","global","side","system" Display death messages in selected chat channel.
@@ -109,3 +110,10 @@ 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 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. 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

@@ -694,24 +694,33 @@ dayz_EjectPlayer = compile preprocessFileLineNumbers "\z\addons\dayz_code\compil
dayz_groupInvite = compile preprocessFileLineNumbers "\z\addons\dayz_code\groups\handleInvite.sqf"; dayz_groupInvite = compile preprocessFileLineNumbers "\z\addons\dayz_code\groups\handleInvite.sqf";
DZE_FilterCheats = { DZE_FilterCheats = {
#define DIK_SUBTRACT 0x4A #define DIK_NUMPADMINUS 0x4A
#define DIK_NUMPADMINUS DIK_SUBTRACT #define DIK_CAPSLOCK 0x3A
disableSerialization;
_dik = _this select 1; _dik = _this select 1;
_shift = _this select 2; _shift = _this select 2;
if (_dik == DIK_NUMPADMINUS && _shift) then { _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!
if ((_dik == DIK_NUMPADMINUS && _shift) || _isVoiceChat) then {
call player_forceSave; call player_forceSave;
disableUserInput true;disableUserInput true; disableUserInput true;disableUserInput true;
[] 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; _testTime = diag_tickTime;
CheatsDisabled = _testTime; CheatsDisabled = _testTime;
titleText ["DO NOT ENTER CHEATS, WAIT 5 SECONDS TO CONTINUE!", "PLAIN", 1]; if (_this select 0) then {
uiSleep 5; titleText [(Format ["No voice chat in: %1", DZE_LocalizedDisabledChannels]), "PLAIN", 1];
uiSleep 1;
} else {
titleText ["DO NOT ENTER CHEATS, WAIT 5 SECONDS TO CONTINUE!", "PLAIN", 1];
uiSleep 5;
};
if (!r_player_unconsciousInputDisabled && CheatsDisabled == _testTime) then { if (!r_player_unconsciousInputDisabled && CheatsDisabled == _testTime) then {
//weird disableuserInput behavior, enable input, disable and reenable to prevent the last key press being input after re-enable //weird disableuserInput behavior, enable input, disable and reenable to prevent the last key press being input after re-enable
disableUserInput false;disableUserInput true;disableUserInput false;disableUserInput false; disableUserInput false;disableUserInput true;disableUserInput false;disableUserInput false;
}; };
}; };
}; };
_handle = if (_isVoiceChat) then {true;} else {false;};
_handle;
}; };
player_sumMedical = { player_sumMedical = {