1 #using scripts\codescripts\struct;
3 #using scripts\shared\callbacks_shared;
4 #using scripts\shared\hud_message_shared;
5 #using scripts\shared\hud_util_shared;
6 #using scripts\shared\music_shared;
7 #using scripts\shared\system_shared;
8 #using scripts\shared\util_shared;
10 #insert scripts\shared\shared.gsh;
12 #precache( "string", "MENU_POINTS" );
13 #precache( "string", "MP_WAITING_FOR_PLAYERS_SHOUTCASTER" );
14 #precache( "eventstring", "faction_popup" );
16 #namespace hud_message;
43 if ( isdefined(
self.customGametypeHeader ) )
45 self.customGametypeHeader Destroy();
48 if ( isdefined(
self.customGametypeSubHeader ) )
50 self.customGametypeSubHeader Destroy();
60 self.customGametypeHeader
hud::setPoint(
"TOP", undefined, 0, 30 );
61 self.customGametypeHeader.glowAlpha = 1;
62 self.customGametypeHeader.hideWhenInMenu =
true;
63 self.customGametypeHeader.archived =
false;
64 self.customGametypeHeader.color = ( 1, 1, 0.6 );
65 self.customGametypeHeader.alpha = 1;
70 self.customGametypeSubHeader
hud::setParent(
self.customGametypeHeader );
71 self.customGametypeSubHeader
hud::setPoint(
"TOP",
"BOTTOM", 0, 0 );
72 self.customGametypeSubHeader.glowAlpha = 1;
73 self.customGametypeSubHeader.hideWhenInMenu =
true;
74 self.customGametypeSubHeader.archived =
false;
75 self.customGametypeSubHeader.color = ( 1, 1, 0.6 );
76 self.customGametypeSubHeader.alpha = 1;
81 notifyData = spawnstruct();
83 notifyData.notifyText = hintText;
84 notifyData.duration = duration;
91 notifyData = spawnstruct();
92 notifyData.notifyText = hintText;
93 notifyData.duration = duration;
95 for ( i = 0; i < players.size; i++ )
103 self LUINotifyEvent( &
"faction_popup", 1, game[
"strings"][team +
"_name"] );
109 if( !SessionModeIsZombiesGame() )
111 if (
self IsSplitscreen() )
118 relativePoint =
"BOTTOM";
129 relativePoint =
"BOTTOM";
136 if (
self IsSplitscreen() )
143 relativePoint =
"BOTTOM";
153 point =
"BOTTOM LEFT";
154 relativePoint =
"TOP";
163 self.notifyTitle
hud::setPoint( point, undefined, xOffset, yOffset );
164 self.notifyTitle.glowAlpha = 1;
165 self.notifyTitle.hideWhenInMenu =
true;
166 self.notifyTitle.archived =
false;
167 self.notifyTitle.alpha = 0;
172 self.notifyText.glowAlpha = 1;
173 self.notifyText.hideWhenInMenu =
true;
174 self.notifyText.archived =
false;
175 self.notifyText.alpha = 0;
180 self.notifyText2.glowAlpha = 1;
181 self.notifyText2.hideWhenInMenu =
true;
182 self.notifyText2.archived =
false;
183 self.notifyText2.alpha = 0;
188 self.notifyIcon.hideWhenInMenu =
true;
189 self.notifyIcon.archived =
false;
190 self.notifyIcon.alpha = 0;
192 self.doingNotify =
false;
193 self.notifyQueue = [];
198 if ( level.wagerMatch && !level.teamBased )
201 notifyData = spawnstruct();
203 notifyData.titleText = titleText;
204 notifyData.notifyText = notifyText;
205 notifyData.iconName = iconName;
206 notifyData.sound = sound;
207 notifyData.duration = duration;
209 self.startMessageNotifyQueue[
self.startMessageNotifyQueue.size ] = notifyData;
211 self notify(
"received award" );
216 self endon (
"death" );
217 self endon (
"disconnect" );
219 if ( !isdefined(
self.messageNotifyQueue ) )
221 self.messageNotifyQueue = [];
224 self.messageNotifyQueue[
self.messageNotifyQueue.size ] = notifyData;
226 self notify(
"received award" );
233 duration = duration - 4;
246 self endon(
"disconnect");
248 self.doingNotify =
true;
252 self notify (
"notifyMessageBegin", duration );
256 if ( isdefined( notifyData.sound ) )
258 self playLocalSound( notifyData.sound );
270 if ( isdefined( notifyData.musicState ) )
271 self music::setmusicstate( notifyData.music );
273 if ( isdefined( notifyData.leaderSound ) )
275 if( isdefined( level.globallogic_audio_dialog_on_player_override ) )
277 self [[ level.globallogic_audio_dialog_on_player_override ]]( notifyData.leaderSound );
281 if ( isdefined( notifyData.glowColor ) )
282 glowColor = notifyData.glowColor;
284 glowColor = (0.0, 0.0, 0.0);
286 if ( isdefined( notifyData.color ) )
287 color = notifyData.color;
289 color = (1.0, 1.0, 1.0);
291 anchorElem =
self.notifyTitle;
293 if ( isdefined( notifyData.titleText ) )
295 if ( isdefined( notifyData.titleLabel ) )
296 self.notifyTitle.label = notifyData.titleLabel;
298 self.notifyTitle.label = &
"";
300 if ( isdefined( notifyData.titleLabel ) && !isdefined( notifyData.titleIsString ) )
301 self.notifyTitle setValue( notifyData.titleText );
303 self.notifyTitle setText( notifyData.titleText );
304 self.notifyTitle setCOD7DecodeFX( 200,
int(duration*1000), 600 );
305 self.notifyTitle.glowColor = glowColor;
306 self.notifyTitle.color = color;
307 self.notifyTitle.alpha = 1;
310 if ( isdefined( notifyData.notifyText ) )
312 if ( isdefined( notifyData.textLabel ) )
313 self.notifyText.label = notifyData.textLabel;
315 self.notifyText.label = &
"";
317 if ( isdefined( notifyData.textLabel ) && !isdefined( notifyData.textIsString ) )
318 self.notifyText setValue( notifyData.notifyText );
320 self.notifyText setText( notifyData.notifyText );
321 self.notifyText setCOD7DecodeFX( 100,
int(duration*1000), 600 );
322 self.notifyText.glowColor = glowColor;
323 self.notifyText.color = color;
324 self.notifyText.alpha = 1;
325 anchorElem =
self.notifyText;
328 if ( isdefined( notifyData.notifyText2 ) )
330 if (
self IsSplitscreen() )
332 if ( isdefined( notifyData.text2Label ) )
333 self iPrintLnBold( notifyData.text2Label, notifyData.notifyText2 );
335 self iPrintLnBold( notifyData.notifyText2 );
341 if ( isdefined( notifyData.text2Label ) )
342 self.notifyText2.label = notifyData.text2Label;
344 self.notifyText2.label = &
"";
346 self.notifyText2 setText( notifyData.notifyText2 );
347 self.notifyText2 setPulseFX( 100,
int(duration*1000), 1000 );
348 self.notifyText2.glowColor = glowColor;
349 self.notifyText2.color = color;
350 self.notifyText2.alpha = 1;
351 anchorElem =
self.notifyText2;
355 if ( isdefined( notifyData.iconName ) )
360 if (isdefined(notifyData.iconWidth))
362 iconWidth= notifyData.iconWidth;
364 if (isdefined(notifyData.iconHeight))
366 iconHeight= notifyData.iconHeight;
370 self.notifyIcon setShader( notifyData.iconName, iconWidth, iconHeight );
371 self.notifyIcon.alpha = 0;
372 self.notifyIcon fadeOverTime( 1.0 );
373 self.notifyIcon.alpha = 1;
377 self.notifyIcon fadeOverTime( 0.75 );
378 self.notifyIcon.alpha = 0;
385 self notify (
"notifyMessageDone" );
386 self.doingNotify =
false;
397 while ( waitTime > 0 )
401 waitTime -= interval;
417 self endon (
"notifyMessageDone" );
418 self endon (
"disconnect" );
419 level endon (
"game_ended" );
420 self waittill (
"death" );
428 self notify (
"resetOnCancel" );
429 self endon (
"resetOnCancel" );
430 self endon (
"notifyMessageDone" );
431 self endon (
"disconnect" );
433 level waittill (
"cancel_notify" );
441 self.notifyTitle.alpha = 0;
442 self.notifyText.alpha = 0;
443 self.notifyText2.alpha = 0;
444 self.notifyIcon.alpha = 0;
445 self.doingNotify =
false;
451 self endon (
"disconnect" );
455 self waittill (
"death" );
464 self endon (
"disconnect" );
466 messageTextY = level.lowerTextY;
467 if (
self IsSplitscreen() )
468 messageTextY = level.lowerTextY - 50;
471 self.lowerMessage
hud::setPoint(
"CENTER", level.lowerTextYAlign, 0, messageTextY );
472 self.lowerMessage setText(
"" );
473 self.lowerMessage.archived =
false;
476 if (
self IsSplitscreen() )
482 self.lowerTimer setText(
"" );
483 self.lowerTimer.archived =
false;
488 if ( level.cumulativeRoundScores )
490 self setValue( getTeamScore( team ) );
500 for ( i = 0 ; i < topN; i++ )
502 if ( isdefined( players[i] ) && (
self == players[i] ) )
513 if( isdefined( hudElem ) )
519 if ( !isdefined(
self.waitingForPlayersText ) )
522 self.waitingForPlayersText
hud::setPoint(
"CENTER",
"CENTER", 0, -80 );
523 self.waitingForPlayersText.sort = 1001;
524 self.waitingForPlayersText setText( &
"MP_WAITING_FOR_PLAYERS_SHOUTCASTER" );
525 self.waitingForPlayersText.foreground =
false;
526 self.waitingForPlayersText.hidewheninmenu =
true;
532 if ( isdefined(
self.waitingForPlayersText ) )
535 self.waitingForPlayersText = undefined;
541 pendingNotifies =
true;
543 while( pendingNotifies && timeWaited < 12 )
545 pendingNotifies =
false;
546 players = GetPlayers();
547 for( i = 0; i < players.size; i++ )
549 if( isdefined( players[i].notifyQueue ) && players[i].notifyQueue.size > 0 )
551 pendingNotifies =
true;
554 if( pendingNotifies )