IW4M-Admin/GameFiles/GameInterface/_integration_t6zm_helper.gsc
INSANEMODE e4535e09a0 Patch game interface (#305)
* remove extra set of parentheses in call to DisplaypopupsWaiter()

* add missing event argument in call to GotoCoordImpl()

* remove event arg from GotoCoordImpl() in t6 to match other game interface scripts
2023-06-02 11:44:36 -05:00

94 lines
2.4 KiB
Plaintext

Init()
{
level.startmessagedefaultduration = 2;
level.regulargamemessages = spawnstruct();
level.regulargamemessages.waittime = 6;
thread OnPlayerConnect();
}
OnPlayerConnect()
{
for ( ;; )
{
level waittill( "connecting", player );
player thread DisplaypopupsWaiter();
}
}
DisplaypopupsWaiter()
{
self endon( "disconnect" );
self.ranknotifyqueue = [];
if ( !IsDefined( self.pers[ "challengeNotifyQueue" ] ) )
{
self.pers[ "challengeNotifyQueue" ] = [];
}
if ( !IsDefined( self.pers[ "contractNotifyQueue" ] ) )
{
self.pers[ "contractNotifyQueue" ] = [];
}
self.messagenotifyqueue = [];
self.startmessagenotifyqueue = [];
self.wagernotifyqueue = [];
while ( !level.gameended )
{
if ( self.startmessagenotifyqueue.size == 0 && self.messagenotifyqueue.size == 0 )
{
self waittill( "received award" );
}
waittillframeend;
if ( level.gameended )
{
return;
}
else
{
if ( self.startmessagenotifyqueue.size > 0 )
{
nextnotifydata = self.startmessagenotifyqueue[ 0 ];
arrayremoveindex( self.startmessagenotifyqueue, 0, 0 );
if ( IsDefined( nextnotifydata.duration ) )
{
duration = nextnotifydata.duration;
}
else
{
duration = level.startmessagedefaultduration;
}
self maps\mp\gametypes_zm\_hud_message::shownotifymessage( nextnotifydata, duration );
wait ( duration );
continue;
}
else if ( self.messagenotifyqueue.size > 0 )
{
nextnotifydata = self.messagenotifyqueue[ 0 ];
arrayremoveindex( self.messagenotifyqueue, 0, 0 );
if ( IsDefined( nextnotifydata.duration ) )
{
duration = nextnotifydata.duration;
}
else
{
duration = level.regulargamemessages.waittime;
}
self maps\mp\gametypes_zm\_hud_message::shownotifymessage( nextnotifydata, duration );
continue;
}
else
{
wait ( 1 );
}
}
}
}