From e2a822c82829168a37cd8d72496fe7dbaab4e6ae Mon Sep 17 00:00:00 2001 From: jonpas Date: Thu, 5 May 2022 00:28:32 +0200 Subject: [PATCH] User Interface - Add ability to hide Default Action Icon (#8883) --- addons/ui/CfgInGameUI.hpp | 5 +++++ addons/ui/config.cpp | 1 + addons/ui/initSettings.sqf | 15 ++++++++++++++- addons/ui/stringtable.xml | 6 ++++++ 4 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 addons/ui/CfgInGameUI.hpp diff --git a/addons/ui/CfgInGameUI.hpp b/addons/ui/CfgInGameUI.hpp new file mode 100644 index 0000000000..b9a1c447dc --- /dev/null +++ b/addons/ui/CfgInGameUI.hpp @@ -0,0 +1,5 @@ +class CfgInGameUI { + class DefaultAction { + size = QUOTE(profileNamespace getVariable [ARR_2('GVAR(hideDefaultActionIcon)', (((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8))]); + }; +}; diff --git a/addons/ui/config.cpp b/addons/ui/config.cpp index 6dfeba4cfb..0a04e1fccb 100644 --- a/addons/ui/config.cpp +++ b/addons/ui/config.cpp @@ -15,6 +15,7 @@ class CfgPatches { }; #include "CfgEventHandlers.hpp" +#include "CfgInGameUI.hpp" #include "CfgVehicles.hpp" #include "ACE_Settings.hpp" #include "ACE_UI.hpp" diff --git a/addons/ui/initSettings.sqf b/addons/ui/initSettings.sqf index 55160a7888..dc701b91d5 100644 --- a/addons/ui/initSettings.sqf +++ b/addons/ui/initSettings.sqf @@ -294,7 +294,7 @@ if (productVersion select 4 == 'Development') then { QGVAR(enableSpeedIndicator), "CHECKBOX", [LSTRING(EnableSpeedIndicator), LSTRING(EnableSpeedIndicator_Description)], - "ACE " + LLSTRING(Category), + _category, true, true, { if (!_this) then { @@ -303,3 +303,16 @@ if (productVersion select 4 == 'Development') then { }; } ] call CBA_fnc_addSetting; + +[ + QGVAR(hideDefaultActionIcon), + "CHECKBOX", + [LSTRING(HideDefaultActionIcon), LSTRING(HideDefaultActionIcon_Description)], + _category, + false, + 2, { + profileNamespace setVariable [QGVAR(hideDefaultActionIcon), [nil, 0] select _this]; + saveProfileNamespace; + }, + true // needs restart +] call CBA_fnc_addSetting; diff --git a/addons/ui/stringtable.xml b/addons/ui/stringtable.xml index 6c134a4068..d468cf0c33 100644 --- a/addons/ui/stringtable.xml +++ b/addons/ui/stringtable.xml @@ -688,5 +688,11 @@ 为玩家角色启用移动速度指示器。 플레이어 캐릭터를 위한 이동속도 표시기를 활성화 합니다. + + Hide Default Action Icon + + + Hides the icon shown automatically when something is in front of the cursor. Requires a game restart.\nWarning: Does not remove the action itself! It is advisable to unbind 'Use default action' key to prevent unwanted interactions. +