diff --git a/addons/common/config.cpp b/addons/common/config.cpp index 158c4cbead..5356c89987 100644 --- a/addons/common/config.cpp +++ b/addons/common/config.cpp @@ -58,7 +58,7 @@ class ACE_canInteractConditions { }; class ACE_Options { - class enableNumberHotkeys { + class GVAR(enableNumberHotkeys) { displayName = "$STR_ACE_Common_EnableNumberHotkeys"; default = 1; }; diff --git a/addons/common/scripts/KeyInput/initKeys.sqf b/addons/common/scripts/KeyInput/initKeys.sqf index 5097cfd89e..16db278af7 100644 --- a/addons/common/scripts/KeyInput/initKeys.sqf +++ b/addons/common/scripts/KeyInput/initKeys.sqf @@ -4,7 +4,7 @@ _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_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))]; +_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};); @@ -60,7 +60,7 @@ _halt = format ["if (!(_allowHold) || {_disallowHold}) then {%1 set [_keyIndex, _haltUp = format ["%1 set [_keyIndex, 0];", QGVAR(keyStates)]; //_return = "_isInput"; -_return = "if (profileNamespace getVariable ['ACE_enableNumberHotkeys', true] && {_keyIndex < 12} && {_keyIndex > 1}) then {true} else {_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 + "};"; diff --git a/addons/goggles/config.cpp b/addons/goggles/config.cpp index 16bb0f9e0f..f804be003e 100644 --- a/addons/goggles/config.cpp +++ b/addons/goggles/config.cpp @@ -244,7 +244,7 @@ class SniperCloud { }; class ACE_Options { - class showInThirdPerson { + class GVAR(showInThirdPerson) { displayName = $STR_ACE_Goggles_ShowInThirdPerson; default = 0; }; diff --git a/addons/goggles/functions/fnc_externalCamera.sqf b/addons/goggles/functions/fnc_externalCamera.sqf index 66e1ae6b3d..22441e866b 100644 --- a/addons/goggles/functions/fnc_externalCamera.sqf +++ b/addons/goggles/functions/fnc_externalCamera.sqf @@ -16,5 +16,5 @@ call FUNC(ExternalCamera); */ #include "script_component.hpp" -if (GETVAR(profileNamespace,ACE_showInThirdPerson,false)) exitWith { false }; +if (GVAR(showInThirdPerson)) exitWith { false }; (cameraView == "External") diff --git a/addons/hearing/config.cpp b/addons/hearing/config.cpp index 84ae62a01b..708146a89b 100644 --- a/addons/hearing/config.cpp +++ b/addons/hearing/config.cpp @@ -23,7 +23,7 @@ class CfgPatches { #include "CfgAmmo.hpp" class ACE_Options { - class Hearing_DisableEarRinging { + class GVAR(Hearing_DisableEarRinging) { displayName = "$STR_ACE_Hearing_DisableEarRinging"; default = 0; }; diff --git a/addons/nametags/XEH_postInit.sqf b/addons/nametags/XEH_postInit.sqf index 0c5646f54c..c73ec08cfe 100644 --- a/addons/nametags/XEH_postInit.sqf +++ b/addons/nametags/XEH_postInit.sqf @@ -26,17 +26,17 @@ if (!hasInterface) exitWith {}; // Draw handle addMissionEventHandler ["Draw3D", { - if !(profileNamespace getVariable ["ACE_showPlayerNames", true]) exitWith {}; + if (GVAR(showPlayerNames) == 0) exitWith {}; _player = ACE_player; - if (profileNamespace getVariable ["ACE_showPlayerNamesOnlyOnCursor", true]) then { + if (GVAR(showPlayerNames) in [2,4]) then { //only on cursor _target = cursorTarget; _target = if (_target in allUnitsUAV) then {objNull} else {effectiveCommander _target}; if (!isNull _target && {side group _target == playerSide} && {_target != _player} && {isPlayer _target || {GVAR(ShowNamesForAI)}} && {!(_target getVariable ["ACE_hideName", false])}) then { _distance = _player distance _target; _alpha = ((1 - 0.2 * (_distance - GVAR(PlayerNamesViewDistance))) min 1) * GVAR(PlayerNamesMaxAlpha); - if (profileNamespace getVariable ["ACE_showPlayerNamesOnlyOnKeyPress", false]) then { + if ((GVAR(showPlayerNames) in [3,4])) then { //only on keypress _alpha = _alpha min (1 - (time - GVAR(ShowNamesTime) - 1)); }; [_player, _target, _alpha, _distance * 0.026] call FUNC(drawNameTagIcon); @@ -64,7 +64,7 @@ addMissionEventHandler ["Draw3D", { _alpha = ((1 - 0.2 * (_distance - GVAR(PlayerNamesViewDistance))) min (1 - 0.15 * (_projDist * 5 - _distance - 3)) min 1) * GVAR(PlayerNamesMaxAlpha); - if (profileNamespace getVariable ["ACE_showPlayerNamesOnlyOnKeyPress", false]) then { + if ((GVAR(showPlayerNames) in [3,4])) then { //only on keypress _alpha = _alpha min (1 - (time - GVAR(ShowNamesTime) - 1)); }; diff --git a/addons/nametags/config.cpp b/addons/nametags/config.cpp index 391eefca45..1846cd616e 100644 --- a/addons/nametags/config.cpp +++ b/addons/nametags/config.cpp @@ -16,23 +16,16 @@ class CfgPatches { #include "CfgVehicles.hpp" class ACE_Options { - class showPlayerNames { + class GVAR(showPlayerNames) { displayName = "$STR_ACE_NameTags_ShowPlayerNames"; + values[] = {"Disabled", "Enabled", "Only Cursor", "Only On Keypress", "Only Cursor and KeyPress"}; default = 1; }; - class showPlayerNamesOnlyOnCursor { - displayName = "$STR_ACE_NameTags_ShowPlayerNamesOnlyOnCursor"; - default = 1; - }; - class showPlayerNamesOnlyOnKeyPress { - displayName = "$STR_ACE_NameTags_ShowPlayerNamesOnlyOnKeyPress"; - default = 0; - }; - class showPlayerRanks { + class GVAR(showPlayerRanks) { displayName = "$STR_ACE_NameTags_ShowPlayerRanks"; default = 1; }; - class showVehicleCrewInfo { + class GVAR(showVehicleCrewInfo) { displayName = "$STR_ACE_CrewInfo_ShowVehicleCrewInfo"; default = 1; }; diff --git a/addons/nametags/functions/fnc_canShow.sqf b/addons/nametags/functions/fnc_canShow.sqf index 612baac2d3..8b61352def 100644 --- a/addons/nametags/functions/fnc_canShow.sqf +++ b/addons/nametags/functions/fnc_canShow.sqf @@ -22,6 +22,6 @@ _player = ACE_player; vehicle _player != _player && { (GVAR(CrewInfoVisibility) == 1) || - (GVAR(CrewInfoVisibility) != -1 && profileNamespace getVariable ["ACE_showVehicleCrewInfo", false]) + (GVAR(CrewInfoVisibility) != -1 && GVAR(showVehicleCrewInfo)) } && {!(vehicle _player isKindOf "ParachuteBase")}; diff --git a/addons/nametags/functions/fnc_drawNameTagIcon.sqf b/addons/nametags/functions/fnc_drawNameTagIcon.sqf index f2a8a1f946..af3932f118 100644 --- a/addons/nametags/functions/fnc_drawNameTagIcon.sqf +++ b/addons/nametags/functions/fnc_drawNameTagIcon.sqf @@ -47,7 +47,7 @@ _color = if !(group _target == group _player) then { _name = [_target, true] call EFUNC(common,getName); _rank = TEXTURES_RANKS select ((["PRIVATE", "CORPORAL", "SERGEANT", "LIEUTENANT", "CAPTAIN", "MAJOR", "COLONEL"] find rank _target) + 1); -_size = [0, 1] select (profileNamespace getVariable ["ACE_showPlayerRanks", true]); +_size = [0, 1] select GVAR(showPlayerRanks); drawIcon3D [ _rank,