From 05fa3e6a9abe11c339685132bb4638837d4676fd Mon Sep 17 00:00:00 2001 From: ebaydayz Date: Tue, 11 Oct 2016 15:34:10 -0400 Subject: [PATCH] Update keyboard_keys after changing controls in-game Vanilla commit: https://github.com/DayZMod/DayZ/commit/e9b21a7e796417b783d661fab053676d164d723b @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. --- SQF/dayz_code/Configs/rscTitles.hpp | 7 ++++++- SQF/dayz_code/compile/keyboard.sqf | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/SQF/dayz_code/Configs/rscTitles.hpp b/SQF/dayz_code/Configs/rscTitles.hpp index 53ffe1883..4ca7b02c0 100644 --- a/SQF/dayz_code/Configs/rscTitles.hpp +++ b/SQF/dayz_code/Configs/rscTitles.hpp @@ -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; diff --git a/SQF/dayz_code/compile/keyboard.sqf b/SQF/dayz_code/compile/keyboard.sqf index 512571e03..8c80d3974 100644 --- a/SQF/dayz_code/compile/keyboard.sqf +++ b/SQF/dayz_code/compile/keyboard.sqf @@ -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 };