Update snap keybinds for different keyboard layouts and languages

Made by @Victor-the-Cleaner
This commit is contained in:
A Man
2022-05-21 10:39:39 +02:00
parent 2f6d59377a
commit ac4a56d0b5
5 changed files with 88 additions and 39 deletions

View File

@@ -34,8 +34,19 @@ local _strPitch = localize "STR_EPOCH_TUT_PITCH";
local _strBank = localize "STR_EPOCH_TUT_BANK";
local _strRotate = localize "STR_EPOCH_TUT_ROTATE";
local _tab = localize "STR_EPOCH_TUT_KEY_TAB";
local _PgUp = localize "STR_EPOCH_TUT_KEY_PGUP";
local _PgDn = localize "STR_EPOCH_TUT_KEY_PGDN";
local _ctrl = localize "STR_ENG_EPOCH_TUT_KEY_CTRL";
local _PgUp = localize "STR_ENG_EPOCH_TUT_KEY_PGUP";
local _PgDn = localize "STR_ENG_EPOCH_TUT_KEY_PGDN";
local _degKeys = toArray (localize "STR_ENG_EPOCH_TUT_ADJ_DEGREES_KEYS");
if (DZE_KEYBOARD == DZE_GERMAN) then {
_ctrl = localize "STR_GER_EPOCH_TUT_KEY_CTRL";
_PgUp = localize "STR_GER_EPOCH_TUT_KEY_PGUP";
_PgDn = localize "STR_GER_EPOCH_TUT_KEY_PGDN";
_degKeys = toArray (localize "STR_GER_EPOCH_TUT_ADJ_DEGREES_KEYS");
};
local _decrease = toString [_degKeys select 0];
local _increase = toString [_degKeys select 1];
local _hyphen = _WHT + "-" + _ORA;
local _slash = _WHT + "/" + _ORA;
local _colon = _WHT + ": ";
@@ -46,14 +57,11 @@ local _WBR = _WHT + "]";
local _DBR = "] [";
local _BRW = "] " + _WHT;
local _hpsp = _hyphen + _PgUp + _slash + _PgDn + _BRW;
local _degKeys = toArray (localize "STR_EPOCH_TUT_ADJ_DEGREES_KEYS");
local _decrease = toString [_degKeys select 0];
local _increase = toString [_degKeys select 1];
local _handedness = ["STR_EPOCH_TUT_KEY_ARROWS","STR_EPOCH_TUT_KEY_NUMPAD_ARROWS"] select DZE_LEFT_HANDED;
local _HK = _OBR + _tab + _DBR + localize "STR_EPOCH_TUT_KEY_SHIFT" + _hyphen + _tab + _BRW + localize "STR_EPOCH_TUT_SNAP_NEXT_PREV" + _NL;
_HK = _HK + _OBR + _PgUp + _DBR + _PgDn + _BRW + localize "STR_EPOCH_TUT_HEIGHT10" + _NL;
_HK = _HK + _OBR + localize "STR_EPOCH_TUT_KEY_CTRL" + _hpsp + localize "STR_EPOCH_TUT_HEIGHT1" + _NL;
_HK = _HK + _OBR + _ctrl + _hpsp + localize "STR_EPOCH_TUT_HEIGHT1" + _NL;
_HK = _HK + _OBR + localize "STR_EPOCH_TUT_KEY_ALT" + _hpsp + localize "STR_EPOCH_TUT_HEIGHT100" + _NL;
_HK = _HK + _OBR + localize _handedness + _BRW + _strPitch + " / " + _strBank + _NL;
_HK = _HK + _ORA + "[Q] [E] " + _WHT + _strRotate + _NL;

View File

