From be550836ea8ed20097326cd4cc2b3fc29c6098b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Badano?= Date: Sat, 24 Jan 2015 15:25:03 -0300 Subject: [PATCH] common: remove AGM key handling routines and remaining stuff from AGM options menu --- addons/common/HintConfig.hpp | 76 -------- addons/common/UI/box_checked_ca.paa | Bin 2897 -> 0 bytes addons/common/UI/box_unchecked_ca.paa | Bin 2897 -> 0 bytes addons/common/XEH_postInit.sqf | 27 +-- addons/common/XEH_preInit.sqf | 1 - addons/common/functions/fnc_setKeyDefault.sqf | 67 ------- addons/common/scripts/KeyInput/initKeys.sqf | 72 -------- .../scripts/KeyInput/script_component.hpp | 1 - addons/common/scripts/closeMenu.sqf | 5 - addons/common/scripts/editKey.sqf | 115 ------------ .../initCanInteractFunction.sqf | 0 .../{KeyInput => }/initScrollWheel.sqf | 0 addons/common/scripts/keyInput.sqf | 26 --- addons/common/scripts/keyRelease.sqf | 6 - addons/common/scripts/nextKeys.sqf | 123 ------------- addons/common/scripts/openMenu.sqf | 100 ----------- addons/common/scripts/toggleState.sqf | 18 -- addons/common/stringtable.xml | 168 ------------------ .../functions/fnc_initialiseInteraction.sqf | 4 +- 19 files changed, 5 insertions(+), 804 deletions(-) delete mode 100644 addons/common/HintConfig.hpp delete mode 100644 addons/common/UI/box_checked_ca.paa delete mode 100644 addons/common/UI/box_unchecked_ca.paa delete mode 100644 addons/common/functions/fnc_setKeyDefault.sqf delete mode 100644 addons/common/scripts/KeyInput/initKeys.sqf delete mode 100644 addons/common/scripts/KeyInput/script_component.hpp delete mode 100644 addons/common/scripts/closeMenu.sqf delete mode 100644 addons/common/scripts/editKey.sqf rename addons/common/scripts/{KeyInput => }/initCanInteractFunction.sqf (100%) rename addons/common/scripts/{KeyInput => }/initScrollWheel.sqf (100%) delete mode 100644 addons/common/scripts/keyInput.sqf delete mode 100644 addons/common/scripts/keyRelease.sqf delete mode 100644 addons/common/scripts/nextKeys.sqf delete mode 100644 addons/common/scripts/openMenu.sqf delete mode 100644 addons/common/scripts/toggleState.sqf diff --git a/addons/common/HintConfig.hpp b/addons/common/HintConfig.hpp deleted file mode 100644 index 3e3493a8ba..0000000000 --- a/addons/common/HintConfig.hpp +++ /dev/null @@ -1,76 +0,0 @@ -// by commy2 - -class RscStructuredText; -class RscMapControl; - -class RscTitles { - class ACE_RscHint { - idd = -1; - onLoad = "uiNamespace setVariable ['ACE_ctrlHint', (_this select 0) displayCtrl 1];"; - movingEnable = false; - duration = 4; - fadeIn = 0.2; - fadeOut = 0.2; - name = "ACE_RscHint"; - - class controls { - class HintBox: RscStructuredText { - idc = 1; - text = ""; - size = "1 / 40 / (getResolution select 5)"; - sizeEx = 1; - colorText[] = {1, 1, 1, 1}; - colorBackground[] = {0, 0, 0, 0.5}; - x = safeZoneW + safeZoneX - 0 * safezoneW; //safeZoneW + safeZoneX - 0.2 * safezoneW; - y = safeZoneY + 0.2 * safezoneH; - w = 0.2 * safeZoneW; - h = 0.1 * SafeZoneH; - }; - }; - }; - class ACE_RscErrorHint { - idd = -1; - onLoad = "uiNamespace setVariable ['ACE_ctrlErrorHint', (_this select 0) displayCtrl 1];"; - movingEnable = false; - duration = 999999; - fadeIn = 0.2; - fadeOut = 0.2; - name = "ACE_RscErrorHint"; - - class controls { - class HintBox: RscStructuredText { - idc = 1; - text = ""; - size = "1 / 40 / (getResolution select 5)"; - sizeEx = 1; - colorText[] = {1, 1, 1, 1}; - colorBackground[] = {0.8, 0, 0, 0.5}; - x = 0.3 * safeZoneW + safeZoneX; - y = 0.4 * safezoneH + safeZoneY; - w = 0.4 * safeZoneW; - h = 0.2 * SafeZoneH; - }; - }; - }; - class ACE_EventHandlerHelper: ACE_Rsc_Display_Base { - idd = -1; - class controls { - class CameraView: RscMapControl { - onDraw = "if (cameraView != uiNamespace getVariable 'ACE_EventHandler_CameraMode') then {uiNamespace setVariable ['ACE_EventHandler_CameraMode', cameraView]; {[uiNamespace getVariable 'ACE_EventHandler_CameraMode'] call _x; nil} count ((missionNamespace getVariable 'ACE_EventHandler_CameraMode') select 2);};"; - idc = -1; - w = 0; - h = 0; - }; - }; - }; - class ACE_EventHandlerHelper2: ACE_Rsc_Display_Base { - class controls { - class MapMarkerCreated: RscMapControl { - onDraw = "if (count allMapMarkers != uiNamespace getVariable 'ACE_EventHandler_MapMarker') then {if (count allMapMarkers > uiNamespace getVariable 'ACE_EventHandler_MapMarker') then {{[allMapMarkers select count allMapMarkers - 1] call _x; nil} count ((missionNamespace getVariable 'ACE_EventHandler_MapMarker') select 2);}; uiNamespace setVariable ['ACE_EventHandler_MapMarker', count allMapMarkers];};"; - idc = -1; - w = 0; - h = 0; - }; - }; - }; -}; diff --git a/addons/common/UI/box_checked_ca.paa b/addons/common/UI/box_checked_ca.paa deleted file mode 100644 index 2b0d92b600e67873e2269140f854005fc03d6fa8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2897 zcmeHJ&2ED*4E{DapzV-ecIQEm08N6+svR~}eVpEQ+cV|1*Wm$>GCNM8M9Vrtg*1tv z)Hwe6Y!_R(Gi_VHKevZE1z?Q%viz~$JKoCM`lVt1o;J(hn&!2l_Y>`p4ETHio*sdM z_PkZ00x||RCP@-Y$-}BtYwh4IJ}1EZT9n`e_+2M)@Gr-6E2@u>mR{jt@5`~JD_{eHUMe=>!Z&cAV*{dN8@voB~_d+*$jE2I}X z|2Ou1|9jnBU5m05y|GTQ*C@Tij_;JN>^e~XSodeYmg+Iw$vJ<189n(B#zaigflrZ= J;=r;9_y%tZbG-ln diff --git a/addons/common/UI/box_unchecked_ca.paa b/addons/common/UI/box_unchecked_ca.paa deleted file mode 100644 index 9bbefd0419cb8d3c00f8a85775585e911655a4bb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2897 zcmeHJ!D_=W3{~eI!gg>kz2`#$P8cMYl^r_9{$$tPcH1}kll%b&_epkGS0YMB$Y4al zQDj?svLnmdq+#e@9*5U%OGGK9cah(^Ly={C=$?9(@6dSs*!RyZzCX}DE26J^qWuF= zgLWIW)Dl$;oRTp{I4ms6z4rxP@Oc3&FU0|`;D?a?;5Yj-7q>Rs%N8~K0GfLb7}tVU z{O|Z$_kTM6*Z5n{-{0n+`7$o&yD@`X`}2O$&i~wN*X*6)7ccWggZYcdz)v;RTwO4p zDY%-uTED;4i!rjja%<|`IVbZj^r0R#tg)ZgYf3gt z_w Aw*UYD diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index 6cabbcd3bf..28f304e04c 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -4,7 +4,7 @@ // hack to get PFH to work in briefing [QGVAR(onBriefingPFH), "onEachFrame", { if (time > 0) exitWith { - [QGVAR(onBriefingPFH), "onEachFrame"] call BIS_fnc_removeStackedEventHandler; + [QGVAR(onBriefingPFH), "onEachFrame"] call BIS_fnc_removeStackedEventHandler; }; call cba_common_fnc_onFrame; @@ -37,38 +37,17 @@ if (!hasInterface) exitWith {}; call COMPILE_FILE(scripts\assignedItemFix); -GVAR(keyInput) = COMPILE_FILE(scripts\keyInput); -GVAR(keyRelease) = COMPILE_FILE(scripts\keyRelease); -GVAR(editKey) = COMPILE_FILE(scripts\editKey); -GVAR(openMenu) = COMPILE_FILE(scripts\openMenu); -GVAR(closeMenu) = COMPILE_FILE(scripts\closeMenu); -GVAR(nextKeys) = COMPILE_FILE(scripts\nextKeys); -GVAR(toggleState) = COMPILE_FILE(scripts\toggleState); - -[false] call FUNC(setKeyDefault); - -GVAR(keyStates) = []; -GVAR(keyTimes) = []; -for "_index" from 0 to 300 do { - GVAR(keyStates) set [_index, 0]; - GVAR(keyTimes) set [_index, -1]; -}; - -call COMPILE_FILE(scripts\KeyInput\initCanInteractFunction); -call COMPILE_FILE(scripts\KeyInput\initKeys); -call COMPILE_FILE(scripts\KeyInput\initScrollWheel); +call COMPILE_FILE(scripts\initCanInteractFunction); +call COMPILE_FILE(scripts\initScrollWheel); 0 spawn { while {true} do { waitUntil {!isNull (findDisplay 46)}; sleep 0.1; - findDisplay 46 displayAddEventHandler ["KeyDown", QUOTE( _this call GVAR(onKeyDown) )]; - findDisplay 46 displayAddEventHandler ["KeyUp", QUOTE( _this call GVAR(onKeyUp) )]; findDisplay 46 displayAddEventHandler ["MouseZChanged", QUOTE( _this call GVAR(onScrollWheel) )]; [false] call FUNC(disableUserInput); waitUntil {isNull (findDisplay 46)}; }; }; - enableCamShake true; // Set the name for the current player diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index f33b3c47fe..ae6a343df9 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -108,7 +108,6 @@ PREP(sanitizeString); PREP(serverLog); PREP(setCaptivityStatus); PREP(setForceWalkStatus); -PREP(setKeyDefault); PREP(setName); PREP(setParameter); PREP(setPitchBankYaw); diff --git a/addons/common/functions/fnc_setKeyDefault.sqf b/addons/common/functions/fnc_setKeyDefault.sqf deleted file mode 100644 index 59c487de43..0000000000 --- a/addons/common/functions/fnc_setKeyDefault.sqf +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Author: commy2 - * - * Set all keys from the 'ACE_Default_Keys' base class that are missing in the current user profile. - * - * Argument: - * 1: Overwrite existing key binds? (Bool) - * - * Return value: - * None. - */ -#include "script_component.hpp" - -private ["_overwrite", "_saveProfile", "_config", "_count", "_index", "_configFile", "_name", "_key", "_shft", "_ctrl", "_alt", "_keyCode", "_state"]; - -_overwrite = _this select 0; - -_saveProfile = false; - -_config = configFile >> "ACE_Default_Keys"; -_count = count _config; - -for "_index" from 0 to (_count - 1) do { - _configFile = _config select _index; - _name = format ["ACE_Key_%1", configName _configFile]; - _key = profileNamespace getVariable _name; - - if (isNil "_key" || {_overwrite}) then { - _key = getNumber (_configFile >> "Key"); - _shft = getNumber (_configFile >> "Shift") == 1; - _ctrl = getNumber (_configFile >> "Control") == 1; - _alt = getNumber (_configFile >> "Alt") == 1; - - _keyCode = [_key, _shft, _ctrl, _alt] call FUNC(convertKeyCode); - - profileNamespace setVariable [_name, _keyCode]; - _saveProfile = true; - }; -}; - -_config = configFile >> "ACE_Options"; -_count = count _config; - -for "_index" from 0 to (_count - 1) do { - _configFile = _config select _index; - _name = format ["ACE_%1", configName _configFile]; - _state = profileNamespace getVariable _name; - - if (isNil "_state" || {_overwrite}) then { - _state = getNumber (_configFile >> "default") == 1; - - profileNamespace setVariable [_name, _state]; - _saveProfile = true; - }; -}; - -if (_overwrite) then { - saveProfileNamespace; - diag_log text "[ACE]: Profile settings overwritten."; -} else { - if (_saveProfile) then { - saveProfileNamespace; - diag_log text "[ACE]: Encountered missing variable in profile namespace. Profile saved."; - } else { - diag_log text "[ACE]: No missing variables encountered in profile namespace."; - }; -}; diff --git a/addons/common/scripts/KeyInput/initKeys.sqf b/addons/common/scripts/KeyInput/initKeys.sqf deleted file mode 100644 index 16db278af7..0000000000 --- a/addons/common/scripts/KeyInput/initKeys.sqf +++ /dev/null @@ -1,72 +0,0 @@ -// by commy2 -#include "script_component.hpp" - -_config = configFile >> "ACE_Default_Keys"; -_count = count _config; - -_header = format ["_keyCode = [_this select 1, _this select 2, _this select 3, _this select 4] call %1; _keyIndex = floor _keyCode; if (_keyIndex == 0) exitWith {false}; if (!(profileNamespace getVariable ['ACE_common_enableNumberHotkeys', true]) && {_keyIndex < 12} && {_keyIndex > 1} && {_keyCode mod 1 == 0}) exitWith {false}; _time = time; _player = ACE_player; _vehicle = vehicle _player; _isInput = false;", QUOTE(FUNC(convertKeyCode))]; -_headerUp = format ["_keyCode = _this select 1; _keyIndex = _keyCode; if (_keyIndex == 0) exitWith {false}; _time = time; _player = ACE_player; _vehicle = vehicle _player;"]; - -_handleDoubleTap = QUOTE(if (_time < (GVAR(keyTimes) select _keyIndex) + 0.5 && {_keyIndex == _keyCode}) then {_keyCode = _keyIndex + 0.8};); -_handleHold = QUOTE(_allowHold = false; _disallowHold = false; if (GVAR(keyStates) select _keyIndex > 1) exitWith {false}; if (GVAR(keyStates) select _keyIndex > 0) then {_keyCode = _keyIndex + 0.9};); -_handleHoldUp = QUOTE(if (GVAR(keyStates) select _keyIndex > 1) then {_keyCode = _keyIndex + 0.9};); - -_debug = format ["if (!isNil 'ACE_Debug' && {'Keys' in ACE_Debug}) then {systemChat (str _keyCode + ' ' + str (%1 select _keyIndex))};", QGVAR(keyStates)]; - -_onKeyDown = "" + _debug; -_onKeyUp = "" + _debug; - -for "_index" from 0 to (_count - 1) do { - _configFile = _config select _index; - - _keyName = configName _configFile; - _condition = getText (_configFile >> "condition"); - if (_condition == "") then {_condition = "true"}; - - _statement = getText (_configFile >> "statement"); - - _exceptions = getArray (_configFile >> "exceptions"); - _canInteract = format [QUOTE(%1 call GVAR(canInteract)), _exceptions]; - - _conditionName = format ["ACE_Key_%1_Condition", _keyName]; - _statementName = format ["ACE_Key_%1_Statement", _keyName]; - missionNamespace setVariable [_conditionName, compileFinal _condition]; - missionNamespace setVariable [_statementName, compileFinal _statement]; - - _handleHolding = ["_disallowHold = true;", "_allowHold = true;"] select (getNumber (_configFile >> "allowHolding") == 1); - - if (_statement != "") then { - _entry = format ["if (_keyCode == profileNamespace getVariable 'ACE_Key_%1' && {call %2}) then {if (%4) then {call %3};%5 _isInput = true;};", _keyName, _conditionName, _statementName, _canInteract, _handleHolding]; - _onKeyDown = _onKeyDown + _entry; - }; - - _condition = getText (_configFile >> "conditionUp"); - if (_condition == "") then {_condition = "true"}; - - _statement = getText (_configFile >> "statementUp"); - - _conditionName = format ["ACE_Key_%1_ConditionUp", _keyName]; - _statementName = format ["ACE_Key_%1_StatementUp", _keyName]; - missionNamespace setVariable [_conditionName, compileFinal _condition]; - missionNamespace setVariable [_statementName, compileFinal _statement]; - - if (_statement != "") then { - _entry = format ["if (_keyCode == floor (profileNamespace getVariable 'ACE_Key_%1') && {call %2}) then {call %3; _isInput = true;};", _keyName, _conditionName, _statementName]; - _onKeyUp = _onKeyUp + _entry; - }; -}; - -_halt = format ["if (!(_allowHold) || {_disallowHold}) then {%1 set [_keyIndex, (%1 select _keyIndex) + 1]; %2 set [_keyIndex, _time];};", QGVAR(keyStates), QGVAR(keyTimes)]; -_haltUp = format ["%1 set [_keyIndex, 0];", QGVAR(keyStates)]; - -//_return = "_isInput"; -_return = "if (profileNamespace getVariable ['ACE_common_enableNumberHotkeys', true] && {_keyIndex < 12} && {_keyIndex > 1}) then {true} else {_isInput}"; - -_repeat = "if (!_isInput && {_keyCode mod 1 > 0.75} && {_keyCode mod 1 < 0.85}) exitWith {_keyCode = _keyIndex; " + _onKeyDown + _return + "};"; -_repeatUp = "if (!_isInput && {_keyCode mod 1 > 0.75} && {_keyCode mod 1 < 0.85}) exitWith {_keyCode = _keyIndex; " + _onKeyUp + "};"; - -_onKeyDown = _header + _handleDoubleTap + _handleHold + _onKeyDown + _halt + _repeat + _return; -_onKeyUp = _headerUp + _onKeyUp + _haltUp + _repeatUp; //_headerUp + _handleHoldUp + _onKeyUp + _haltUp + _repeatUp; - -GVAR(onKeyDown) = compileFinal _onKeyDown; -GVAR(onKeyUp) = compileFinal _onKeyUp; diff --git a/addons/common/scripts/KeyInput/script_component.hpp b/addons/common/scripts/KeyInput/script_component.hpp deleted file mode 100644 index 23da62b05c..0000000000 --- a/addons/common/scripts/KeyInput/script_component.hpp +++ /dev/null @@ -1 +0,0 @@ -#include "\z\ace\addons\common\script_component.hpp" \ No newline at end of file diff --git a/addons/common/scripts/closeMenu.sqf b/addons/common/scripts/closeMenu.sqf deleted file mode 100644 index 86206f2c93..0000000000 --- a/addons/common/scripts/closeMenu.sqf +++ /dev/null @@ -1,5 +0,0 @@ -// by commy2 -#include "script_component.hpp" - -closeDialog 0; -[localize QUOTE(DOUBLES(STR,GVAR(ProfileNotSaved)))] call FUNC(displayTextStructured); diff --git a/addons/common/scripts/editKey.sqf b/addons/common/scripts/editKey.sqf deleted file mode 100644 index a2335f3860..0000000000 --- a/addons/common/scripts/editKey.sqf +++ /dev/null @@ -1,115 +0,0 @@ -// by commy2 -#include "script_component.hpp" - -#define GRAY [0.25, 0.25, 0.25, 1] -#define WHITE [1, 1, 1, 1] -#define OFFSET_1 100 -#define OFFSET_2 200 - -waitUntil {isNil QGVAR(keyNewTemp)}; -GVAR(keyNewTemp) = []; - -GVAR(keySet) = 0; -_index = count GVAR(keyNew); - -disableSerialization; -_dlgMenuDialog = uiNamespace getVariable QGVAR(MenuDialog); -_ctrlMenuDialog = _dlgMenuDialog displayCtrl (OFFSET_2 + (_this select 0)); -_action = GVAR(keyNames) select (_this select 0); -_displayName = getText (configFile >> QGVAR(Default_Keys) >> _action >> "displayName"); - -_keyCode = profileNamespace getVariable [format ["ACE_Key_%1", _action], 0];// -for "_index1" from 0 to (count GVAR(keyNew) - 1) do { - if (_action == (GVAR(keyNew) select _index1) select 0) then { - _keyCode = (GVAR(keyNew) select _index1) select 1; - } -}; -(_dlgMenuDialog displayCtrl 24) ctrlSetText ([_keyCode] call FUNC(revertKeyCodeLocalized));//""; -/*(_dlgMenuDialog displayCtrl 21) ctrlSetTextColor GRAY; -(_dlgMenuDialog displayCtrl 22) ctrlSetTextColor GRAY; -(_dlgMenuDialog displayCtrl 23) ctrlSetTextColor GRAY;*/ - -for "_index1" from 20 to 32 do {(_dlgMenuDialog displayCtrl _index1) ctrlShow true}; -for "_index1" from 10 to 13 do {(_dlgMenuDialog displayCtrl _index1) ctrlEnable false}; - -(_dlgMenuDialog displayCtrl 30) ctrlSetText _displayName; - -GVAR(keysetDefault) = compile format [ - "_configFile = configFile >> 'ACE_Default_Keys' >> '%1'; - _key = getNumber (_configFile >> 'Key'); - _shft = getNumber (_configFile >> 'Shift') == 1; - _ctrl = getNumber (_configFile >> 'Control') == 1; - _alt = getNumber (_configFile >> 'Alt') == 1; - - _keyCode = [_key, _shft, _ctrl, _alt] call %2; - - %3 = [_key, [_shft, _ctrl, _alt], _keyCode];", - _action, - QFUNC(convertKeyCode), - QGVAR(keyNewTemp) -]; - -_description = ctrlText _ctrlMenuDialog; -//_ctrlMenuDialog ctrlSetText ".."; - -_ehid_keydown = _dlgMenuDialog displayAddEventHandler ["KeyDown", QUOTE( _this call GVAR(keyInput) )]; -_ehid_keyup = _dlgMenuDialog displayAddEventHandler ["KeyUp", QUOTE( _this call GVAR(keyRelease) )]; - -waitUntil { - if (count GVAR(keyNewTemp) > 0) then { - _key = GVAR(keyNewTemp) select 0; - _keyModifier = GVAR(keyNewTemp) select 1; - //_keyCode = round (10 * ((GVAR(keyNewTemp) select 2) % 1)); - _keyCode = GVAR(keyNewTemp) select 2; - - (_dlgMenuDialog displayCtrl 24) ctrlSetText ([_keyCode] call FUNC(revertKeyCodeLocalized)); - - /*_key = toString (toArray (keyName _key) - [34]); - - switch (_keyCode) do { - case 8 : { - (_dlgMenuDialog displayCtrl 24) ctrlSetText format [localize QUOTE(DOUBLES(STR,GVAR(DoubleTapKey))), _key]; - - (_dlgMenuDialog displayCtrl 21) ctrlSetTextColor GRAY; - (_dlgMenuDialog displayCtrl 22) ctrlSetTextColor GRAY; - (_dlgMenuDialog displayCtrl 23) ctrlSetTextColor GRAY; - }; - case 9 : { - (_dlgMenuDialog displayCtrl 24) ctrlSetText format [localize QUOTE(DOUBLES(STR,GVAR(HoldKey))), _key]; - - (_dlgMenuDialog displayCtrl 21) ctrlSetTextColor GRAY; - (_dlgMenuDialog displayCtrl 22) ctrlSetTextColor GRAY; - (_dlgMenuDialog displayCtrl 23) ctrlSetTextColor GRAY; - }; - default { - (_dlgMenuDialog displayCtrl 24) ctrlSetText _key; - - (_dlgMenuDialog displayCtrl 21) ctrlSetTextColor ([GRAY, WHITE] select (_keyModifier select 0)); - (_dlgMenuDialog displayCtrl 22) ctrlSetTextColor ([GRAY, WHITE] select (_keyModifier select 1)); - (_dlgMenuDialog displayCtrl 23) ctrlSetTextColor ([GRAY, WHITE] select (_keyModifier select 2)); - }; - };*/ - }; - GVAR(keySet) != 0 || - {!dialog} -}; - -for "_index1" from 10 to 13 do {(_dlgMenuDialog displayCtrl _index1) ctrlEnable true}; -for "_index1" from 20 to 32 do {(_dlgMenuDialog displayCtrl _index1) ctrlShow false}; - -_dlgMenuDialog displayRemoveEventHandler ["KeyDown", _ehid_keydown]; -_dlgMenuDialog displayRemoveEventHandler ["KeyUp", _ehid_keyup]; - -if (GVAR(keySet) == 1 && {count GVAR(keyNewTemp) > 0}) then { - _keyCode = GVAR(keyNewTemp) select 2; - _description = [_keyCode] call FUNC(revertKeyCodeLocalized); - _ctrlMenuDialog ctrlSetText _description; - - GVAR(keyNew) set [_index, [_action, _keyCode]]; -} else { - _ctrlMenuDialog ctrlSetText _description; -}; - -GVAR(keySet) = -1; -GVAR(keyNewTemp) = nil; -GVAR(keysetDefault) = nil; diff --git a/addons/common/scripts/KeyInput/initCanInteractFunction.sqf b/addons/common/scripts/initCanInteractFunction.sqf similarity index 100% rename from addons/common/scripts/KeyInput/initCanInteractFunction.sqf rename to addons/common/scripts/initCanInteractFunction.sqf diff --git a/addons/common/scripts/KeyInput/initScrollWheel.sqf b/addons/common/scripts/initScrollWheel.sqf similarity index 100% rename from addons/common/scripts/KeyInput/initScrollWheel.sqf rename to addons/common/scripts/initScrollWheel.sqf diff --git a/addons/common/scripts/keyInput.sqf b/addons/common/scripts/keyInput.sqf deleted file mode 100644 index 5e06d23bd5..0000000000 --- a/addons/common/scripts/keyInput.sqf +++ /dev/null @@ -1,26 +0,0 @@ -// by commy2 -#include "script_component.hpp" - -#define FORBIDDEN_KEYS [42, 54, 29, 157, 56, 184, 0, 183, 197, 1] - -_key = _this select 1; -_shft = _this select 2; -_ctrl = _this select 3; -_alt =_this select 4; - -if (_key in FORBIDDEN_KEYS) exitWith {true}; - -_keyCode = [_key, _shft, _ctrl, _alt] call FUNC(convertKeyCode); - -_keyIndex = floor _keyCode; -_time = time; - -if (_time < (GVAR(keyTimes) select _keyIndex) + 0.5 && {_keyIndex == _keyCode}) then {_keyCode = _keyIndex + 0.8}; -if (GVAR(keyStates) select _keyIndex > 1) exitWith {true}; -if (GVAR(keyStates) select _keyIndex > 0 && {_keyIndex == _keyCode}) then {_keyCode = _keyIndex + 0.9}; - -GVAR(keyStates) set [_keyIndex, (GVAR(keyStates) select _keyIndex) + 1]; -GVAR(keyTimes) set [_keyIndex, _time]; - -GVAR(keyNewTemp) = [_key, [_shft, _ctrl, _alt], _keyCode]; -true diff --git a/addons/common/scripts/keyRelease.sqf b/addons/common/scripts/keyRelease.sqf deleted file mode 100644 index d0d1b736a0..0000000000 --- a/addons/common/scripts/keyRelease.sqf +++ /dev/null @@ -1,6 +0,0 @@ -// by commy2 -#include "script_component.hpp" - -_keyIndex = _this select 1; - -GVAR(keyStates) set [_keyIndex, 0]; diff --git a/addons/common/scripts/nextKeys.sqf b/addons/common/scripts/nextKeys.sqf deleted file mode 100644 index 51c41b94b9..0000000000 --- a/addons/common/scripts/nextKeys.sqf +++ /dev/null @@ -1,123 +0,0 @@ -// by commy2 -#include "script_component.hpp" - -#define OFFSET_1 100 -#define OFFSET_2 200 -#define OFFSET_3 300 -#define OFFSET_4 400 -#define OFFSET_5 500 - -_config = configFile >> "ACE_Default_Keys"; -_count = count _config; - -_countPages = ceil (_count / 20) + 1; - -GVAR(MenuPage) = GVAR(MenuPage) + ([-1, 1] select _this); - -if (GVAR(MenuPage) == - 1) then {GVAR(MenuPage) = _countPages - 1}; -if (GVAR(MenuPage) > _countPages - 1) then {GVAR(MenuPage) = 0}; - -disableSerialization; -_dlgMenuDialog = uiNamespace getVariable QGVAR(MenuDialog); - -(_dlgMenuDialog displayCtrl 14) ctrlSetText format ["%1/%2", GVAR(MenuPage) + 1, _countPages]; - -if (GVAR(MenuPage) == _countPages - 1) then { - for "_index" from OFFSET_1 to (OFFSET_1 + 19) do {(_dlgMenuDialog displayCtrl _index) ctrlShow false}; - for "_index" from OFFSET_2 to (OFFSET_2 + 19) do {(_dlgMenuDialog displayCtrl _index) ctrlShow false}; - - _config = configFile >> "ACE_Options"; - _count = count _config; - - _offset = 0; - - for "_index" from 0 to (_count - 1 min 19) do { - _configFile = _config select _index + _offset; - _configName = configName _configFile; - _displayName = getText (_configFile >> "displayName"); - _state = profileNamespace getVariable format ["ACE_%1", _configName]; - - _control1 = _dlgMenuDialog displayCtrl (OFFSET_3 + _index); - _control2 = _dlgMenuDialog displayCtrl (OFFSET_4 + _index); - _control3 = _dlgMenuDialog displayCtrl (OFFSET_5 + _index); - - _control1 ctrlSetText format [QUOTE(PATHTOF(UI\box_%1checked_ca.paa)), ["un", ""] select _state]; - _control2 ctrlSetText _displayName; - - _control1 ctrlShow true; - _control2 ctrlShow true; - _control3 ctrlShow true; - - GVAR(OptionNames) set [_index, _configName]; - }; - - for "_index" from _count to (_count + 19) do { - _control1 = _dlgMenuDialog displayCtrl (OFFSET_3 + _index); - _control2 = _dlgMenuDialog displayCtrl (OFFSET_4 + _index); - _control3 = _dlgMenuDialog displayCtrl (OFFSET_5 + _index); - - _control1 ctrlShow false; - _control2 ctrlShow false; - _control3 ctrlShow false; - }; - -} else { - for "_index" from OFFSET_3 to (OFFSET_3 + 19) do {(_dlgMenuDialog displayCtrl _index) ctrlShow false}; - for "_index" from OFFSET_4 to (OFFSET_4 + 19) do {(_dlgMenuDialog displayCtrl _index) ctrlShow false}; - for "_index" from OFFSET_5 to (OFFSET_5 + 19) do {(_dlgMenuDialog displayCtrl _index) ctrlShow false}; - - _offset = 20 * GVAR(MenuPage); - if (GVAR(MenuPage) == _countPages - 2) then { - _count = (_count - 1) % 20 + 1; - }; - - _updateNames = []; - _updateKeys = []; - { - _keyName = _x select 0; - _keyInput = _x select 1; - - _index = _updateNames find _keyName; - if (_index == -1) then {_index = count _updateKeys}; - - _updateNames set [_index, _keyName]; - _updateKeys set [_index, _keyInput]; - } forEach GVAR(keyNew); - - for "_index" from 0 to (_count - 1 min 19) do { - _configFile = _config select _index + _offset; - _keyName = configName _configFile; - _displayName = getText (_configFile >> "displayName"); - _isDisabled = getNumber (_configFile >> "disabled") == 1; - - _indexUpdate = _updateNames find _keyName; - _keyCode = if (_indexUpdate == -1) then { - profileNamespace getVariable format ["ACE_Key_%1", _keyName]; - } else { - _updateKeys select _indexUpdate; - }; - - _description = [_keyCode] call FUNC(revertKeyCodeLocalized); - - _control1 = _dlgMenuDialog displayCtrl (OFFSET_1 + _index); - _control2 = _dlgMenuDialog displayCtrl (OFFSET_2 + _index); - - _control1 ctrlSetText _displayName; - _control2 ctrlSetText _description; - - _control1 ctrlShow true; - _control2 ctrlShow true; - - GVAR(keyNames) set [_index, _keyName]; - }; - - for "_index" from _count to (_count + 19) do { - _control1 = _dlgMenuDialog displayCtrl (OFFSET_1 + _index); - _control2 = _dlgMenuDialog displayCtrl (OFFSET_2 + _index); - - _control1 ctrlShow false; - _control2 ctrlShow false; - }; - - GVAR(keySet) = -1; -}; diff --git a/addons/common/scripts/openMenu.sqf b/addons/common/scripts/openMenu.sqf deleted file mode 100644 index b93119be5f..0000000000 --- a/addons/common/scripts/openMenu.sqf +++ /dev/null @@ -1,100 +0,0 @@ -// by commy2 -#include "script_component.hpp" - -#define OFFSET_1 100 -#define OFFSET_2 200 - -closeDialog 0; -createDialog QGVAR(OptionsMenu_Dialog); - -GVAR(keyNew) = []; -GVAR(keySet) = -1; -GVAR(keySave) = 0; -GVAR(keyNames) = []; -GVAR(MenuPage) = 0; -GVAR(OptionNames) = []; -GVAR(OptionNamesNew) = []; -GVAR(OptionStatesNew) = []; - -disableSerialization; -_dlgMenuDialog = uiNamespace getVariable QGVAR(MenuDialog); - -_ehid_keydown = _dlgMenuDialog displayAddEventHandler ["KeyDown", "_this select 1 > 1"]; -_ehid_keyup = _dlgMenuDialog displayAddEventHandler ["KeyUp", "_this select 1 > 1"]; - -_config = configFile >> "ACE_Default_Keys"; -_count = count _config; - -_countPages = ceil (_count / 20) + 1; -(_dlgMenuDialog displayCtrl 14) ctrlSetText format ["%1/%2", GVAR(MenuPage) + 1, _countPages]; - -for "_index" from 0 to (_count - 1 min 19) do { - _configFile = _config select _index; - _keyName = configName _configFile; - _displayName = getText (_configFile >> "displayName"); - _isDisabled = getNumber (_configFile >> "disabled") == 1; - - _keyCode = profileNamespace getVariable format ["ACE_Key_%1", _keyName]; - _description = [_keyCode] call FUNC(revertKeyCodeLocalized); - - _control1 = _dlgMenuDialog displayCtrl (OFFSET_1 + _index); - _control2 = _dlgMenuDialog displayCtrl (OFFSET_2 + _index); - - _control1 ctrlSetText _displayName; - _control2 ctrlSetText _description; - - _control1 ctrlShow true; - _control2 ctrlShow true; - - GVAR(keyNames) set [_index, _keyName]; -}; - -for "_index" from _count to 19 do { - _control1 = _dlgMenuDialog displayCtrl (OFFSET_1 + _index); - _control2 = _dlgMenuDialog displayCtrl (OFFSET_2 + _index); - - _control1 ctrlShow false; - _control2 ctrlShow false; -}; - -waitUntil {!dialog}; - -_dlgMenuDialog displayRemoveEventHandler ["KeyDown", _ehid_keydown]; -_dlgMenuDialog displayRemoveEventHandler ["KeyUp", _ehid_keyup]; - -if (GVAR(keySave) == 1) then { - _count0 = count GVAR(keyNew); - - for "_index" from 0 to (_count0 - 1) do { - _key = GVAR(keyNew) select _index; - _keyName = _key select 0; - _keyCode = _key select 1; - - profileNamespace setVariable [format ["ACE_Key_%1", _keyName], _keyCode]; - }; - - _count1 = count GVAR(OptionNamesNew); - - for "_index" from 0 to (_count1 - 1) do { - _name = GVAR(OptionNamesNew) select _index; - _state = GVAR(OptionStatesNew) select _index; - - profileNamespace setVariable [_name, _state]; - }; - - if (_count0 > 0 || {_count1 > 0}) then { - saveProfileNamespace; - [localize QUOTE(DOUBLES(STR,GVAR(ProfileSaved)))] call FUNC(displayTextStructured); - } else { - [localize QUOTE(DOUBLES(STR,GVAR(ProfileNotSaved)))] call FUNC(displayTextStructured); - }; -} else { - [localize QUOTE(DOUBLES(STR,GVAR(ProfileNotSaved)))] call FUNC(displayTextStructured); -}; - -GVAR(keyNewTemp) = nil; -GVAR(keyNames) = nil; -GVAR(MenuPage) = nil; -GVAR(OptionNames) = nil; -GVAR(OptionNamesNew) = nil; -GVAR(OptionStatesNew) = nil; diff --git a/addons/common/scripts/toggleState.sqf b/addons/common/scripts/toggleState.sqf deleted file mode 100644 index 58e59e851a..0000000000 --- a/addons/common/scripts/toggleState.sqf +++ /dev/null @@ -1,18 +0,0 @@ -// by commy2 -#include "script_component.hpp" - -_index = _this select 0; - -_name = format ["ACE_%1", GVAR(OptionNames) select _index]; - -_index1 = GVAR(OptionNamesNew) find _name; -_state = if (_index1 == -1) then {_index1 = count GVAR(OptionNamesNew); !(profileNamespace getVariable _name)} else {!(GVAR(OptionStatesNew) select _index1)}; - -disableSerialization; -_dlgMenuDialog = uiNamespace getVariable QGVAR(MenuDialog); - -_control = _dlgMenuDialog displayCtrl (300 + _index); -_control ctrlSetText format [QUOTE(PATHTOF(UI\box_%1checked_ca.paa)), ["un", ""] select _state]; - -GVAR(OptionNamesNew) set [_index1, _name]; -GVAR(OptionStatesNew) set [_index1, _state]; diff --git a/addons/common/stringtable.xml b/addons/common/stringtable.xml index dfb200dff8..f2d944eb7a 100644 --- a/addons/common/stringtable.xml +++ b/addons/common/stringtable.xml @@ -50,150 +50,6 @@ ACE Opciók Opzioni ACE - - Shift - Umschalt - Shift - Shift - Shift - Shift - Shift - Shift - Shift - Shift - - - Ctrl - Strg - Ctrl - Ctrl - Ctrl - Ctrl - Ctrl - Ctrl - Ctrl - Ctrl - - - Alt - Alt - Alt - Alt - Alt - Alt - Alt - Alt - Alt - Alt - - - Shift right - Umschalt rechts - Shift derecho - Prawy Shift - Pravý Shift - Shift Droite - Правый Shift - Shift da Direita - Jobb Shift - Shift destro - - - Ctrl right - Strg rechts - Ctrl derecho - Prawy Ctrl - Pravý Ctrl - Ctrl Droite - Правый Ctrl - Ctrl da Direita - Jobb Ctrl - Ctrl destro - - - Alt right - Alt Gr - Alt derecho - Prawy Alt - Pravý Alt - Alt Droite - Правый Alt - Alt da Direita - Alt Gr - Alt Gr - - - Default - Standard - Por defecto - Domyślne - Výchozí - Défaut - По умолчанию - Padrão - Alapértelmezett - Standard - - - None - Keiner - Ninguna - Brak - Žádný - Aucun - Не назначено - Nenhuma - Semmi - Non assegnato - - - 2x %1 - 2x %1 - 2x %1 - 2x %1 - 2x %1 - 2x %1 - 2x %1 - 2x %1 - 2x %1 - 2x %1 - - - Hold %1 - %1 halten - Mantener %1 - Przytrzymać %1 - Držet %1 - Tenir %1 - Удерживая %1 - Segurar %1 - %1 Nyomvatartása - Tieni premuto %1 - - - Profile saved - Profil gespeichert - Perfil guardado - Profil zapisany - Profil uložen - Profil sauvegardé - Профиль сохранен - Perfil salvo - Profil elmentve - Profilo salvato - - - Profile not saved - Profil nicht gespeichert - Perfil no guardado - Profil niezapisany - Profil neuložen - Profil non sauvegardé - Профиль не сохранен - Perfil não salvo - A profil nincs elmentve - Profilo non salvato - N @@ -399,30 +255,6 @@ Művelet megszakítva. Azione cancellata. - - < Prev - < Zurück - < Anterior. - < Poprzedni - < Předchozí - < Préc - < Пред. - < Anterior - < Előző - < Prec - - - Next > - Weiter > - Siguiente > - Następny > - Další > - Suivant > - След. > - Próximo > - Következő > - Prossimo > - [ACE] Miscellaneous Items [ACE] Verschiedenes diff --git a/addons/interaction/functions/fnc_initialiseInteraction.sqf b/addons/interaction/functions/fnc_initialiseInteraction.sqf index f0ca6e85e6..2637d28bf9 100644 --- a/addons/interaction/functions/fnc_initialiseInteraction.sqf +++ b/addons/interaction/functions/fnc_initialiseInteraction.sqf @@ -59,8 +59,8 @@ if (_this select 2) then { (findDisplay 46) createDisplay QGVAR(Dialog); // Add eventhandlers - (findDisplay 1713999) displayAddEventHandler ["KeyDown", QUOTE(_this call EGVAR(common,onKeyDown))]; - (findDisplay 1713999) displayAddEventHandler ["KeyUp", QUOTE(_this call EGVAR(common,onKeyUp))]; + /*(findDisplay 1713999) displayAddEventHandler ["KeyDown", QUOTE(_this call EGVAR(common,onKeyDown))]; + (findDisplay 1713999) displayAddEventHandler ["KeyUp", QUOTE(_this call EGVAR(common,onKeyUp))];*/ (findDisplay 1713999) displayAddEventHandler ["KeyDown", QUOTE(_this call FUNC(menuKeyInput))]; };