mirror of
https://github.com/IT07/a3_vemf_reloaded.git
synced 2024-08-30 16:52:11 +00:00
Rewritten
This commit is contained in:
parent
f0f2b1bf17
commit
e3fff55115
@ -1,45 +1,72 @@
|
||||
if hasInterface then
|
||||
{
|
||||
uiNamespace setVariable ["VEMFrMsgQueue", []];
|
||||
uiNamespace setVariable ["RscDisplayVEMFrClient", displayNull];
|
||||
// custom addPublicVariableEventHandler. Those bloody BE filters.....
|
||||
uiNamespace setVariable [ "VEMFrMsgQueue", [] ];
|
||||
uiNamespace setVariable [ "RscDisplayVEMFrClient", displayNull ];
|
||||
uiNamespace setVariable [ "RscDisplayBaseAttack", displayNull ];
|
||||
|
||||
if isMultiplayer then
|
||||
{
|
||||
_handleMessage =
|
||||
{
|
||||
_data = _this;
|
||||
_msg = param [0, "", [[],format[""]]];
|
||||
_mode = param [1, "", ["", -1]];
|
||||
if (_mode isEqualTo "sys") then
|
||||
params [ "_msg", "_mode" ];
|
||||
if ( _mode isEqualTo "sys" ) then { systemChat _msg };
|
||||
if ( _mode isEqualTo "" ) then
|
||||
{
|
||||
systemChat _msg;
|
||||
} else
|
||||
{
|
||||
(uiNamespace getVariable ["VEMFrMsgQueue", []]) pushBack _msg;
|
||||
if isNull(uiNamespace getVariable ["RscDisplayVEMFrClient", displayNull]) then
|
||||
( uiNamespace getVariable [ "VEMFrMsgQueue", [] ] ) pushBack _msg;
|
||||
if ( isNull ( uiNamespace getVariable [ "RscDisplayVEMFrClient", displayNull ] ) ) then
|
||||
{
|
||||
(["RscDisplayVEMFrClient"] call BIS_fnc_rscLayer) cutRsc["RscDisplayVEMFrClient", "PLAIN", 0, true]
|
||||
( [ "RscDisplayVEMFrClient" ] call BIS_fnc_rscLayer ) cutRsc [ "RscDisplayVEMFrClient", "PLAIN", 0, true ]
|
||||
};
|
||||
};
|
||||
if ( _mode isEqualTo "ba" ) then
|
||||
{
|
||||
_dsp = uiNamespace getVariable [ "RscDisplayBaseAttack", displayNull ];
|
||||
if ( ( _msg isEqualTo "a" ) AND ( isNull _dsp ) ) then
|
||||
{
|
||||
( [ "RscDisplayBaseAttack" ] call BIS_fnc_rscLayer ) cutRsc [ "RscDisplayBaseAttack", "PLAIN", 0, true ];
|
||||
};
|
||||
if ( ( _msg isEqualTo "d" ) AND not ( isNull _dsp ) ) then
|
||||
{
|
||||
_dsp setVariable [ "doFlash", false ];
|
||||
waitUntil { if ( _dsp getVariable [ "doingFlash", false ] ) then { uiSleep 0.5; false } else { true } };
|
||||
_ctrl = _dsp displayCtrl 1;
|
||||
_oldTxt = ctrlText _ctrl;
|
||||
for "_i" from ( count ( ctrlText _ctrl ) ) to 0 step -1 do
|
||||
{
|
||||
_ctrl ctrlSetText ( _oldTxt select [ 0, _i ] );
|
||||
uiSleep 0.035;
|
||||
};
|
||||
_ctrl ctrlSetTextColor [ 0.333, 1, 0.557, 1 ];
|
||||
_nwTxt = "// [ Attack on Base ended ] \\";
|
||||
for "_i" from 0 to ( count _nwTxt ) do
|
||||
{
|
||||
_ctrl ctrlSetText ( _nwTxt select [ 0, _i ] );
|
||||
uiSleep 0.035;
|
||||
};
|
||||
_dsp setVariable [ "doFlash", true ];
|
||||
uiSleep 12.5;
|
||||
( [ "RscDisplayBaseAttack" ] call BIS_fnc_rscLayer ) cutFadeOut 0.5;
|
||||
};
|
||||
};
|
||||
};
|
||||
while {true} do
|
||||
|
||||
while { true } do
|
||||
{
|
||||
if not isNil"VEMFrMsgToClient" then
|
||||
if not ( isNil "VEMFrMsgToClient" ) then
|
||||
{
|
||||
VEMFrMsgToClient spawn _handleMessage;
|
||||
VEMFrMsgToClient = nil;
|
||||
} else
|
||||
{
|
||||
uiSleep 0.05;
|
||||
};
|
||||
} else { uiSleep 0.05 };
|
||||
};
|
||||
} else
|
||||
{
|
||||
_arr = uiNamespace getVariable ["VEMFrMsgQueue",[]];
|
||||
_arr pushBack [0,"NEW TAKEOVER","Raiders have taken over ..."];
|
||||
_arr pushBack [1,"NEW POLICE RAID", format["%1 Police forces are raiding ...", worldName]];
|
||||
_arr pushBack [2,"NEW S.W.A.T. RAID", format["%1's S.W.A.T. teams are raiding ...", worldName]];
|
||||
waitUntil { if not(isNull(findDisplay 46)) then {true} else {uiSleep 0.5; false} };
|
||||
player addAction ["Trigger VEMFr Message",{(["RscDisplayVEMFrClient"] call BIS_fnc_rscLayer) cutRsc["RscDisplayVEMFrClient", "PLAIN", 0, true]},"",-1,false,true,"User2","alive player"];
|
||||
_arr = uiNamespace getVariable [ "VEMFrMsgQueue", [] ];
|
||||
_arr pushBack [ 0, "NEW TAKEOVER", "Raiders have taken over ..." ];
|
||||
_arr pushBack [ 1, "NEW POLICE RAID", format [ "%1 Police forces are raiding ...", worldName ] ];
|
||||
_arr pushBack [ 2, "NEW S.W.A.T. RAID", format [ "%1's S.W.A.T. teams are raiding ...", worldName ] ];
|
||||
waitUntil { if not ( isNull ( findDisplay 46 ) ) then { true } else { uiSleep 0.5; false } };
|
||||
player addAction [ "Trigger VEMFr Message", { ( [ "RscDisplayVEMFrClient" ] call BIS_fnc_rscLayer ) cutRsc [ "RscDisplayVEMFrClient", "PLAIN", 0, true ] }, "", -1, false, true, "User2", "alive player" ];
|
||||
player addAction [ "Trigger BaseAttack", { ( [ "RscDisplayBaseAttack" ] call BIS_fnc_rscLayer ) cutRsc [ "RscDisplayBaseAttack", "PLAIN", 0, true ] }, "", -1, false, true, "", "alive player" ];
|
||||
};
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user