mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 12:12:34 +03:00
Update keyboard.sqf and block backspace by default
This commit is contained in:
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
#include "\ca\editor\Data\Scripts\dikCodes.h"
|
#include "\ca\editor\Data\Scripts\dikCodes.h"
|
||||||
|
|
||||||
|
private ["_dikCode","_shiftState","_ctrlState","_altState","_handled","_cancelBuild","_dze_f","_dze_q","_dze_z","_autoRun","_filterCheat","_openGroups","_muteSound","_statusUI","_rifle","_pistol","_melee","_surrender","_gear","_forcesave","_drop","_interrupt","_noise","_journal","_build_left","_build_right","_build_str8OnOff","_block","_addArray","_code"];
|
||||||
|
|
||||||
_dikCode = _this select 1;
|
_dikCode = _this select 1;
|
||||||
_shiftState = _this select 2;
|
_shiftState = _this select 2;
|
||||||
_ctrlState = _this select 3;
|
_ctrlState = _this select 3;
|
||||||
@@ -16,27 +18,29 @@ if (isNil "keyboard_keys") then {
|
|||||||
if (r_player_dead) then {_handled = true;}; // Disable ESC after death
|
if (r_player_dead) then {_handled = true;}; // Disable ESC after death
|
||||||
};
|
};
|
||||||
_dze_f = {
|
_dze_f = {
|
||||||
if (!_ctrlState && !_altState) then {DZE_F = true;};
|
if (!_ctrlState && {!_altState}) then {DZE_F = true;};
|
||||||
};
|
};
|
||||||
_dze_q = {
|
_dze_q = {
|
||||||
if (!_ctrlState && !_altState) then {DZE_Q = true;};
|
if (!_ctrlState && {!_altState}) then {DZE_Q = true;};
|
||||||
if (!_ctrlState && _altState) then {DZE_Q_alt = true;};
|
if (!_ctrlState && {_altState}) then {DZE_Q_alt = true;};
|
||||||
if (_ctrlState && !_altState) then {DZE_Q_ctrl = true;};
|
if (_ctrlState && {!_altState}) then {DZE_Q_ctrl = true;};
|
||||||
};
|
};
|
||||||
_dze_z = {
|
_dze_z = {
|
||||||
if (!_ctrlState && !_altState) then {DZE_Z = true;};
|
if (!_ctrlState && {!_altState}) then {DZE_Z = true;};
|
||||||
if (!_ctrlState && _altState) then {DZE_Z_alt = true;};
|
if (!_ctrlState && {_altState}) then {DZE_Z_alt = true;};
|
||||||
if (_ctrlState && !_altState) then {DZE_Z_ctrl = true;};
|
if (_ctrlState && {!_altState}) then {DZE_Z_ctrl = true;};
|
||||||
};
|
};
|
||||||
_autoRun = {
|
_autoRun = {
|
||||||
if (!dayz_autoRun) then {
|
if (!dayz_autoRun) then {
|
||||||
dayz_autoRun = true;
|
dayz_autoRun = true;
|
||||||
dayz_autoRunThread = [] spawn {
|
dayz_autoRunThread = [] spawn {
|
||||||
|
private "_weapon";
|
||||||
|
|
||||||
_weapon = currentWeapon player;
|
_weapon = currentWeapon player;
|
||||||
while {dayz_autoRun} do {
|
while {dayz_autoRun} do {
|
||||||
// SurfaceIsWater does not work for ponds
|
// SurfaceIsWater does not work for ponds
|
||||||
// Check weapon to detect Arma action (dayz action is handled in dz_fn_switchWeapon)
|
// Check weapon to detect Arma action (dayz action is handled in dz_fn_switchWeapon)
|
||||||
if (player != vehicle player or (surfaceIsWater getPosASL player) or ((call fn_nearWaterHole) select 0) or (currentWeapon player != _weapon) or r_fracture_legs) exitWith {
|
if (player != vehicle player or {r_fracture_legs} or {surfaceIsWater getPosASL player} or {currentWeapon player != _weapon} or {(call fn_nearWaterHole) select 0}) exitWith {
|
||||||
call dayz_autoRunOff;
|
call dayz_autoRunOff;
|
||||||
};
|
};
|
||||||
player playAction "FastF";
|
player playAction "FastF";
|
||||||
@@ -53,7 +57,7 @@ if (isNil "keyboard_keys") then {
|
|||||||
_handled = [displayNull,_dikCode,_shiftState] call dze_filterCheats;
|
_handled = [displayNull,_dikCode,_shiftState] call dze_filterCheats;
|
||||||
};
|
};
|
||||||
_openGroups = {
|
_openGroups = {
|
||||||
if (dayz_requireRadio && !("ItemRadio" in items player)) then {
|
if (dayz_requireRadio && {!("ItemRadio" in items player)}) then {
|
||||||
localize "STR_EPOCH_NEED_RADIO" call dayz_rollingMessages;
|
localize "STR_EPOCH_NEED_RADIO" call dayz_rollingMessages;
|
||||||
} else {
|
} else {
|
||||||
if (isNull findDisplay 80000) then {
|
if (isNull findDisplay 80000) then {
|
||||||
@@ -129,26 +133,30 @@ if (isNil "keyboard_keys") then {
|
|||||||
_handled = true;
|
_handled = true;
|
||||||
};
|
};
|
||||||
_gear = {
|
_gear = {
|
||||||
if ((vehicle player != player) and !_shiftState and !_ctrlState and !_altState && !dialog) then {
|
if ((vehicle player != player) && {!_shiftState} && {!_ctrlState} && {!_altState} && {!dialog}) then {
|
||||||
createGearDialog [player, "RscDisplayGear"];
|
createGearDialog [player, "RscDisplayGear"];
|
||||||
_handled = true;
|
_handled = true;
|
||||||
}
|
} else {
|
||||||
else { if ((vehicle player == player) and (speed vehicle player > 0)) then {
|
if ((vehicle player == player) && {speed vehicle player > 0}) then {
|
||||||
//[objNull, player, rSwitchMove,""] call RE;
|
//[objNull, player, rSwitchMove,""] call RE;
|
||||||
_handled = true;
|
_handled = true;
|
||||||
};};
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
_forcesave = {
|
_forcesave = {
|
||||||
if (diag_tickTime - dayz_lastSave > 10) then {
|
if (diag_tickTime - dayz_lastSave > 10) then {
|
||||||
call player_forceSave;
|
call player_forceSave;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
/*
|
||||||
_forcesave2 = {
|
_forcesave2 = {
|
||||||
if ((!isNull (findDisplay 106)) OR dialog) then {
|
if ((!isNull (findDisplay 106)) OR dialog) then {
|
||||||
call player_forceSave;
|
call player_forceSave;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
*/
|
||||||
_drop = {
|
_drop = {
|
||||||
|
private "_doors";
|
||||||
if (r_drag_sqf) then {
|
if (r_drag_sqf) then {
|
||||||
_doors = nearestObjects [player, DayZ_DropDrageeObjects, 3]; //Prevent dropping dragged player through objects
|
_doors = nearestObjects [player, DayZ_DropDrageeObjects, 3]; //Prevent dropping dragged player through objects
|
||||||
if (count _doors > 0) then {_handled = true;};
|
if (count _doors > 0) then {_handled = true;};
|
||||||
@@ -168,13 +176,13 @@ if (isNil "keyboard_keys") then {
|
|||||||
//Overriding default engine handling does not stop combination binds, need manual disableUserInput too
|
//Overriding default engine handling does not stop combination binds, need manual disableUserInput too
|
||||||
_handled = [displayNull,_dikCode,_shiftState] call dze_filterCheats;
|
_handled = [displayNull,_dikCode,_shiftState] call dze_filterCheats;
|
||||||
|
|
||||||
if (diag_ticktime - dayz_lastCheckBit > 10 && !(_dikCode in channel_keys)) then {
|
if (diag_ticktime - dayz_lastCheckBit > 10 && {!(_dikCode in channel_keys)}) then {
|
||||||
dayz_lastCheckBit = diag_ticktime;
|
dayz_lastCheckBit = diag_ticktime;
|
||||||
[player,20,true,(getPosATL player)] call player_alertZombies;
|
[player,20,true,(getPosATL player)] call player_alertZombies;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
_journal = {
|
_journal = {
|
||||||
if (!dayz_isSwimming and !dialog) then {
|
if (!dayz_isSwimming && {!dialog}) then {
|
||||||
[player,4,true,(getPosATL player)] call player_alertZombies;
|
[player,4,true,(getPosATL player)] call player_alertZombies;
|
||||||
createDialog 'horde_journal_front_cover';
|
createDialog 'horde_journal_front_cover';
|
||||||
};
|
};
|
||||||
@@ -185,6 +193,8 @@ if (isNil "keyboard_keys") then {
|
|||||||
DZE_4 = true;
|
DZE_4 = true;
|
||||||
// fence construction
|
// fence construction
|
||||||
if (0 != count Dayz_constructionContext) then {
|
if (0 != count Dayz_constructionContext) then {
|
||||||
|
private ["_angleRef", "_dir","_new"];
|
||||||
|
|
||||||
_angleRef = Dayz_constructionContext select 1;
|
_angleRef = Dayz_constructionContext select 1;
|
||||||
_dir = _angleRef - (getDir player) -5;
|
_dir = _angleRef - (getDir player) -5;
|
||||||
if (_dir > 180) then {_dir = _dir - 360};
|
if (_dir > 180) then {_dir = _dir - 360};
|
||||||
@@ -201,6 +211,8 @@ if (isNil "keyboard_keys") then {
|
|||||||
_build_right = {
|
_build_right = {
|
||||||
DZE_6 = true;
|
DZE_6 = true;
|
||||||
if (0 != count Dayz_constructionContext) then {
|
if (0 != count Dayz_constructionContext) then {
|
||||||
|
private ["_angleRef", "_dir","_new"];
|
||||||
|
|
||||||
_angleRef = Dayz_constructionContext select 1;
|
_angleRef = Dayz_constructionContext select 1;
|
||||||
_dir = _angleRef - (getDir player) +5;
|
_dir = _angleRef - (getDir player) +5;
|
||||||
if (_dir > 180) then { _dir = _dir - 360; };
|
if (_dir > 180) then { _dir = _dir - 360; };
|
||||||
@@ -230,6 +242,8 @@ if (isNil "keyboard_keys") then {
|
|||||||
if (player isKindOf "PZombie_VB") then {
|
if (player isKindOf "PZombie_VB") then {
|
||||||
_handled = true; // do not allow player zombies to vault or jump
|
_handled = true; // do not allow player zombies to vault or jump
|
||||||
} else {
|
} else {
|
||||||
|
private "_nearbyObjects";
|
||||||
|
|
||||||
_nearbyObjects = nearestObjects [getPosATL player, dayz_disallowedVault, 8];
|
_nearbyObjects = nearestObjects [getPosATL player, dayz_disallowedVault, 8];
|
||||||
if (count _nearbyObjects > 0) then {
|
if (count _nearbyObjects > 0) then {
|
||||||
if (diag_tickTime - dayz_lastCheckBit > 4) then {
|
if (diag_tickTime - dayz_lastCheckBit > 4) then {
|
||||||
@@ -324,7 +338,7 @@ if (isNil "keyboard_keys") then {
|
|||||||
[[ DIK_F9,DIK_F10,DIK_F11,DIK_F12,
|
[[ DIK_F9,DIK_F10,DIK_F11,DIK_F12,
|
||||||
DIK_F8,DIK_F7,DIK_F6,DIK_F5,
|
DIK_F8,DIK_F7,DIK_F6,DIK_F5,
|
||||||
DIK_F2,DIK_9,
|
DIK_F2,DIK_9,
|
||||||
DIK_8,DIK_7,DIK_6,DIK_5,DIK_4], _block] call _addArray;
|
DIK_8,DIK_7,DIK_6,DIK_5,DIK_4,DIK_BACK], _block] call _addArray;
|
||||||
if (dayz_groupSystem) then {
|
if (dayz_groupSystem) then {
|
||||||
[[DIK_F5], _openGroups] call _addArray;
|
[[DIK_F5], _openGroups] call _addArray;
|
||||||
[[DIK_LWIN,DIK_RWIN], {dayz_groupNameTags = !dayz_groupNameTags;_handled = true;}] call _addArray;
|
[[DIK_LWIN,DIK_RWIN], {dayz_groupNameTags = !dayz_groupNameTags;_handled = true;}] call _addArray;
|
||||||
|
|||||||
Reference in New Issue
Block a user