diff --git a/addons/defaultactionicon/CfgFunctions.hpp b/addons/defaultactionicon/CfgFunctions.hpp
new file mode 100644
index 0000000..2ba8b1d
--- /dev/null
+++ b/addons/defaultactionicon/CfgFunctions.hpp
@@ -0,0 +1,14 @@
+class CfgFunctions {
+ class A3 {
+ class HoldActions {
+ file = "x\grad_minui\addons\defaultactionicon\functions";
+ };
+ };
+ class grad_minui {
+ tag="grad_minui";
+ class HoldActions {
+ file = "x\grad_minui\addons\defaultactionicon\functions";
+ class showHoldActionProgress {};
+ };
+ };
+};
\ No newline at end of file
diff --git a/addons/defaultactionicon/RscTitles.hpp b/addons/defaultactionicon/RscTitles.hpp
new file mode 100644
index 0000000..ad4ce44
--- /dev/null
+++ b/addons/defaultactionicon/RscTitles.hpp
@@ -0,0 +1,25 @@
+class ctrlStructuredText;
+
+class RscTitles {
+ class PROGRESS_DISPLAY_CLASS {
+ onLoad = "uiNamespace setVariable ['grad_minui_holdAction_progress',_this select 0];";
+ fadeIn = 0;
+ duration = 200;
+ fadeOut = 0;
+ idd = -1;
+ class controlsBackground {};
+ class controls {
+ class txt: ctrlStructuredText {
+ idc = 1;
+ x = "safezoneX + safezoneW / 2 - 0.1";
+ y = "safezoneY + safezoneH / 2 - 0.1";
+ w = "0.2";
+ h = "safezoneH * 0.5";
+ class Attributes: Attributes {
+ size = 0.8;
+ align = "center";
+ };
+ }
+ };
+ };
+};
diff --git a/addons/defaultactionicon/config.cpp b/addons/defaultactionicon/config.cpp
index 52f350f..b57ef7e 100644
--- a/addons/defaultactionicon/config.cpp
+++ b/addons/defaultactionicon/config.cpp
@@ -5,7 +5,7 @@ class CfgPatches {
units[] = {};
weapons[] = {};
requiredVersion = 0.1;
- requiredAddons[] = {"grad_minui_main", "grad_minui_settings"};
+ requiredAddons[] = {"grad_minui_main", "grad_minui_settings", "A3_Functions_F"};
authors[] = {"DerZade", "Fusselwurm"};
VERSION_CONFIG;
};
@@ -16,3 +16,5 @@ class MOD_CONFIG_CLASS_NAME {
};
#include "ui.hpp"
+#include "RscTitles.hpp"
+#include "CfgFunctions.hpp"
diff --git a/addons/defaultactionicon/functions/fn_holdActionAdd.sqf b/addons/defaultactionicon/functions/fn_holdActionAdd.sqf
new file mode 100644
index 0000000..b861388
--- /dev/null
+++ b/addons/defaultactionicon/functions/fn_holdActionAdd.sqf
@@ -0,0 +1,37 @@
+#include "\A3\functions_f\HoldActions\fn_holdActionAdd.sqf"
+; // This is needed because the original function does not include a ; at the end
+
+
+private _iconSize = ["defaultactionicon_size"] call grad_minui_fnc_setting;
+
+if (_iconSize isNotEqualTo 0) exitWith {};
+
+grad_minui_hold_color = [profilenamespace getvariable ['IGUI_WARNING_RGB_R',0.77], profilenamespace getvariable ['IGUI_WARNING_RGB_G',0.51], profilenamespace getvariable ['IGUI_WARNING_RGB_B',0.08]] call BIS_fnc_colorRGBtoHTML;
+
+bis_fnc_holdAction_showIcon = {
+ params [
+ ["_target", objNull, [objNull]],
+ ["_actionID", 0, [123]],
+ ["_title", "", [""]],
+ ["_icon", "", ["", {}]],
+ ["_texSet", TEXTURES_PROGRESS, [[]]],
+ ["_frame", 0, [123]],
+ ["_hint", "", [""]]
+ ];
+
+ if (_icon isEqualType {}) then {
+ _icon = _target call _icon;
+ };
+
+ if (_texSet isEqualTo TEXTURES_PROGRESS) then {
+ [_frame] call grad_minui_fnc_showHoldActionProgress;
+ };
+
+ _target setUserActionText [_actionID, format ["[HOLD] %1", _title, grad_minui_hold_color], "", ""];
+};
+
+// make sure the new function is applied immediately
+[_target, _actionID, _title, _iconIdle, TEXTURES_IDLE, 0] call bis_fnc_holdAction_showIcon;
+
+// return _actionID, like the original function does
+_actionID
diff --git a/addons/defaultactionicon/functions/fn_holdActionRemove.sqf b/addons/defaultactionicon/functions/fn_holdActionRemove.sqf
new file mode 100644
index 0000000..2bef8cb
--- /dev/null
+++ b/addons/defaultactionicon/functions/fn_holdActionRemove.sqf
@@ -0,0 +1,3 @@
+// This file just exists, so that the CfgFunction file overwrite wörks
+
+#include "\A3\functions_f\HoldActions\fn_holdActionRemove.sqf"
diff --git a/addons/defaultactionicon/functions/fn_showHoldActionProgress.sqf b/addons/defaultactionicon/functions/fn_showHoldActionProgress.sqf
new file mode 100644
index 0000000..eb7d50b
--- /dev/null
+++ b/addons/defaultactionicon/functions/fn_showHoldActionProgress.sqf
@@ -0,0 +1,23 @@
+#include "\A3\functions_f\HoldActions\defines.inc"
+#include "script_component.hpp"
+
+params [
+ ["_frame", 0, [123]]
+];
+
+private _display = uiNamespace getVariable [QUOTE(PROGRESS_DISPLAY_CLASS), displayNull];
+
+if ((_frame isEqualTo 0) && !(isNull _display)) exitWith {
+ // the user aborted the hold action, if there already
+ // is a display and we get frame 0 -> close display
+ PROGRESS_DISPLAY_LAYER cutText ["", "PLAIN"];
+};
+
+// create display if it does not exist
+if (isNull _display) then {
+ PROGRESS_DISPLAY_LAYER cutRsc [QUOTE(PROGRESS_DISPLAY_CLASS), "PLAIN"];
+ _display = uiNamespace getVariable QUOTE(PROGRESS_DISPLAY_CLASS);
+};
+
+private _image = TEXTURES_PROGRESS select _frame;
+(_display displayCtrl 1) ctrlSetStructuredText parseText format ["%1", _image];
diff --git a/addons/defaultactionicon/functions/script_component.hpp b/addons/defaultactionicon/functions/script_component.hpp
new file mode 100644
index 0000000..4e2d473
--- /dev/null
+++ b/addons/defaultactionicon/functions/script_component.hpp
@@ -0,0 +1 @@
+#include "..\script_component.hpp"
\ No newline at end of file
diff --git a/addons/defaultactionicon/script_component.hpp b/addons/defaultactionicon/script_component.hpp
index 46e2a55..c1c0679 100644
--- a/addons/defaultactionicon/script_component.hpp
+++ b/addons/defaultactionicon/script_component.hpp
@@ -1 +1,4 @@
-#include "\x\grad_minui\addons\main\script_mod.hpp"
\ No newline at end of file
+#include "\x\grad_minui\addons\main\script_mod.hpp"
+
+#define PROGRESS_DISPLAY_CLASS grad_minui_holdAction_progress
+#define PROGRESS_DISPLAY_LAYER QUOTE(PROGRESS_DISPLAY_CLASS)
\ No newline at end of file