@@ -168,9 +168,8 @@ if (isNil "keyboard_keys") then {
_handled = true;
};
local _statusUI = {
DZE_UI = DZE_UI + 1;
if (DZE_UI == 6) then {DZE_UI = 0; [format[localize "STR_UI_STATUS_ICONS" + " %1",localize "STR_DISABLED"],1] call dayz_rollingMessages;};
if (DZE_UI == 1) then {[format[localize "STR_UI_STATUS_ICONS" + " %1",localize "STR_ENABLED"],1] call dayz_rollingMessages;};
DZE_UI = (DZE_UI + 1) % 6;
if (DZE_UI < 2) then {[format[localize "STR_UI_STATUS_ICONS" + " %1",localize (["STR_DISABLED","STR_ENABLED"] select DZE_UI)],1] call dayz_rollingMessages;};
profileNamespace setVariable ["statusUI",DZE_UI];
saveProfileNamespace;
call ui_changeDisplay;
@@ -179,13 +178,22 @@ if (isNil "keyboard_keys") then {
local _handedness = {
if (isNil "DZE_buildItem") then { // only allow switching outside of base building
DZE_LEFT_HANDED = !DZE_LEFT_HANDED;
local _handed = "";
if (DZE_LEFT_HANDED) then {
_handed = "STR_EPOCH_LEFT_HANDED";
} else {
_handed = "STR_EPOCH_RIGHT_HANDED";
};
systemChat format [localize "STR_EPOCH_KEYBOARD_HANDEDNESS", localize _handed];
local _handed = ["STR_EPOCH_RIGHT_HANDED","STR_EPOCH_LEFT_HANDED"] select DZE_LEFT_HANDED;
[format [localize "STR_EPOCH_KEYBOARD_HANDEDNESS", localize _handed], 1] call dayz_rollingMessages;
profileNamespace setVariable ["leftHanded", DZE_LEFT_HANDED];
saveProfileNamespace;
};
_handled = true;
};
local _keyboard = {
if (isNil "DZE_buildItem") then { // only allow switching outside of base building
DZE_KEYBOARD = (DZE_KEYBOARD + 1) % 2; // English and German keyboard layout for hotkeys
{
if (DZE_KEYBOARD == _x select 0) exitWith {DZE_LANGUAGE = _x select 1};
} count DZE_HOTKEYS;
[format [localize "STR_EPOCH_KEYBOARD_LAYOUT", localize DZE_LANGUAGE], 1] call dayz_rollingMessages;
profileNamespace setVariable ["keyboardLayout", DZE_KEYBOARD];
saveProfileNamespace;
};
_handled = true;
};
@@ -369,8 +377,9 @@ if (isNil "keyboard_keys") then {
[actionKeys "SelectAll", _block] call _addArray;
[[DIK_F1], _muteSound] call _addArray;
[[DIK_F3], _statusUI] call _addArray;
[[DIK_F6], _handedness] call _addArray;
[[DIK_F5], {if (diag_tickTime - dayz_lastSave > 10) then {call player_forceSave;};_handled = true;}] call _addArray;
[[DIK_F6], _handedness] call _addArray;
[[DIK_F7], _keyboard] call _addArray;
[[DIK_TAB], _dze_tab] call _addArray;
[actionKeys "LeanLeft", {DZE_4 = true; dayz_dodge = true;}] call _addArray;
[actionKeys "LeanRight", {DZE_6 = true; dayz_dodge = true;}] call _addArray;
@@ -378,7 +387,7 @@ if (isNil "keyboard_keys") then {
[[DIK_E], _dze_e] call _addArray;
[actionKeys "GetOver", _bunnyhop] call _addArray; // V
[actionKeys "ForceCommandingMode", {DZE_5 = true; _handled = true;}] call _addArray;
[[DIK_F2, DIK_F4, DIK_F7, DIK_F8, DIK_F9, DIK_F10, DIK_F11, DIK_F12, DIK_4, DIK_5, DIK_6, DIK_7, DIK_8, DIK_9], _block] call _addArray;
[[DIK_F2, DIK_F4, DIK_F8, DIK_F9, DIK_F10, DIK_F11, DIK_F12, DIK_4, DIK_5, DIK_6, DIK_7, DIK_8, DIK_9], _block] call _addArray;
if (dayz_groupSystem) then {
[[DIK_F5], _openGroups] call _addArray;

View File

@@ -434,7 +434,11 @@ if (!isDedicated) then {
DZE_myHaloVehicle = objNull;
dayz_myLiftVehicle = objNull;
DZE_Friends = [];
DZE_LEFT_HANDED = false;
DZE_ENGLISH = 0;
DZE_GERMAN = 1;
DZE_HOTKEYS = [[DZE_ENGLISH,"STR_EPOCH_ENGLISH"], [DZE_GERMAN,"STR_EPOCH_GERMAN"]];
DZE_KEYBOARD = profileNamespace getVariable ["keyboardLayout", 0];
DZE_LEFT_HANDED = profileNamespace getVariable ["leftHanded", false];
DZE_Q = false;
DZE_Z = false;
DZE_Q_alt = false;

View File

@@ -33809,18 +33809,6 @@
<Key ID="STR_EPOCH_TUT_KEY_SHIFT">
<English>Shift</English>
</Key>
<Key ID="STR_EPOCH_TUT_KEY_PGUP">
<English>PgUp</English>
<German>Bild Auf</German>
</Key>
<Key ID="STR_EPOCH_TUT_KEY_PGDN">
<English>PgDn</English>
<German>Bild Ab</German>
</Key>
<Key ID="STR_EPOCH_TUT_KEY_CTRL">
<English>Ctrl</English>
<German>Strg</German>
</Key>
<Key ID="STR_EPOCH_TUT_KEY_ALT">
<English>Alt</English>
</Key>
@@ -33834,10 +33822,54 @@
<German>Nummernpad-Pfeiltasten</German>
<Russian>Стрелки на цифровой клавиатуре</Russian>
</Key>
<Key ID="STR_EPOCH_ENGLISH">
<English>English</English>
<German>Englisch</German>
</Key>
<Key ID="STR_EPOCH_GERMAN">
<English>German</English>
<German>Deutsch</German>
</Key>
<Key ID="STR_EPOCH_KEYBOARD_LAYOUT">
<English>Keyboard Layout: %1</English>
<German>Tastaturbelegung: %1</German>
</Key>
<Key ID="STR_GER_EPOCH_TUT_KEY_PGUP">
<English>Bild Auf</English>
<German>Bild Auf</German>
</Key>
<Key ID="STR_GER_EPOCH_TUT_KEY_PGDN">
<English>Bild Ab</English>
<German>Bild Ab</German>
</Key>
<Key ID="STR_GER_EPOCH_TUT_KEY_CTRL">
<English>Strg</English>
<German>Strg</German>
</Key>
<Key ID="STR_GER_EPOCH_TUT_ADJ_DEGREES_KEYS">
<English>ß´</English>
<German>ß´</German>
</Key>
<Key ID="STR_ENG_EPOCH_TUT_KEY_PGUP">
<English>PgUp</English>
<German>PgUp</German>
</Key>
<Key ID="STR_ENG_EPOCH_TUT_KEY_PGDN">
<English>PgDn</English>
<German>PgDn</German>
</Key>
<Key ID="STR_ENG_EPOCH_TUT_KEY_CTRL">
<English>Ctrl</English>
<German>Ctrl</German>
</Key>
<Key ID="STR_ENG_EPOCH_TUT_ADJ_DEGREES_KEYS">
<English>-=</English>
<German>-=</German>
</Key>
<Key ID="STR_EPOCH_KEYBOARD_HANDEDNESS">
<English>** Keyboard is now configured: %1 **</English>
<German>** Tastatur is eingestellt auf: %1 **</German>
<Russian>** Теперь клавиатура сконфигурирована для %1 **</Russian>
<English>Keyboard is now configured: %1</English>
<German>Tastatur is eingestellt auf: %1</German>
<Russian>Теперь клавиатура сконфигурирована для %1</Russian>
</Key>
<Key ID="STR_EPOCH_LEFT_HANDED">
<English>Left-handed</English>
@@ -33936,10 +33968,6 @@
<German>Bauen</German>
<Russian>Построить</Russian>
</Key>
<Key ID="STR_EPOCH_TUT_ADJ_DEGREES_KEYS">
<English>-=</English>
<German>ß´</German>
</Key>
<Key ID="STR_EPOCH_BUILD_UI_SNAP">
<English>Snap</English>
<Russian>Привязка</Russian>

View File

@@ -83,7 +83,7 @@
5 switchCamera !"\"switchCamera\", " !"rswitchCamera" !"player switchCamera _currentCamera;\nif (_currentWpn !=" !"< 150) && random 1 > 0.5) then {\n_killer switchcamera"
5 systemChat !="systemChat format[localize \"str_missing_to_do_this\", _x];" !"systemChat (localize " !"systemChat format[localize \"STR_EPOCH_" !"systemChat localize \"STR_EPOCH_" !"case \"system\": {systemChat _message;};" !"systemchat localize \"STR_CRAFTING_NEEDED_ITEMS\";" !"systemChat format[localize \"STR_CL_" !"systemChat localize \"STR_CL_" !=") then {\nif (player getVariable[\"radiostate\",true]) then {\nsystemChat (\"[RADIO] \" + _message);\nplaySound \"Radio_Message_Sound\";\n" !"systemChat localize \"str_cursorTargetNotFound\"" !="T_HANDED\";\n} else {\n_handed = \"STR_EPOCH_RIGHT_HANDED\";\n};\nsystemChat format [localize \"STR_EPOCH_KEYBOARD_HANDEDNESS\", localize"
5 title !"titleCut [\"\", \"BLACK " !"\"titleCut\", " !"\"titleText\"" !="rtitleCut = 'titleCut'" !"rtitleCutc" !="rtitleText = 'titleText'" !"rtitleTextc" !"(_missionTextListPath >> \"titles\")" !"(_display displayCtrl _titleIDC) ctrlShow false;" !"titleText [format[localize \"str_return_lobby\", _x" !",\"_titleText\"" !"localize 'STR_UI_GENDER_TITLE';\n_timeNem" !="scriptName \"MP\\data\\scriptCommands\\titleText.sqf\";" !_fillTradeTitle !_bldTxtStringTitle !"localize \"str_halo_altitude_speed" !"play displayCtrl 8801 ctrlSetText(format[localize \"STR_CL_RV_TITLE\",_keyDisplay]);\n\n_control = ((findDisplay 8800) displayCtrl 8" !="f\"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nprivate [\"_folder\",\"_actionTitleFormat\",\"_actionCostsFormat\",\"_message\",\"_messageShown\",\"_last" !="\"ns_evrWave2\",\"ns_evrWave3\"];\n\n\nif (DZE_EVRWhiteFlash) then {titleText[\"\",\"WHITE OUT\",1]; titleText[\"\",\"WHITE IN\",1]; uiSleep 0."
5 toString !"_animCheck = toString ([(_animStateArray select 0),(_animStateArray select 1)" !="_skinToModel = toString (_finalArray);" !="{_textArrayTemp = _textArrayTemp + [tostring [_x]]} foreach _line;" !="_cmpt = toString _cmpt;" !="_objName = toLower(toString(_objName));" !"if (toString _hayArr != _needle) then {" !="_type = toString _typeA;" !="_anim4 = toString _anim4;" !"{(count _stance>17)}) then {toString [_stance select 17]}" !"BIS_fnc_timeToString" !"02, if (typeName _name == \"ARRAY\") then {toString _name} else {_name}];" !="s = true;\n\n_array = toArray (animationState player);\n_str = toString [_array select 5,_array select 6,_array select 7];\n_anim = " !=" _input - [_x];\n} forEach _badChars;\n\n_input = parseNumber (toString (_input));\n_input\n};\n\nBankDialogUpdateAmounts = {\nprivate [" !=";\n\n{\n_input = _input - [_x];\n} forEach _badChars;\n\n_input = toString (_input);\n\nif (_type == 0) then {_input = parseNumber _inpu" !="};\nif (!_roofAbove) then {_miss = \"0000\";}; \n\nif !([_miss, toString _hit] call fnc_inString) then { \n_inside = true;\n};\n};\ndayz" !="array2 resize ((count _array2) - 7); \n};\n\n_model = toLower (toString _array2);\n};\n_model" !="set [count _array2, _array select _i];\n};\n_model = toLower (toString _array2);\n};\n_model" !="alize \"STR_EPOCH_TUT_ADJ_DEGREES_KEYS\");\nlocal _decrease = toString [_degKeys select 0];\nlocal _increase = toString [_degKeys "
5 toString !"_animCheck = toString ([(_animStateArray select 0),(_animStateArray select 1)" !="_skinToModel = toString (_finalArray);" !="{_textArrayTemp = _textArrayTemp + [tostring [_x]]} foreach _line;" !="_cmpt = toString _cmpt;" !="_objName = toLower(toString(_objName));" !"if (toString _hayArr != _needle) then {" !="_type = toString _typeA;" !="_anim4 = toString _anim4;" !"{(count _stance>17)}) then {toString [_stance select 17]}" !"BIS_fnc_timeToString" !"02, if (typeName _name == \"ARRAY\") then {toString _name} else {_name}];" !="s = true;\n\n_array = toArray (animationState player);\n_str = toString [_array select 5,_array select 6,_array select 7];\n_anim = " !=" _input - [_x];\n} forEach _badChars;\n\n_input = parseNumber (toString (_input));\n_input\n};\n\nBankDialogUpdateAmounts = {\nprivate [" !=";\n\n{\n_input = _input - [_x];\n} forEach _badChars;\n\n_input = toString (_input);\n\nif (_type == 0) then {_input = parseNumber _inpu" !="};\nif (!_roofAbove) then {_miss = \"0000\";}; \n\nif !([_miss, toString _hit] call fnc_inString) then { \n_inside = true;\n};\n};\ndayz" !="array2 resize ((count _array2) - 7); \n};\n\n_model = toLower (toString _array2);\n};\n_model" !="set [count _array2, _array select _i];\n};\n_model = toLower (toString _array2);\n};\n_model" !="STR_GER_EPOCH_TUT_ADJ_DEGREES_KEYS\");\n};\nlocal _decrease = toString [_degKeys select 0];\nlocal _increase = toString [_degKeys "
5 worldTo !="_relPos = _building worldToModel _point;" !"_w2m = _x worldToModel (getPosATL player);\n_bb = (boundingbox _x) select 1;" !="_h = _offset + ((_o worldToModel (getPosATL _o)) select 2);" !"_pos set [2,(_pos select 2) + 1.5];\n_screen = worldToScreen _pos;\n_text = composeText [image" !="\n_pos = _this select 1; \n_offset = 1; \n\n_relPos = _building worldToModel _pos;\n_boundingBox = boundingBox _building;\n\n_min = _bo" !="ype in DZE_insideExceptions}}) then {\n\nlocal _pos = _object worldToModel (ASLToATL _posASL);\nlocal _max = (boundingBox _object) " !="napText = {\nif (!DZE_uiSnapText) exitWith {};\n\nlocal _pos = worldToScreen (_closestNearCurr modelToWorld [0,0,0]);\n\nif (count _p" !=" (_building != _item) then { \nlocal _relPos = _building worldToModel _pos;\n\nlocal _max = (boundingBox _building) select 1;\nl"