-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
110 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 {}; | ||
}; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"; | ||
}; | ||
} | ||
}; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 ["<t color='%2' size='0.8' valign='middle'>[HOLD]</t> %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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// This file just exists, so that the CfgFunction file overwrite wörks | ||
|
||
#include "\A3\functions_f\HoldActions\fn_holdActionRemove.sqf" |
23 changes: 23 additions & 0 deletions
23
addons/defaultactionicon/functions/fn_showHoldActionProgress.sqf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 ["<t size='0.8'>%1</t>", _image]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#include "..\script_component.hpp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
#include "\x\grad_minui\addons\main\script_mod.hpp" | ||
#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) |