diff --git a/addons/finger/ACE_Settings.hpp b/addons/finger/ACE_Settings.hpp index e07a11555e..97bbdfa48b 100644 --- a/addons/finger/ACE_Settings.hpp +++ b/addons/finger/ACE_Settings.hpp @@ -1,18 +1,16 @@ class ACE_Settings { - class GVAR(canFingerEachOther) { - typeName = "BOOL"; - value = 1; - }; class GVAR(maxRange) { - typeName = "SCALAR"; value = 4; + typeName = "SCALAR"; + displayName = CSTRING(maxRange_displayName); + description = CSTRING(maxRange_description); }; class GVAR(indicatorForSelf) { + value = 1; + typeName = "BOOL"; + isClientSettable = 1; displayName = CSTRING(indicatorForSelf_name); description = CSTRING(indicatorForSelf_description); - isClientSettable = 1; - typeName = "BOOL"; - value = 1; }; class GVAR(indicatorColor) { value[] = {0.83, 0.68, 0.21, 0.75}; diff --git a/addons/finger/CfgVehicles.hpp b/addons/finger/CfgVehicles.hpp new file mode 100644 index 0000000000..05860368c9 --- /dev/null +++ b/addons/finger/CfgVehicles.hpp @@ -0,0 +1,20 @@ +class CfgVehicles { + class ACE_Module; + class GVAR(moduleSettings): ACE_Module { + scope = 2; + category = "ACE"; + displayName = CSTRING(moduleSettings_displayName); + icon = QUOTE(PATHTOF(UI\Icon_Module_finger_ca.paa)); + function = QFUNC(moduleSettings); + isGlobal = 0; + author = ECSTRING(common,ACETeam); + class Arguments { + class maxRange { + displayName = CSTRING(maxRange_displayName); + description = CSTRING(maxRange_description); + typeName = "NUMBER"; + defaultValue = 4; + }; + }; + }; +}; diff --git a/addons/finger/XEH_postInit.sqf b/addons/finger/XEH_postInit.sqf index 98b4f8c9db..f3f60cbe8e 100644 --- a/addons/finger/XEH_postInit.sqf +++ b/addons/finger/XEH_postInit.sqf @@ -1,7 +1,5 @@ #include "script_component.hpp" -[QGVAR(fingered), {_this call FUNC(incomingFinger)}] call EFUNC(common,addEventHandler); - if (!hasInterface) exitWith {}; GVAR(lastFPTime) = -1; @@ -9,9 +7,11 @@ GVAR(fingersHash) = HASH_CREATE; GVAR(pfeh_id) = -1; ["SettingsInitialized", { - //If not enabled, dont't bother adding keybind - if (!GVAR(canFingerEachOther)) exitWith {}; + //If not enabled, dont't bother adding keybind or eventhandler + if (GVAR(maxRange) <= 0) exitWith {}; + [QGVAR(fingered), {_this call FUNC(incomingFinger)}] call EFUNC(common,addEventHandler); + ["ACE3 Common", QGVAR(finger), [(localize LSTRING(keyComb)), (localize LSTRING(keyComb_description))], diff --git a/addons/finger/XEH_preInit.sqf b/addons/finger/XEH_preInit.sqf index f8ff9da03d..e7e68cf8ec 100644 --- a/addons/finger/XEH_preInit.sqf +++ b/addons/finger/XEH_preInit.sqf @@ -4,6 +4,7 @@ ADDON = false; PREP(incomingFinger); PREP(keyPress); +PREP(moduleSettings); PREP(perFrameEH); ADDON = true; diff --git a/addons/finger/config.cpp b/addons/finger/config.cpp index 46e8c05dc2..2cc3be5ddd 100644 --- a/addons/finger/config.cpp +++ b/addons/finger/config.cpp @@ -1,18 +1,18 @@ #include "script_component.hpp" -#define RECOMPILE 0 - class CfgPatches { - class ace_finger { - units[]={}; - weapons[]={}; - requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"ace_common"}; - author[]= {"Drill"}; + class ADDON { + units[] = {QGVAR(moduleSettings)}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_common"}; + author[] = {"Drill"}; authorUrl = "https://github.com/TheDrill/"; VERSION_CONFIG; }; }; + #include "ACE_Settings.hpp" #include "CfgEventHandlers.hpp" +#include "CfgVehicles.hpp" diff --git a/addons/finger/functions/fnc_keyPress.sqf b/addons/finger/functions/fnc_keyPress.sqf index c367a5929b..97b746e967 100644 --- a/addons/finger/functions/fnc_keyPress.sqf +++ b/addons/finger/functions/fnc_keyPress.sqf @@ -1,5 +1,5 @@ /* - * Author: TheDrill + * Author: TheDrill, PabstMirror * On keypress, point and send position to nearby players * * Arguments: diff --git a/addons/finger/functions/fnc_moduleSettings.sqf b/addons/finger/functions/fnc_moduleSettings.sqf new file mode 100644 index 0000000000..47673bf450 --- /dev/null +++ b/addons/finger/functions/fnc_moduleSettings.sqf @@ -0,0 +1,20 @@ +/* + * Author: PabstMirror + * Module for fingering settings + * + * Arguments: + * 0: The module logic + * + * Return Value: + * None + * + * Public: No + */ + +#include "script_component.hpp" + +PARAMS_1(_logic); + +if !(isServer) exitWith {}; + +[_logic, QGVAR(maxRange), "maxRange"] call EFUNC(common,readSettingFromModule); diff --git a/addons/finger/functions/fnc_perFrameEH.sqf b/addons/finger/functions/fnc_perFrameEH.sqf index b05846b4b9..7b6b937827 100644 --- a/addons/finger/functions/fnc_perFrameEH.sqf +++ b/addons/finger/functions/fnc_perFrameEH.sqf @@ -40,7 +40,7 @@ _iconSize = BASE_SIZE * _fovCorrection; _drawColor set [3, ((_drawColor select 3) * (_timeLeftToShow / 0.5))]; }; - drawIcon3D [FP_ICON, _drawColor, _pos, _iconSize, _iconSize, 0, _name, 1, 0.03, "PuristaMedium"]; + drawIcon3D [QUOTE(PATHTOF(UI\fp_icon.paa)), _drawColor, _pos, _iconSize, _iconSize, 0, _name, 1, 0.03, "PuristaMedium"]; }; } forEach (GVAR(fingersHash) select 0); diff --git a/addons/finger/script_component.hpp b/addons/finger/script_component.hpp index 321e35498c..ae96943943 100644 --- a/addons/finger/script_component.hpp +++ b/addons/finger/script_component.hpp @@ -1,5 +1,5 @@ #define COMPONENT finger -#include "\z\ace\Addons\main\script_mod.hpp" +#include "\z\ace\addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_FINGER #define DEBUG_MODE_FULL @@ -9,10 +9,9 @@ #define DEBUG_SETTINGS DEBUG_SETTINGS_FINGER #endif -#include "\z\ace\Addons\main\script_macros.hpp" +#include "\z\ace\addons\main\script_macros.hpp" #define BASE_SIZE 44 -#define FP_ICON "\z\ace\addons\finger\img\fp_icon.paa" #define FP_TIMEOUT 2 #define FP_ACTION_TIMEOUT 1 diff --git a/addons/finger/stringtable.xml b/addons/finger/stringtable.xml index d16d6b4294..3f1a31103c 100644 --- a/addons/finger/stringtable.xml +++ b/addons/finger/stringtable.xml @@ -22,7 +22,20 @@ Действие "показать пальцем на" - Shows a virtual marker of where you are pointing to nearby units. + Points, and shows a virtual marker of where you are looking to nearby units. + + + Finger Settings + + + Finger Max Range + + + How far away players can finger each other. Set to 0 to disable fingering. [default: 4] + + + Finger indicator + Пальце-индикатор diff --git a/addons/finger/ui/Icon_Module_finger_ca.paa b/addons/finger/ui/Icon_Module_finger_ca.paa new file mode 100644 index 0000000000..2d8de25b9b Binary files /dev/null and b/addons/finger/ui/Icon_Module_finger_ca.paa differ diff --git a/addons/finger/img/fp_icon.paa b/addons/finger/ui/fp_icon.paa similarity index 100% rename from addons/finger/img/fp_icon.paa rename to addons/finger/ui/fp_icon.paa