Advertisement
Guest User

Untitled

a guest
Nov 20th, 2019
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 3.14 KB | None | 0 0
  1. span class="re5"> params["_text", ["_error", false, [false]], ["_speed", "", [""]]];
  2. if (isServer || !hasInterface) exitWith {};
  3. disableSerialization;
  4. _display = finddisplay 46;
  5.  
  6. private _headerColor = [0, 0, 0, 0];
  7.  
  8. if (_text isEqualType "") then {
  9.     _text = parseText _text;
  10. };
  11. private _Header = _display ctrlCreate["RscText", -1];
  12. _Header ctrlSetPosition[0.005 * safezoneW + safezoneX, 0.01 * safezoneH + safezoneY, 0.2 * safezoneW, 0.011 * safezoneH];
  13. _Header ctrlSetBackgroundColor _headerColor;
  14. _Header ctrlSetFade 1;
  15. _Header ctrlCommit 0;
  16. _Header ctrlSetFade 0;
  17. _Header ctrlCommit 0.4;
  18. private _TextField = _display ctrlCreate["RscStructuredText", -1];
  19. _TextField ctrlSetStructuredText _text;
  20. _TextField ctrlSetPosition[0.005 * safezoneW + safezoneX, 0.021 * safezoneH + safezoneY, 0.2 * safezoneW, 0.5];
  21. _TextField ctrlCommit 0;
  22. _TextField ctrlSetPosition[0.005 * safezoneW + safezoneX, 0.021 * safezoneH + safezoneY, 0.2 * safezoneW, ((ctrlTextHeight _TextField) + (0.005 * safezoneH))];
  23. _TextField ctrlSetBackgroundColor[0, 0, 0, 0];
  24. _TextField ctrlSetFade 1;
  25. _TextField ctrlCommit 0;
  26. _TextField ctrlSetFade 0;
  27. _TextField ctrlCommit 0.4;
  28.  
  29. [_TextField, _Header, _speed] spawn {
  30.     disableSerialization;
  31.     if (_this select 2 isEqualTo "fast") then {
  32.         uiSleep 5;
  33.     };
  34.     if (_this select 2 isEqualTo "mittel") then {
  35.         uiSleep 10;
  36.     };
  37.     if (_this select 2 isEqualTo "slow") then {
  38.         uiSleep 15;
  39.     };
  40.     private _TextField = _this select 0;
  41.     private _Header = _this select 1;
  42.     _TextField ctrlSetFade 1;
  43.     _TextField ctrlCommit 0.3;
  44.     _Header ctrlSetFade 1;
  45.     _Header ctrlCommit 0.3;
  46.     uiSleep 0.3;
  47.     ctrlDelete _Header;
  48.     ctrlDelete _TextField;
  49. };
  50. private _posText = (ctrlPosition(_TextField)) select 1;
  51. private _posHeader = (ctrlPosition(_Header)) select 1;
  52. private _textHigh = (ctrlPosition(_TextField)) select 3;
  53. if (count life_open2_notifications > 0) then {
  54.     private _activeNotifications = 0; {
  55.         private _ctrlHeader = _x select 0;
  56.         private _ctrlText = _x select 1;
  57.         if (!isNull _ctrlHeader && !isNull _ctrlText) then {
  58.             _ctrlHeader ctrlSetPosition[0.005 * safezoneW + safezoneX, (_posHeader + _textHigh + 1.5 * (0.011 * safezoneH))];
  59.             _ctrlText ctrlSetPosition[0.005 * safezoneW + safezoneX, (_posText + _textHigh + 1.5 * (0.011 * safezoneH))];
  60.             _ctrlHeader ctrlCommit 0.25;
  61.             _ctrlText ctrlCommit 0.25;
  62.             _posText = (_posText + _textHigh + 1.5 * (0.011 * safezoneH));
  63.             _posHeader = (_posHeader + _textHigh + 1.5 * (0.011 * safezoneH));
  64.             _textHigh = (ctrlPosition(_ctrlText)) select 3;
  65.             if (_activeNotifications > 3) then {
  66.                 _ctrlText ctrlSetFade 1;
  67.                 _ctrlHeader ctrlSetFade 1;
  68.                 _ctrlText ctrlCommit 0.2;
  69.                 _ctrlHeader ctrlCommit 0.2;
  70.             };
  71.             _activeNotifications = _activeNotifications + 1;
  72.         };
  73.     }
  74.     forEach life_open2_notifications;
  75. };
  76.  
  77. life_open2_notifications = ([
  78.     [_Header, _TextField]
  79. ] + life_open2_notifications) select {
  80.     !isNull(_x select 0) && !isNull(_x select 1)
  81. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement