a3_vemf_reloaded/Missionname.MapName/VEMFr_client/sqf/onLoad.sqf

94 lines
4.6 KiB
Plaintext
Raw Normal View History

2016-07-16 21:18:24 +00:00
disableSerialization;
2016-08-21 19:37:07 +00:00
_dsp = uiNamespace getVariable [ "RscDisplayVEMFrClient", displayNull ];
2016-07-16 21:18:24 +00:00
if not isNull _dsp then
{
2016-08-21 19:37:07 +00:00
if ( count ( uiNamespace getVariable [ "VEMFrMsgQueue", [] ] ) isEqualTo 0 ) then
2016-07-16 21:18:24 +00:00
{
2016-08-21 19:37:07 +00:00
( [ "RscDisplayVEMFrClient" ] call BIS_fnc_rscLayer ) cutFadeOut 0;
2016-07-16 21:18:24 +00:00
systemChat "[VEMFrClient] No messages to display";
} else
{
playSound "HintExpand";
// do stuff
_ctrlPic = _dsp displayCtrl 10;
_ctrlTitle = _dsp displayCtrl 11;
_ctrlMsg = _dsp displayCtrl 12;
{
2016-08-21 19:37:07 +00:00
[ _dsp, _x ] spawn
2016-07-16 21:18:24 +00:00
{
disableSerialization;
_dsp = _this select 0;
_data = _this select 1;
_ctrlPic = _dsp displayCtrl 10;
2016-08-21 19:37:07 +00:00
if ( ( ctrlFade _ctrlPic ) < 1 ) then
2016-07-16 21:18:24 +00:00
{
_ctrlPic ctrlSetFade 1;
_ctrlPic ctrlCommit 0.5;
uiSleep 0.75;
};
_ctrlPic ctrlSetTextColor call
{
2016-08-21 19:37:07 +00:00
private "_return";
if ( ( _data select 0 ) isEqualTo 0 ) then { _return = [ 0.5, 0, 0, 1 ] };
if ( ( _data select 0 ) isEqualTo 1 ) then { _return = [ 0, 0.3, 0.6, 1 ] };
if ( ( _data select 0 ) isEqualTo 2 ) then { _return = [ 0, 0, 0, 1 ] };
if ( isNil "_return" ) then { _return = [ 1, 1, 1, 1 ] };
2016-07-16 21:18:24 +00:00
_return
};
_ctrlPic ctrlSetFade 0;
_ctrlPic ctrlCommit 0.5;
};
2016-08-21 19:37:07 +00:00
if ( _ctrlTitle getVariable [ "expanded", false ] AND ( _ctrlMsg getVariable [ "expanded", false ] ) ) then
2016-07-16 21:18:24 +00:00
{
_ctrlPos = ctrlPosition _ctrlTitle;
2016-08-21 19:37:07 +00:00
_ctrlTitle ctrlSetPosition [ _ctrlPos select 0, _ctrlPos select 1, 0 * safezoneW, _ctrlPos select 3 ];
2016-07-16 21:18:24 +00:00
_ctrlTitle ctrlSetFade 1;
_ctrlTitle ctrlCommit 0.5;
2016-08-21 19:37:07 +00:00
_ctrlTitle setVariable [ "expanded", false ];
2016-07-16 21:18:24 +00:00
uiSleep 0.75;
2016-08-21 19:37:07 +00:00
_ctrlTitle ctrlSetText toUpper ( _x select 1 );
2016-07-16 21:18:24 +00:00
_ctrlPos = ctrlPosition _ctrlTitle;
2016-08-21 19:37:07 +00:00
_ctrlTitle ctrlSetPosition [ _ctrlPos select 0, _ctrlPos select 1, 0.1 * safezoneW, _ctrlPos select 3 ];
2016-07-16 21:18:24 +00:00
_ctrlTitle ctrlSetFade 0;
_ctrlTitle ctrlCommit 0.5;
2016-08-21 19:37:07 +00:00
_ctrlTitle setVariable [ "expanded", true ];
2016-07-16 21:18:24 +00:00
_ctrlPos = ctrlPosition _ctrlMsg;
2016-08-21 19:37:07 +00:00
_ctrlMsg ctrlSetPosition [ _ctrlPos select 0, _ctrlPos select 1, 0 * safezoneW, _ctrlPos select 3 ];
2016-07-16 21:18:24 +00:00
_ctrlMsg ctrlSetFade 1;
_ctrlMsg ctrlCommit 0.5;
2016-08-21 19:37:07 +00:00
_ctrlMsg setVariable [ "expanded", false ];
2016-07-16 21:18:24 +00:00
uiSleep 0.75;
2016-08-21 19:37:07 +00:00
_ctrlMsg ctrlSetText ( _x select 2 );
2016-07-16 21:18:24 +00:00
_ctrlPos = ctrlPosition _ctrlMsg;
2016-08-21 19:37:07 +00:00
_ctrlMsg ctrlSetPosition [ _ctrlPos select 0, _ctrlPos select 1, 0.45 * safezoneW, _ctrlPos select 3 ];
2016-07-16 21:18:24 +00:00
_ctrlMsg ctrlSetFade 0;
_ctrlMsg ctrlCommit 0.5;
2016-08-21 19:37:07 +00:00
_ctrlMsg setVariable [ "expanded", true ];
2016-07-16 21:18:24 +00:00
2016-08-21 19:37:07 +00:00
uiSleep ( count ( _x select 2 ) / 5 );
2016-07-16 21:18:24 +00:00
} else
{
2016-08-21 19:37:07 +00:00
_ctrlTitle ctrlSetText toUpper ( _x select 1 );
2016-07-16 21:18:24 +00:00
_ctrlPos = ctrlPosition _ctrlTitle;
2016-08-21 19:37:07 +00:00
_ctrlTitle ctrlSetPosition [ _ctrlPos select 0, _ctrlPos select 1, 0.1 * safezoneW, _ctrlPos select 3 ];
2016-07-16 21:18:24 +00:00
_ctrlTitle ctrlSetFade 0;
_ctrlTitle ctrlCommit 0.5;
2016-08-21 19:37:07 +00:00
_ctrlTitle setVariable [ "expanded", true ];
2016-07-16 21:18:24 +00:00
2016-08-21 19:37:07 +00:00
_ctrlMsg ctrlSetText ( _x select 2 );
2016-07-16 21:18:24 +00:00
_ctrlPos = ctrlPosition _ctrlMsg;
2016-08-21 19:37:07 +00:00
_ctrlMsg ctrlSetPosition [ _ctrlPos select 0, _ctrlPos select 1, 0.45 * safezoneW, _ctrlPos select 3 ];
2016-07-16 21:18:24 +00:00
_ctrlMsg ctrlSetFade 0;
_ctrlMsg ctrlCommit 0.5;
2016-08-21 19:37:07 +00:00
_ctrlMsg setVariable [ "expanded", true ];
2016-07-16 21:18:24 +00:00
2016-08-21 19:37:07 +00:00
uiSleep ( count ( _x select 2 ) / 5 );
2016-07-16 21:18:24 +00:00
};
2016-08-21 19:37:07 +00:00
} forEach ( uiNamespace getVariable [ "VEMFrMsgQueue", [] ] );
uiNamespace setVariable [ "VEMFrMsgQueue", [] ];
( [ "RscDisplayVEMFrClient" ] call BIS_fnc_rscLayer ) cutFadeOut 0.5;
2016-07-16 21:18:24 +00:00
};
2016-08-21 19:37:07 +00:00
} else { systemChat "Nope." };