‪Black Ops 3 Source Code Explorer  0.1
‪An script explorer for Black Ops 3 by ZeRoY
_hud_message.gsc
Go to the documentation of this file.
1 #using scripts\codescripts\struct;
2 
3 #using scripts\shared\hud_util_shared;
4 #using scripts\shared\music_shared;
5 #using scripts\shared\util_shared;
6 
7 #insert scripts\shared\shared.gsh;
8 
9 #using scripts\shared\hud_message_shared;
10 #using scripts\shared\system_shared;
11 
12 #using scripts\mp\gametypes\_globallogic_audio;
13 
14 #using scripts\mp\_util;
15 
16 #precache( "string", "MP_FIRSTPLACE_NAME" );
17 #precache( "string", "MP_SECONDPLACE_NAME" );
18 #precache( "string", "MP_THIRDPLACE_NAME" );
19 #precache( "string", "MP_WAGER_PLACE_NAME" );
20 #precache( "string", "MP_MATCH_BONUS_IS" );
21 #precache( "string", "MP_CODPOINTS_MATCH_BONUS_IS" );
22 #precache( "string", "MP_WAGER_WINNINGS_ARE" );
23 #precache( "string", "MP_WAGER_SIDEBET_WINNINGS_ARE" );
24 #precache( "string", "MP_WAGER_IN_THE_MONEY" );
25 #precache( "string", "MP_DRAW_CAPS" );
26 #precache( "string", "MP_ROUND_DRAW_CAPS" );
27 #precache( "string", "MP_ROUND_WIN_CAPS" );
28 #precache( "string", "MP_ROUND_LOSS_CAPS" );
29 #precache( "string", "MP_VICTORY_CAPS" );
30 #precache( "string", "MP_DEFEAT_CAPS" );
31 #precache( "string", "MP_TOP3_CAPS" );
32 #precache( "string", "MP_GAME_OVER_CAPS" );
33 #precache( "string", "MP_HALFTIME_CAPS" );
34 #precache( "string", "MP_OVERTIME_CAPS" );
35 #precache( "string", "MP_ROUNDEND_CAPS" );
36 #precache( "string", "MP_INTERMISSION_CAPS" );
37 #precache( "string", "MP_SWITCHING_SIDES_CAPS" );
38 #precache( "string", "MP_MATCH_BONUS_IS" );
39 #precache( "string", "MP_CODPOINTS_MATCH_BONUS_IS" );
40 #precache( "string", "MP_WAGER_WINNINGS_ARE" );
41 #precache( "string", "MP_WAGER_SIDEBET_WINNINGS_ARE" );
42 #precache( "string", "MP_WAGER_IN_THE_MONEY_CAPS" );
43 #precache( "string", "MP_WAGER_LOSS_CAPS" );
44 #precache( "string", "MP_WAGER_TOPWINNERS" );
45 #precache( "string", "MP_JOIN_IN_PROGRESS_LOSS" );
46 #precache( "string", "MP_WINS" );
47 #precache( "string", "MP_TEAM_ELIMINATED" );
48 
49 #precache( "eventstring", "show_outcome" );
50 
51 #namespace hud_message;
52 
53 function ‪init()
54 {
55  game["strings"]["draw"] = &"MP_DRAW_CAPS";
56  game["strings"]["round_draw"] = &"MP_ROUND_DRAW_CAPS";
57  game["strings"]["round_win"] = &"MP_ROUND_WIN_CAPS";
58  game["strings"]["round_loss"] = &"MP_ROUND_LOSS_CAPS";
59  game["strings"]["victory"] = &"MP_VICTORY_CAPS";
60  game["strings"]["defeat"] = &"MP_DEFEAT_CAPS";
61  game["strings"]["top3"] = &"MP_TOP3_CAPS";
62  game["strings"]["game_over"] = &"MP_GAME_OVER_CAPS";
63  game["strings"]["halftime"] = &"MP_HALFTIME_CAPS";
64  game["strings"]["overtime"] = &"MP_OVERTIME_CAPS";
65  game["strings"]["roundend"] = &"MP_ROUNDEND_CAPS";
66  game["strings"]["intermission"] = &"MP_INTERMISSION_CAPS";
67  game["strings"]["side_switch"] = &"MP_SWITCHING_SIDES_CAPS";
68  game["strings"]["match_bonus"] = &"MP_MATCH_BONUS_IS";
69  game["strings"]["codpoints_match_bonus"] = &"MP_CODPOINTS_MATCH_BONUS_IS";
70  game["strings"]["wager_winnings"] = &"MP_WAGER_WINNINGS_ARE";
71  game["strings"]["wager_sidebet_winnings"] = &"MP_WAGER_SIDEBET_WINNINGS_ARE";
72  game["strings"]["wager_inthemoney"] = &"MP_WAGER_IN_THE_MONEY_CAPS";
73  game["strings"]["wager_loss"] = &"MP_WAGER_LOSS_CAPS";
74  game["strings"]["wager_topwinners"] = &"MP_WAGER_TOPWINNERS";
75  game["strings"]["join_in_progress_loss"] = &"MP_JOIN_IN_PROGRESS_LOSS";
76  game["strings"]["cod_caster_team_wins"] = &"MP_WINS";
77  game["strings"]["cod_caster_team_eliminated"] = &"MP_TEAM_ELIMINATED";
78 }
79 
80 function ‪teamOutcomeNotify( winner, endType, endReasonText )
81 {
82  self endon ( "disconnect" );
83  self notify ( "reset_outcome" );
84 
85  team = self.pers["team"];
86 
87  if ( team != "spectator" && ( !isdefined( team ) || !isdefined( level.teams[team] ) ) )
88  team = "allies";
89 
90  // wait for notifies to finish
91  while ( self.doingNotify )
93 
94  self endon ( "reset_outcome" );
95 
96  outcomeText = "";
97  notifyRoundEndToUI = undefined;
98 
99  overrideSpectator = false;
100 
101  if ( endType == "halftime" )
102  {
103  outcomeText = game["strings"]["halftime"];
104  notifyRoundEndToUI = true;
105  }
106  else if ( endType == "intermission" )
107  {
108  outcomeText = game["strings"]["intermission"];
109  notifyRoundEndToUI = true;
110  }
111  else if ( endType == "overtime" )
112  {
113  outcomeText = game["strings"]["overtime"];
114  notifyRoundEndToUI = true;
115  }
116  else if ( endType == "roundend" )
117  {
118  if ( winner == "tie" )
119  {
120  outcomeText = game["strings"]["round_draw"];
121  }
122  else if ( isdefined( self.pers["team"] ) && winner == team )
123  {
124  outcomeText = game["strings"]["round_win"];
125  overrideSpectator = true;
126  }
127  else
128  {
129  outcomeText = game["strings"]["round_loss"];
130 
131  if ( isdefined( level.endDefeatReasonText ) )
132  {
133  endReasonText = level.endDefeatReasonText;
134  }
135 
136  overrideSpectator = true;
137  }
138  notifyRoundEndToUI = true;
139  }
140  else if ( endType == "gameend" )
141  {
142  if ( winner == "tie" )
143  {
144  outcomeText = game["strings"]["draw"];
145  }
146  else if ( isdefined( self.pers["team"] ) && winner == team )
147  {
148  outcomeText = game["strings"]["victory"];
149  overrideSpectator = true;
150  }
151  else
152  {
153  outcomeText = game["strings"]["defeat"];
154 
155  if ( isdefined( level.endDefeatReasonText ) )
156  {
157  endReasonText = level.endDefeatReasonText;
158  }
159 
160  if ( (level.rankedMatch || level.leagueMatch ) && ( self.pers["lateJoin"] === true ) )
161  {
162  endReasonText = game["strings"]["join_in_progress_loss"];
163  }
164 
165  overrideSpectator = true;
166 
167  }
168  notifyRoundEndToUI = false;
169  }
170 
171  matchBonus = 0;
172  if ( isdefined( self.pers["totalMatchBonus"] ) )
173  {
174  bonus = Ceil( self.pers["totalMatchBonus"] * level.xpScale );
175 
176  if ( bonus > 0 )
177  {
178  matchBonus = bonus;
179  }
180  }
181 
182  winnerEnum = 0;
183 
184  if ( winner == "allies" )
185  {
186  winnerEnum = ‪TEAM_ALLIES;
187  }
188  else if ( winner == "axis" )
189  {
190  winnerEnum = ‪TEAM_AXIS;
191  }
192 
193  if( ( ( level.gameType == "ctf" ) || ( level.gameType == "escort" ) || ( level.gameType == "ball" ) ) && isdefined( game["overtime_round"] ) )
194  {
195  if( game["overtime_round"] == 1 )
196  {
197  if( isdefined( game[level.gameType + "_overtime_first_winner"]) )
198  {
199  winner = game[level.gameType + "_overtime_first_winner"];
200  }
201 
202  if( isdefined( winner ) && ( winner != "tie" ) )
203  {
204  winningTime = game[level.gameType + "_overtime_time_to_beat"];
205  }
206  }
207  else
208  {
209  if( isdefined(game[level.gameType + "_overtime_first_winner"]) && game[level.gameType + "_overtime_first_winner"] == "tie" )
210  {
211  winningTime = game[level.gameType + "_overtime_best_time"];
212  }
213  else
214  {
215  winningTime = undefined;
216 
217  if ( winner == "tie" && isdefined(game[level.gameType + "_overtime_first_winner"]) )
218  {
219  if ( game[level.gameType + "_overtime_first_winner"] == "allies" )
220  {
221  winnerEnum = ‪TEAM_ALLIES;
222  }
223  else if ( game[level.gameType + "_overtime_first_winner"] == "axis" )
224  {
225  winnerEnum = ‪TEAM_AXIS;
226  }
227  }
228 
229  if ( isdefined(game[level.gameType + "_overtime_time_to_beat"]) )
230  {
231  winningTime = game[level.gameType + "_overtime_time_to_beat"];
232  }
233 
234  if( isdefined( game[level.gameType + "_overtime_best_time"] ) && ( !isDefined( winningTime ) || (winningTime > game[level.gameType + "_overtime_best_time"]) ) )
235  {
236  if( game[level.gameType + "_overtime_first_winner"] !== winner )
237  {
238  losingTime = winningTime;
239  }
240 
241  winningTime = game[level.gameType + "_overtime_best_time"];
242 
243  if( winner === "tie" )
244  {
245  winningTime = 0;
246  }
247  }
248  }
249 
250  if( ( level.gameType == "escort" ) && ( winner === "tie" ) )
251  {
252  winnerEnum = 0;
253  if( !‪IS_TRUE( level.finalGameEnd ) )
254  {
255  if( game["defenders"] == team )
256  outcomeText = game["strings"]["round_win"];
257  else
258  outcomeText = game["strings"]["round_loss"];
259  }
260  }
261  }
262  ‪DEFAULT( winningTime, 0 );
263  ‪DEFAULT( losingTime, 0 );
264 
265  if( ( winningTime == 0 ) && ( losingTime == 0 ) )
266  winnerEnum = 0;
267 
268  if ( team == "spectator" && overrideSpectator )
269  {
270  outcomeText = game["strings"]["cod_caster_team_wins"];
271  notifyRoundEndToUI = false;
272  }
273 
274  self LUINotifyEvent( &"show_outcome", 7, outcomeText, endReasonText, int( matchBonus ), winnerEnum, notifyRoundEndToUI, int( winningTime / 1000 ), int( losingTime / 1000 ) );
275  }
276  else if( level.gameType == "ball" &&
277  isdefined( winner ) && ( winner != "tie" ) &&
278  game["roundsplayed"] < level.roundLimit &&
279  isdefined( game["round_time_to_beat"] ) &&
280  !isdefined( game["overtime_round"] ) )
281  {
282  winningTime = game["round_time_to_beat"];
283 
284  ‪DEFAULT( losingTime, 0 );
285 
286  switch( winner )
287  {
288  case "allies":
289  winnerEnum = ‪TEAM_ALLIES;
290  break;
291  case "axis":
292  winnerEnum = ‪TEAM_AXIS;
293  break;
294  default:
295  winnerEnum = 0;
296  }
297 
298  if ( team == "spectator" && overrideSpectator )
299  {
300  outcomeText = game["strings"]["cod_caster_team_wins"];
301  notifyRoundEndToUI = false;
302  }
303 
304  self LUINotifyEvent( &"show_outcome", 7, outcomeText, endReasonText, int( matchBonus ), winnerEnum, notifyRoundEndToUI, int( winningTime / 1000 ), int( losingTime / 1000 ) );
305  }
306  else
307  {
308  // Codcaster Specific Outcome Override
309  if ( team == "spectator" && overrideSpectator )
310  {
311  // Special case handling of end reason text
312  foreach( team in level.teams )
313  {
314  if ( endreasontext == game["strings"][team + "_eliminated"] )
315  {
316  endReasonText = game["strings"]["cod_caster_team_eliminated"];
317  break;
318  }
319  }
320 
321  outcomeText = game["strings"]["cod_caster_team_wins"];
322  notifyRoundEndToUI = false;
323  }
324 
325  self LUINotifyEvent( &"show_outcome", 5, outcomeText, endReasonText, int( matchBonus ), winnerEnum, notifyRoundEndToUI );
326  }
327 }
328 
329 function ‪teamOutcomeNotifyZombie( winner, isRound, endReasonText )
330 {
331  self endon ( "disconnect" );
332  self notify ( "reset_outcome" );
333 
334  team = self.pers["team"];
335  if ( isdefined( team ) && team == "spectator" )
336  {
337  for ( i = 0; i < level.players.size; i++ )
338  {
339  if ( self.currentspectatingclient == level.players[i].clientId )
340  {
341  team = level.players[i].pers["team"];
342  break;
343  }
344  }
345  }
346 
347  if ( !isdefined( team ) || !isdefined( level.teams[team] ) )
348  team = "allies";
349 
350  // wait for notifies to finish
351  while ( self.doingNotify )
353 
354  self endon ( "reset_outcome" );
355 
356 
357  if ( level.splitscreen )
358  {
359  titleSize = 2.0;
360  spacing = 10;
361  font = "default";
362  }
363  else
364  {
365  titleSize = 3.0;
366  spacing = 50;
367  font = "objective";
368  }
369 
370  const duration = 60000;
371 
372  outcomeTitle = ‪hud::createFontString( font, titleSize );
373  outcomeTitle ‪hud::setPoint( "TOP", undefined, 0, spacing );
374  outcomeTitle.glowAlpha = 1;
375  outcomeTitle.hideWhenInMenu = false;
376  outcomeTitle.archived = false;
377  outcomeTitle.immunetodemogamehudsettings = true;
378  outcomeTitle.immunetodemofreecamera = true;
379 
380  outcomeTitle setText( endReasonText );
381  outcomeTitle setPulseFX( 100, duration, 1000 );
382 
383  self thread ‪resetOutcomeNotify( undefined, undefined, outcomeTitle );
384 }
385 
386 function ‪outcomeNotify( winner, isRoundEnd, endReasonText )
387 {
388  self endon ( "disconnect" );
389  self notify ( "reset_outcome" );
390 
391  // wait for notifies to finish
392  while ( self.doingNotify )
394 
395  self endon ( "reset_outcome" );
396 
397  outcomeText = "";
398  players = level.placement["all"];
399  numClients = players.size;
400 
401  overrideSpectator = false;
402 
403  if ( !‪util::isOneRound() && !isRoundEnd )
404  {
405  outcomeText = game["strings"]["game_over"];
406  }
407  else if ( players[0].pointstowin == 0 )
408  {
409  outcomeText = game["strings"]["tie"];
410  }
411  else if ( self ‪isInTop( players, 1 ) )
412  {
413  outcomeText = game["strings"]["victory"];
414  overrideSpectator = true;
415  }
416  else if ( self ‪isInTop( players, 3 ) )
417  {
418  outcomeText = game["strings"]["top3"];
419  }
420  else
421  {
422  outcomeText = game["strings"]["defeat"];
423  overrideSpectator = true;
424  }
425 
426  matchBonus = 0;
427 
428  if ( isdefined( self.pers["totalMatchBonus"] ) )
429  {
430  matchBonus = self.pers["totalMatchBonus"];
431  }
432 
433  wait( 2 );
434 
435  team = self.pers["team"];
436  if( isdefined( team ) && team == "spectator" && overrideSpectator )
437  {
438  outcomeText = game["strings"]["cod_caster_team_wins"];
439  self LUINotifyEvent( &"show_outcome", 5, outcomeText, endReasonText, matchBonus, winner, false );
440  }
441  else
442  {
443  self LUINotifyEvent( &"show_outcome", 4, outcomeText, endReasonText, matchBonus, numClients );
444  }
445 
446 }
447 
448 function ‪wagerOutcomeNotify( winner, endReasonText )
449 {
450  self endon ( "disconnect" );
451  self notify ( "reset_outcome" );
452 
453  // wait for notifies to finish
454  while ( self.doingNotify )
456 
457  self endon ( "reset_outcome" );
458 
459  headerFont = "extrabig";
460  font = "objective";
461  if ( self IsSplitscreen() )
462  {
463  titleSize = 2.0;
464  winnerSize = 1.5;
465  otherSize = 1.5;
466  iconSize = 30;
467  spacing = 2;
468  }
469  else
470  {
471  titleSize = 3.0;
472  winnerSize = 2.0;
473  otherSize = 1.5;
474  iconSize = 30;
475  spacing = 20;
476  }
477 
478  halftime = false;
479  if ( isdefined( level.sidebet ) && level.sidebet )
480  halftime = true;
481 
482  duration = 60000;
483 
484  players = level.placement["all"];
485 
486  outcomeTitle = ‪hud::createFontString( headerFont, titleSize );
487  outcomeTitle ‪hud::setPoint( "TOP", undefined, 0, spacing );
488  if( halftime )
489  {
490  outcomeTitle setText( game["strings"]["intermission"] );
491  outcomeTitle.color = (1.0, 1.0, 0.0);
492  outcomeTitle.glowColor = (1.0, 0.0, 0.0);
493  }
494  else if( isdefined(level.dontCalcWagerWinnings) && level.dontCalcWagerWinnings == true )
495  {
496  outcomeTitle setText( game["strings"]["wager_topwinners"] );
497  outcomeTitle.color = (0.42, 0.68, 0.46);
498  }
499  else
500  {
501  if ( isdefined( self.wagerWinnings ) && ( self.wagerWinnings > 0 ) )
502  {
503  outcomeTitle setText( game["strings"]["wager_inthemoney"] );
504  outcomeTitle.color = (0.42, 0.68, 0.46);
505  }
506  else
507  {
508  outcomeTitle setText( game["strings"]["wager_loss"] );
509  outcomeTitle.color = (0.73, 0.29, 0.19);
510  }
511  }
512  outcomeTitle.glowAlpha = 1;
513  outcomeTitle.hideWhenInMenu = false;
514  outcomeTitle.archived = false;
515  outcomeTitle.immunetodemogamehudsettings = true;
516  outcomeTitle.immunetodemofreecamera = true;
517  outcomeTitle setCOD7DecodeFX( 200, duration, 600 );
518 
519  outcomeText = ‪hud::createFontString( font, 2.0 );
520  outcomeText ‪hud::setParent( outcomeTitle );
521  outcomeText ‪hud::setPoint( "TOP", "BOTTOM", 0, 0 );
522  outcomeText.glowAlpha = 1;
523  outcomeText.hideWhenInMenu = false;
524  outcomeText.archived = false;
525  outcomeText.immunetodemogamehudsettings = true;
526  outcomeText.immunetodemofreecamera = true;
527  outcomeText setText( endReasonText );
528 
529  playerNameHudElems = [];
530  playerCPHudElems = [];
531  numPlayers = players.size;
532  for ( i = 0 ; i < numPlayers ; i++ )
533  {
534  if ( !halftime && isdefined( players[i] ) )
535  {
536  secondTitle = ‪hud::createFontString( font, otherSize );
537  if ( playerNameHudElems.size == 0 )
538  {
539  secondTitle ‪hud::setParent( outcomeText );
540  secondTitle ‪hud::setPoint( "TOP_LEFT", "BOTTOM", -175, spacing*3 );
541  }
542  else
543  {
544  secondTitle ‪hud::setParent( playerNameHudElems[playerNameHudElems.size-1] );
545  secondTitle ‪hud::setPoint( "TOP_LEFT", "BOTTOM_LEFT", 0, spacing );
546  }
547  //secondTitle.glowColor = (0.2, 0.3, 0.7);
548  secondTitle.glowAlpha = 1;
549  secondTitle.hideWhenInMenu = false;
550  secondTitle.archived = false;
551  secondTitle.immunetodemogamehudsettings = true;
552  secondTitle.immunetodemofreecamera = true;
553  secondTitle.label = &"MP_WAGER_PLACE_NAME";
554  secondTitle.playerNum = i;
555  secondTitle setPlayerNameString( players[i] );
556  playerNameHudElems[playerNameHudElems.size] = secondTitle;
557 
558  secondCP = ‪hud::createFontString( font, otherSize );
559  secondCP ‪hud::setParent( secondTitle );
560  secondCP ‪hud::setPoint( "TOP_RIGHT", "TOP_LEFT", 350, 0 );
561  secondCP.glowAlpha = 1;
562  secondCP.hideWhenInMenu = false;
563  secondCP.archived = false;
564  secondCP.immunetodemogamehudsettings = true;
565  secondCP.immunetodemofreecamera = true;
566  secondCP.label = &"MENU_POINTS";
567  secondCP.currentValue = 0;
568  if ( isdefined( players[i].wagerWinnings ) )
569  secondCP.targetValue = players[i].wagerWinnings;
570  else
571  secondCP.targetValue = 0;
572  if ( secondCP.targetValue > 0 )
573  secondCP.color = (0.42, 0.68, 0.46);
574  secondCP setValue( 0 );
575  playerCPHudElems[playerCPHudElems.size] = secondCP;
576  }
577  }
578 
579  self thread ‪updateWagerOutcome( playerNameHudElems, playerCPHudElems );
580  self thread ‪resetWagerOutcomeNotify( playerNameHudElems, playerCPHudElems, outcomeTitle, outcomeText );
581 
582  if ( halftime )
583  return;
584 
585  stillUpdating = true;
586  countUpDuration = 2;
587  CPIncrement = 9999;
588  if ( isdefined( playerCPHudElems[0] ) )
589  {
590  CPIncrement = int( playerCPHudElems[0].targetValue / ( countUpDuration / 0.05 ) );
591  if ( CPIncrement < 1 )
592  CPIncrement = 1;
593  }
594  while( stillUpdating )
595  {
596  stillUpdating = false;
597  for ( i = 0 ; i < playerCPHudElems.size ; i++ )
598  {
599  if ( isdefined( playerCPHudElems[i] ) && ( playerCPHudElems[i].currentValue < playerCPHudElems[i].targetValue ) )
600  {
601  playerCPHudElems[i].currentValue += CPIncrement;
602  if ( playerCPHudElems[i].currentValue > playerCPHudElems[i].targetValue )
603  playerCPHudElems[i].currentValue = playerCPHudElems[i].targetValue;
604  playerCPHudElems[i] SetValue( playerCPHudElems[i].currentValue );
605  stillUpdating = true;
606  }
607  }
609  }
610 }
611 
612 function ‪teamWagerOutcomeNotify( winner, isRoundEnd, endReasonText )
613 {
614  self endon ( "disconnect" );
615  self notify ( "reset_outcome" );
616 
617  team = self.pers["team"];
618  if ( !isdefined( team ) || (!isdefined( level.teams[team] ) ) )
619  team = "allies";
620 
622 
623  // wait for notifies to finish
624  while ( self.doingNotify )
626 
627  self endon ( "reset_outcome" );
628 
629  headerFont = "extrabig";
630  font = "objective";
631  if ( self IsSplitscreen() )
632  {
633  titleSize = 2.0;
634  textSize = 1.5;
635  iconSize = 30;
636  spacing = 10;
637  }
638  else
639  {
640  titleSize = 3.0;
641  textSize = 2.0;
642  iconSize = 70;
643  spacing = 15;
644  }
645 
646  halftime = false;
647  if ( isdefined( level.sidebet ) && level.sidebet )
648  halftime = true;
649 
650  duration = 60000;
651 
652  outcomeTitle = ‪hud::createFontString( headerFont, titleSize );
653  outcomeTitle ‪hud::setPoint( "TOP", undefined, 0, spacing );
654  outcomeTitle.glowAlpha = 1;
655  outcomeTitle.hideWhenInMenu = false;
656  outcomeTitle.archived = false;
657  outcomeTitle.immunetodemogamehudsettings = true;
658  outcomeTitle.immunetodemofreecamera = true;
659 
660  outcomeText = ‪hud::createFontString( font, 2.0 );
661  outcomeText ‪hud::setParent( outcomeTitle );
662  outcomeText ‪hud::setPoint( "TOP", "BOTTOM", 0, 0 );
663  outcomeText.glowAlpha = 1;
664  outcomeText.hideWhenInMenu = false;
665  outcomeText.archived = false;
666  outcomeText.immunetodemogamehudsettings = true;
667  outcomeText.immunetodemofreecamera = true;
668 
669  if ( winner == "tie" )
670  {
671  if ( isRoundEnd )
672  outcomeTitle setText( game["strings"]["round_draw"] );
673  else
674  outcomeTitle setText( game["strings"]["draw"] );
675  outcomeTitle.color = (1, 1, 1);
676 
677  winner = "allies";
678  }
679  else if ( winner == "overtime" )
680  {
681  outcomeTitle setText( game["strings"]["overtime"] );
682  outcomeTitle.color = (1, 1, 1);
683 
684  }
685  else if ( isdefined( self.pers["team"] ) && winner == team )
686  {
687  if ( isRoundEnd )
688  outcomeTitle setText( game["strings"]["round_win"] );
689  else
690  outcomeTitle setText( game["strings"]["victory"] );
691  outcomeTitle.color = (0.42, 0.68, 0.46);
692  }
693  else
694  {
695  if ( isRoundEnd )
696  outcomeTitle setText( game["strings"]["round_loss"] );
697  else
698  outcomeTitle setText( game["strings"]["defeat"] );
699  outcomeTitle.color = (0.73, 0.29, 0.19);
700  }
701  if( !isdefined( level.dontShowEndReason ) || !level.dontShowEndReason )
702  {
703  outcomeText setText( endReasonText );
704  }
705 
706  outcomeTitle setPulseFX( 100, duration, 1000 );
707  outcomeText setPulseFX( 100, duration, 1000 );
708 
709  teamIcons = [];
710  teamIcons[team] = ‪hud::createIcon( game["icons"][team], iconSize, iconSize );
711  teamIcons[team] ‪hud::setParent( outcomeText );
712  teamIcons[team] ‪hud::setPoint( "TOP", "BOTTOM", -60, spacing );
713  teamIcons[team].hideWhenInMenu = false;
714  teamIcons[team].archived = false;
715  teamIcons[team].alpha = 0;
716  teamIcons[team] fadeOverTime( 0.5 );
717  teamIcons[team].alpha = 1;
718  teamIcons[team].immunetodemogamehudsettings = true;
719  teamIcons[team].immunetodemofreecamera = true;
720 
721  foreach( enemyTeam in level.teams )
722  {
723  if ( team == enemyTeam )
724  continue;
725 
726  teamIcons[enemyTeam] = ‪hud::createIcon( game["icons"][enemyTeam], iconSize, iconSize );
727  teamIcons[enemyTeam] ‪hud::setParent( outcomeText );
728  teamIcons[enemyTeam] ‪hud::setPoint( "TOP", "BOTTOM", 60, spacing );
729  teamIcons[enemyTeam].hideWhenInMenu = false;
730  teamIcons[enemyTeam].archived = false;
731  teamIcons[enemyTeam].alpha = 0;
732  teamIcons[enemyTeam] fadeOverTime( 0.5 );
733  teamIcons[enemyTeam].alpha = 1;
734  teamIcons[enemyTeam].immunetodemogamehudsettings = true;
735  teamIcons[enemyTeam].immunetodemofreecamera = true;
736  }
737 
738  teamScores = [];
739  teamScores[team] = ‪hud::createFontString( font, titleSize );
740  teamScores[team] ‪hud::setParent( teamIcons[team] );
741  teamScores[team] ‪hud::setPoint( "TOP", "BOTTOM", 0, spacing );
742  teamScores[team].glowAlpha = 1;
743  teamScores[team] setValue( getTeamScore( team ) );
744  teamScores[team].hideWhenInMenu = false;
745  teamScores[team].archived = false;
746  teamScores[team].immunetodemogamehudsettings = true;
747  teamScores[team].immunetodemofreecamera = true;
748  teamScores[team] setPulseFX( 100, duration, 1000 );
749 
750  foreach( enemyTeam in level.teams )
751  {
752  if ( team == enemyTeam )
753  continue;
754 
755  teamScores[enemyTeam] = ‪hud::createFontString( font, titleSize );
756  teamScores[enemyTeam] ‪hud::setParent( teamIcons[enemyTeam] );
757  teamScores[enemyTeam] ‪hud::setPoint( "TOP", "BOTTOM", 0, spacing );
758  teamScores[enemyTeam].glowAlpha = 1;
759  teamScores[enemyTeam] setValue( getTeamScore( enemyTeam ) );
760  teamScores[enemyTeam].hideWhenInMenu = false;
761  teamScores[enemyTeam].archived = false;
762  teamScores[enemyTeam].immunetodemogamehudsettings = true;
763  teamScores[enemyTeam].immunetodemofreecamera = true;
764  teamScores[enemyTeam] setPulseFX( 100, duration, 1000 );
765  }
766 
767  matchBonus = undefined;
768  sidebetWinnings = undefined;
769  if ( !isRoundEnd && !halftime && isdefined( self.wagerWinnings ) )
770  {
771  matchBonus = ‪hud::createFontString( font, 2.0 );
772  matchBonus ‪hud::setParent( outcomeText );
773  matchBonus ‪hud::setPoint( "TOP", "BOTTOM", 0, iconSize + (spacing * 3) + teamScores[team].height );
774  matchBonus.glowAlpha = 1;
775  matchBonus.hideWhenInMenu = false;
776  matchBonus.archived = false;
777  matchBonus.immunetodemogamehudsettings = true;
778  matchBonus.immunetodemofreecamera = true;
779  matchBonus.label = game["strings"]["wager_winnings"];
780  matchBonus setValue( self.wagerWinnings );
781 
782  if ( isdefined( game["side_bets"] ) && game["side_bets"] )
783  {
784  sidebetWinnings = ‪hud::createFontString( font, 2.0 );
785  sidebetWinnings ‪hud::setParent( matchBonus );
786  sidebetWinnings ‪hud::setPoint( "TOP", "BOTTOM", 0, spacing );
787  sidebetWinnings.glowAlpha = 1;
788  sidebetWinnings.hideWhenInMenu = false;
789  sidebetWinnings.archived = false;
790  sidebetWinnings.immunetodemogamehudsettings = true;
791  sidebetWinnings.immunetodemofreecamera = true;
792  sidebetWinnings.label = game["strings"]["wager_sidebet_winnings"];
793  sidebetWinnings setValue( self.pers["wager_sideBetWinnings"] );
794  }
795  }
796  self thread ‪resetOutcomeNotify( teamIcons, teamScores, outcomeTitle, outcomeText, matchBonus, sidebetWinnings );
797 }
798 
799 function ‪resetOutcomeNotify( hudElemList1, hudElemList2, hudElem3, hudElem4, hudElem5, hudElem6, hudElem7, hudElem8, hudElem9, hudElem10 )
800 {
801  self endon ( "disconnect" );
802  self waittill ( "reset_outcome" );
803 
804  ‪destroyHudElem( hudElem3 );
805  ‪destroyHudElem( hudElem4 );
806  ‪destroyHudElem( hudElem5 );
807  ‪destroyHudElem( hudElem6 );
808  ‪destroyHudElem( hudElem7 );
809  ‪destroyHudElem( hudElem8 );
810  ‪destroyHudElem( hudElem9 );
811  ‪destroyHudElem( hudElem10 );
812 
813  if ( isdefined( hudElemList1 ) )
814  {
815  foreach( elem in hudElemList1 )
816  {
817  ‪destroyHudElem( elem );
818  }
819  }
820 
821  if ( isdefined( hudElemList2 ) )
822  {
823  foreach( elem in hudElemList2 )
824  {
825  ‪destroyHudElem( elem );
826  }
827  }
828 }
829 
830 function ‪resetWagerOutcomeNotify( playerNameHudElems, playerCPHudElems, outcomeTitle, outcomeText )
831 {
832  self endon( "disconnect" );
833  self waittill( "reset_outcome" );
834 
835  for ( i = playerNameHudElems.size - 1 ; i >= 0 ; i-- )
836  {
837  if ( isdefined( playerNameHudElems[i] ) )
838  playerNameHudElems[i] ‪destroy();
839  }
840 
841  for ( i = playerCPHudElems.size - 1 ; i >= 0 ; i-- )
842  {
843  if ( isdefined( playerCPHudElems[i] ) )
844  playerCPHudElems[i] ‪destroy();
845  }
846 
847  if ( isdefined( outcomeText ) )
848  outcomeText ‪destroy();
849 
850  if ( isdefined( outcomeTitle ) )
851  outcomeTitle ‪destroy();
852 }
853 
854 function ‪updateOutcome( firstTitle, secondTitle, thirdTitle )
855 {
856  self endon( "disconnect" );
857  self endon( "reset_outcome" );
858 
859  while( true )
860  {
861  self waittill( "update_outcome" );
862 
863  players = level.placement["all"];
864 
865  if ( isdefined( firstTitle ) && isdefined( players[0] ) )
866  firstTitle setPlayerNameString( players[0] );
867  else if ( isdefined( firstTitle ) )
868  firstTitle.alpha = 0;
869 
870  if ( isdefined( secondTitle ) && isdefined( players[1] ) )
871  secondTitle setPlayerNameString( players[1] );
872  else if ( isdefined( secondTitle ) )
873  secondTitle.alpha = 0;
874 
875  if ( isdefined( thirdTitle ) && isdefined( players[2] ) )
876  thirdTitle setPlayerNameString( players[2] );
877  else if ( isdefined( thirdTitle ) )
878  thirdTitle.alpha = 0;
879  }
880 }
881 
882 function ‪updateWagerOutcome( playerNameHudElems, playerCPHudElems )
883 {
884  self endon( "disconnect" );
885  self endon( "reset_outcome" );
886 
887  while ( true )
888  {
889  self waittill( "update_outcome" );
890 
891  players = level.placement["all"];
892 
893  for ( i = 0 ; i < playerNameHudElems.size ; i++ )
894  {
895  if ( isdefined( playerNameHudElems[i] ) && isdefined( players[playerNameHudElems[i].playerNum] ) )
896  playerNameHudElems[i] SetPlayerNameString( players[playerNameHudElems[i].playerNum] );
897  else
898  {
899  if ( isdefined( playerNameHudElems[i] ) )
900  playerNameHudElems[i].alpha = 0;
901  if ( isdefined( playerCPHudElems[i] ) )
902  playerCPHudElems[i].alpha = 0;
903  }
904  }
905  }
906 }
‪destroyHudElem
‪function destroyHudElem(hudElem)
Definition: hud_message_shared.gsc:511
‪isOneRound
‪function isOneRound()
Definition: util_shared.gsc:3497
‪teamWagerOutcomeNotify
‪function teamWagerOutcomeNotify(winner, isRoundEnd, endReasonText)
Definition: _hud_message.gsc:612
‪isInTop
‪function isInTop(players, topN)
Definition: hud_message_shared.gsc:498
‪resetWagerOutcomeNotify
‪function resetWagerOutcomeNotify(playerNameHudElems, playerCPHudElems, outcomeTitle, outcomeText)
Definition: _hud_message.gsc:830
‪init
‪function init()
Definition: _hud_message.gsc:53
‪setPoint
‪function setPoint(point, relativePoint, xOffset, yOffset, moveTime)
Definition: hud_util_shared.gsc:53
‪teamOutcomeNotify
‪function teamOutcomeNotify(winner, endType, endReasonText)
Definition: _hud_message.gsc:80
‪wagerOutcomeNotify
‪function wagerOutcomeNotify(winner, endReasonText)
Definition: _hud_message.gsc:448
‪setParent
‪function setParent(element)
Definition: hud_util_shared.gsc:10
‪IS_TRUE
‪#define IS_TRUE(__a)
Definition: shared.gsh:251
‪TEAM_AXIS
‪#define TEAM_AXIS
Definition: shared.gsh:158
‪DEFAULT
‪#define DEFAULT(__var, __default)
Definition: shared.gsh:270
‪createFontString
‪function createFontString(font, fontScale)
Definition: hud_util_shared.gsc:334
‪updateOutcome
‪function updateOutcome(firstTitle, secondTitle, thirdTitle)
Definition: _hud_message.gsc:854
‪TEAM_ALLIES
‪#define TEAM_ALLIES
Definition: shared.gsh:157
‪outcomeNotify
‪function outcomeNotify(winner, isRoundEnd, endReasonText)
Definition: _hud_message.gsc:386
‪resetOutcomeNotify
‪function resetOutcomeNotify(hudElemList1, hudElemList2, hudElem3, hudElem4, hudElem5, hudElem6, hudElem7, hudElem8, hudElem9, hudElem10)
Definition: _hud_message.gsc:799
‪updateWagerOutcome
‪function updateWagerOutcome(playerNameHudElems, playerCPHudElems)
Definition: _hud_message.gsc:882
‪destroy
‪function destroy(watcher, owner)
Definition: _decoy.gsc:108
‪createIcon
‪function createIcon(shader, width, height)
Definition: hud_util_shared.gsc:417
‪teamOutcomeNotifyZombie
‪function teamOutcomeNotifyZombie(winner, isRound, endReasonText)
Definition: _hud_message.gsc:329
‪WAIT_SERVER_FRAME
‪#define WAIT_SERVER_FRAME
Definition: shared.gsh:265