12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- #include "\ClonecTab\shared\cTab_gui_macros.hpp"
- private ["_displayName","_display","_ctrl","_currentTime","_text","_notification","_decayTime"];
- disableSerialization;
- if (isNil "cTabProcessNotificationsPFH" && !(isNil "cTabIfOpen") && count cTabNotificationCache != 0) then {
- _displayName = cTabIfOpen select 1;
- _display = uiNamespace getVariable _displayName;
- _ctrl = _display displayCtrl IDC_CTAB_NOTIFICATION;
-
-
- if (!isNull _ctrl) then {
-
- cTabProcessNotificationsPFH = [{
- private ["_ctrl","_notification","_currentTime","_text"];
-
- if !(isNil "cTabIfOpen") then {
- if (count cTabNotificationCache != 0) then {
-
- _notification = cTabNotificationCache deleteAt 0;
- _decayTime = _notification select 3;
- _currentTime = [] call cTab_fnc_currentTime;
-
- _text = if (_currentTime isEqualTo (_notification select 1)) then {
- format ["%1",_notification select 2];
- } else {
- format ["%1: %2",_notification select 1,_notification select 2];
- };
-
- if ((_notification select 4) > 1) then {
- _text = format ["%1 (x%2)",_text,_notification select 4];
- };
-
-
- _ctrl = _this select 0 select 0;
- _ctrl ctrlSetText _text;
-
- _ctrl ctrlSetFade 0;
- _ctrl ctrlCommit 0;
- _ctrl ctrlShow true;
-
-
- _ctrl ctrlEnable true;
- ctrlSetFocus _ctrl;
- _ctrl ctrlEnable false;
-
-
- _ctrl ctrlSetFade 1;
- _ctrl ctrlCommit _decayTime;
- } else {
- [_this select 1] call CBA_fnc_removePerFrameHandler;
- _ctrl ctrlShow false;
- cTabProcessNotificationsPFH = nil;
- };
- } else {
- [_this select 1] call CBA_fnc_removePerFrameHandler;
- cTabProcessNotificationsPFH = nil;
- };
- },4,[_ctrl]] call CBA_fnc_addPerFrameHandler;
- };
- };
- true
|