mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-13 19:52:38 +03:00
Update keyboard_keys after changing controls in-game
Vanilla commit:
e9b21a7e79
@icomrade we forgot to refresh keyboard_keys after the player changes
their controls in-game. The keyhandler was still using the old
keyboard_keys array since it is only set once at login time. The new
keys they set in-game wouldn't work until they relogged.
This commit is contained in:
@@ -38,6 +38,11 @@ class RscDisplayMission: RscDisplayEmpty
|
||||
idd = 46;
|
||||
onKeyDown = "if (!isNil 'DZ_KeyDown_EH') then {_this call DZ_KeyDown_EH;};"; //assigned much quicker than spawning init_keyboard
|
||||
};
|
||||
class RscDisplayConfigure {
|
||||
onUnload = "if (!isNil 'keyboard_keys') then {keyboard_keys = nil; [controlNull,1,false,false,false] call DZ_KeyDown_EH;};"; //refresh keyboard_keys after changing binds
|
||||
class controlsBackground;
|
||||
class controls;
|
||||
};
|
||||
class RscDisplayChat
|
||||
{
|
||||
idd = 24;
|
||||
@@ -236,7 +241,7 @@ class RscDisplayMain : RscStandardDisplay
|
||||
text = "z\addons\dayz_code\gui\loadingscreen.paa";
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
class controls
|
||||
{
|
||||
class CA_Version;
|
||||
|
||||
@@ -339,6 +339,7 @@ if (isNil "keyboard_keys") then {
|
||||
DIK_F8,DIK_F7,DIK_F6,DIK_F5,DIK_F4,
|
||||
DIK_F3,DIK_F2,DIK_9,
|
||||
DIK_8,DIK_7,DIK_6,DIK_5,DIK_4], _block] call _addArray;
|
||||
diag_log "keyboard_keys reset";
|
||||
if (!isNil "bis_fnc_halo_keydown_eh") then {bis_fnc_halo_keydown_eh = (finddisplay 46) displayaddeventhandler ["keydown","_this call bis_fnc_halo_keydown;"];}; // halo in progress
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user