Advertisement
Guest User

Untitled

a guest
Jul 17th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 35.29 KB | None | 0 0
  1. #include maps\mp\_utility;
  2.  
  3. #include maps\mp\gametypes\_hud_util;
  4.  
  5. #include common_scripts\utility;
  6.  
  7.  
  8.  
  9. init()
  10.  
  11. {
  12.  
  13.     precacheString( &"MP_FIRSTPLACE_NAME" );
  14.  
  15.     precacheString( &"MP_SECONDPLACE_NAME" );
  16.  
  17.     precacheString( &"MP_THIRDPLACE_NAME" );
  18.  
  19.     precacheString( &"MP_MATCH_BONUS_IS" );
  20.  
  21.  
  22.  
  23.     precacheMenu( "splash" );
  24.  
  25.     precacheMenu( "challenge" );
  26.  
  27.     precacheMenu( "defcon" );
  28.  
  29.     precacheMenu( "killstreak" );
  30.  
  31.     precacheMenu( "perk_display" );
  32.  
  33.     precacheMenu( "perk_hide" );
  34.  
  35.     precacheMenu( "killedby_card_display" );
  36.  
  37.     precacheMenu( "killedby_card_hide" );
  38.  
  39.     precacheMenu( "youkilled_card_display" );
  40.  
  41.  
  42.  
  43.     game["menu_endgameupdate"] = "endgameupdate";
  44.  
  45.     if ( level.splitscreen )
  46.  
  47.         game["menu_endgameupdate"] += "_splitscreen";
  48.  
  49.     precacheMenu(game["menu_endgameupdate"]);
  50.  
  51.  
  52.  
  53.     game["strings"]["draw"] = &"MP_DRAW";
  54.  
  55.     game["strings"]["round_draw"] = &"MP_ROUND_DRAW";
  56.  
  57.     game["strings"]["round_win"] = &"MP_ROUND_WIN";
  58.  
  59.     game["strings"]["round_loss"] = &"MP_ROUND_LOSS";
  60.  
  61.     game["strings"]["victory"] = &"MP_VICTORY";
  62.  
  63.     game["strings"]["defeat"] = &"MP_DEFEAT";
  64.  
  65.     game["strings"]["halftime"] = &"MP_HALFTIME";
  66.  
  67.     game["strings"]["overtime"] = &"MP_OVERTIME";
  68.  
  69.     game["strings"]["roundend"] = &"MP_ROUNDEND";
  70.  
  71.     game["strings"]["intermission"] = &"MP_INTERMISSION";
  72.  
  73.     game["strings"]["side_switch"] = &"MP_SWITCHING_SIDES";
  74.  
  75.     game["strings"]["match_bonus"] = &"MP_MATCH_BONUS_IS";
  76.  
  77.    
  78.  
  79.     level thread onPlayerConnect();
  80.  
  81. }
  82.  
  83.  
  84.  
  85.  
  86.  
  87. onPlayerConnect()
  88.  
  89. {
  90.  
  91.     for(;;)
  92.  
  93.     {
  94.  
  95.         level waittill( "connected", player );
  96.  
  97.  
  98.  
  99.         player thread hintMessageDeathThink();
  100.  
  101.         player thread lowerMessageThink();
  102.  
  103.        
  104.  
  105.         player thread initNotifyMessage();
  106.  
  107.     }
  108.  
  109. }
  110.  
  111.  
  112.  
  113.  
  114.  
  115. hintMessage( hintText )
  116.  
  117. {
  118.  
  119.     notifyData = spawnstruct();
  120.  
  121.    
  122.  
  123.     notifyData.notifyText = hintText;
  124.  
  125.     notifyData.glowColor = (0.3, 0.6, 0.3);
  126.  
  127.    
  128.  
  129.     notifyMessage( notifyData );
  130.  
  131. }
  132.  
  133.  
  134.  
  135.  
  136.  
  137. initNotifyMessage()
  138.  
  139. {
  140.  
  141.     if ( level.splitscreen )
  142.  
  143.     {
  144.  
  145.         titleSize = 2.0;
  146.  
  147.         textSize = 1.5;
  148.  
  149.         iconSize = 24;
  150.  
  151.         font = "default";
  152.  
  153.         point = "TOP";
  154.  
  155.         relativePoint = "BOTTOM";
  156.  
  157.         yOffset = 30;
  158.  
  159.         xOffset = 0;
  160.  
  161.     }
  162.  
  163.     else
  164.  
  165.     {
  166.  
  167.         titleSize = 2.5;
  168.  
  169.         textSize = 1.75;
  170.  
  171.         iconSize = 30;
  172.  
  173.         font = "objective";
  174.  
  175.         point = "TOP";
  176.  
  177.         relativePoint = "BOTTOM";
  178.  
  179.         yOffset = 50;
  180.  
  181.         xOffset = 0;
  182.  
  183.     }
  184.  
  185.    
  186.  
  187.     self.notifyTitle = createFontString( font, titleSize );
  188.  
  189.     self.notifyTitle setPoint( point, undefined, xOffset, yOffset );
  190.  
  191.     self.notifyTitle.glowColor = (0.2, 0.3, 0.7);
  192.  
  193.     self.notifyTitle.glowAlpha = 1;
  194.  
  195.     self.notifyTitle.hideWhenInMenu = true;
  196.  
  197.     self.notifyTitle.archived = false;
  198.  
  199.     self.notifyTitle.alpha = 0;
  200.  
  201.  
  202.  
  203.     self.notifyText = createFontString( font, textSize );
  204.  
  205.     self.notifyText setParent( self.notifyTitle );
  206.  
  207.     self.notifyText setPoint( point, relativePoint, 0, 0 );
  208.  
  209.     self.notifyText.glowColor = (0.2, 0.3, 0.7);
  210.  
  211.     self.notifyText.glowAlpha = 1;
  212.  
  213.     self.notifyText.hideWhenInMenu = true;
  214.  
  215.     self.notifyText.archived = false;
  216.  
  217.     self.notifyText.alpha = 0;
  218.  
  219.  
  220.  
  221.     self.notifyText2 = createFontString( font, textSize );
  222.  
  223.     self.notifyText2 setParent( self.notifyTitle );
  224.  
  225.     self.notifyText2 setPoint( point, relativePoint, 0, 0 );
  226.  
  227.     self.notifyText2.glowColor = (0.2, 0.3, 0.7);
  228.  
  229.     self.notifyText2.glowAlpha = 1;
  230.  
  231.     self.notifyText2.hideWhenInMenu = true;
  232.  
  233.     self.notifyText2.archived = false;
  234.  
  235.     self.notifyText2.alpha = 0;
  236.  
  237.  
  238.  
  239.     self.notifyIcon = createIcon( "white", iconSize, iconSize );
  240.  
  241.     self.notifyIcon setParent( self.notifyText2 );
  242.  
  243.     self.notifyIcon setPoint( point, relativePoint, 0, 0 );
  244.  
  245.     self.notifyIcon.hideWhenInMenu = true;
  246.  
  247.     self.notifyIcon.archived = false;
  248.  
  249.     self.notifyIcon.alpha = 0;
  250.  
  251.  
  252.  
  253.     self.notifyOverlay = createIcon( "white", iconSize, iconSize );
  254.  
  255.     self.notifyOverlay setParent( self.notifyIcon );
  256.  
  257.     self.notifyOverlay setPoint( "CENTER", "CENTER", 0, 0 );
  258.  
  259.     self.notifyOverlay.hideWhenInMenu = true;
  260.  
  261.     self.notifyOverlay.archived = false;
  262.  
  263.     self.notifyOverlay.alpha = 0;
  264.  
  265.  
  266.  
  267.     self.doingSplash = [];
  268.  
  269.     self.doingSplash[0] = undefined;
  270.  
  271.     self.doingSplash[1] = undefined;
  272.  
  273.     self.doingSplash[2] = undefined;
  274.  
  275.     self.doingSplash[3] = undefined;
  276.  
  277.  
  278.  
  279.     self.splashQueue = [];
  280.  
  281.     self.splashQueue[0] = [];
  282.  
  283.     self.splashQueue[1] = [];
  284.  
  285.     self.splashQueue[2] = [];
  286.  
  287.     self.splashQueue[3] = [];
  288.  
  289. }
  290.  
  291.  
  292.  
  293.  
  294.  
  295. oldNotifyMessage( titleText, notifyText, iconName, glowColor, sound, duration )
  296.  
  297. {
  298.  
  299.     notifyData = spawnstruct();
  300.  
  301.    
  302.  
  303.     notifyData.titleText = titleText;
  304.  
  305.     notifyData.notifyText = notifyText;
  306.  
  307.     notifyData.iconName = iconName;
  308.  
  309.     notifyData.glowColor = glowColor;
  310.  
  311.     notifyData.sound = sound;
  312.  
  313.     notifyData.duration = duration;
  314.  
  315.    
  316.  
  317.     notifyMessage( notifyData );
  318.  
  319. }
  320.  
  321.  
  322.  
  323.  
  324.  
  325. notifyMessage( notifyData )
  326.  
  327. {
  328.  
  329.     self endon ( "death" );
  330.  
  331.     self endon ( "disconnect" );
  332.  
  333.    
  334.  
  335.     if ( !isDefined( notifyData.slot ) )
  336.  
  337.         notifyData.slot = 0;
  338.  
  339.    
  340.  
  341.     slot = notifyData.slot;
  342.  
  343.  
  344.  
  345.     if ( !isDefined( notifyData.type ) )
  346.  
  347.         notifyData.type = "";
  348.  
  349.    
  350.  
  351.     if ( !isDefined( self.doingSplash[ slot ] ) )
  352.  
  353.     {
  354.  
  355.         self thread showNotifyMessage( notifyData );
  356.  
  357.         return;
  358.  
  359.     }/*
  360.  
  361.     else if ( notifyData.type == "rank" && self.doingSplash[ slot ].type != "challenge" && self.doingSplash[ slot ].type != "killstreak" )
  362.  
  363.     {
  364.  
  365.         self thread showNotifyMessage( notifyData );
  366.  
  367.         return;
  368.  
  369.     }*/
  370.  
  371.    
  372.  
  373.     self.splashQueue[ slot ][ self.splashQueue[ slot ].size ] = notifyData;
  374.  
  375. }
  376.  
  377.  
  378.  
  379.  
  380.  
  381. dispatchNotify( slot )
  382.  
  383. {  
  384.  
  385.     nextNotifyData = self.splashQueue[ slot ][ 0 ];
  386.  
  387.        
  388.  
  389.     for ( i = 1; i < self.splashQueue[ slot ].size; i++ )
  390.  
  391.         self.splashQueue[ slot ][i-1] = self.splashQueue[ slot ][i];
  392.  
  393.     self.splashQueue[ slot ][i-1] = undefined;
  394.  
  395.  
  396.  
  397.     if ( isDefined( nextNotifyData.name ) )
  398.  
  399.         actionNotify( nextNotifyData );
  400.  
  401.     else
  402.  
  403.         showNotifyMessage( nextNotifyData );
  404.  
  405. }
  406.  
  407.  
  408.  
  409.  
  410.  
  411. promotionSplashNotify()
  412.  
  413. {
  414.  
  415.     self endon ( "disconnect" );
  416.  
  417.  
  418.  
  419.     actionData = spawnStruct();
  420.  
  421.    
  422.  
  423.     actionData.name = "promotion";
  424.  
  425.     actionData.type = "rank";
  426.  
  427.     actionData.sound = "mp_level_up";
  428.  
  429.     actionData.slot = 0;
  430.  
  431.  
  432.  
  433.     self thread actionNotify( actionData );
  434.  
  435. }
  436.  
  437.  
  438.  
  439.  
  440.  
  441. showNotifyMessage( notifyData )
  442.  
  443. {
  444.  
  445.     self endon("disconnect");
  446.  
  447.  
  448.  
  449.     assert( isDefined( notifyData.slot ) );
  450.  
  451.     slot = notifyData.slot;
  452.  
  453.  
  454.  
  455.     if ( level.gameEnded )
  456.  
  457.     {
  458.  
  459.         if ( isDefined( notifyData.type ) && notifyData.type == "rank" )
  460.  
  461.         {
  462.  
  463.             self setClientDvar( "ui_promotion", 1 );
  464.  
  465.             self.postGamePromotion = true;
  466.  
  467.         }
  468.  
  469.        
  470.  
  471.         if ( self.splashQueue[ slot ].size )
  472.  
  473.             self thread dispatchNotify( slot );
  474.  
  475.  
  476.  
  477.         return;
  478.  
  479.     }
  480.  
  481.    
  482.  
  483.     self.doingSplash[ slot ] = notifyData;
  484.  
  485.  
  486.  
  487.     waitRequireVisibility( 0 );
  488.  
  489.  
  490.  
  491.     if ( isDefined( notifyData.duration ) )
  492.  
  493.         duration = notifyData.duration;
  494.  
  495.     else if ( level.gameEnded )
  496.  
  497.         duration = 2.0;
  498.  
  499.     else
  500.  
  501.         duration = 4.0;
  502.  
  503.    
  504.  
  505.     self thread resetOnCancel();
  506.  
  507.  
  508.  
  509.     if ( isDefined( notifyData.sound ) )
  510.  
  511.         self playLocalSound( notifyData.sound );
  512.  
  513.  
  514.  
  515.     if ( isDefined( notifyData.leaderSound ) )
  516.  
  517.         self leaderDialogOnPlayer( notifyData.leaderSound );
  518.  
  519.    
  520.  
  521.     if ( isDefined( notifyData.glowColor ) )
  522.  
  523.         glowColor = notifyData.glowColor;
  524.  
  525.     else
  526.  
  527.         glowColor = (0.3, 0.6, 0.3);
  528.  
  529.  
  530.  
  531.     anchorElem = self.notifyTitle;
  532.  
  533.  
  534.  
  535.     if ( isDefined( notifyData.titleText ) )
  536.  
  537.     {
  538.  
  539.         if ( isDefined( notifyData.titleLabel ) )
  540.  
  541.             self.notifyTitle.label = notifyData.titleLabel;
  542.  
  543.         else
  544.  
  545.             self.notifyTitle.label = &"";
  546.  
  547.  
  548.  
  549.         if ( isDefined( notifyData.titleLabel ) && !isDefined( notifyData.titleIsString ) )
  550.  
  551.             self.notifyTitle setValue( notifyData.titleText );
  552.  
  553.         else
  554.  
  555.             self.notifyTitle setText( notifyData.titleText );
  556.  
  557.         self.notifyTitle setPulseFX( int(25*duration), int(duration*1000), 1000 );
  558.  
  559.         self.notifyTitle.glowColor = glowColor;
  560.  
  561.         self.notifyTitle.alpha = 1;
  562.  
  563.     }
  564.  
  565.  
  566.  
  567.     if ( isDefined( notifyData.textGlowColor ) )
  568.  
  569.         glowColor = notifyData.textGlowColor;
  570.  
  571.  
  572.  
  573.     if ( isDefined( notifyData.notifyText ) )
  574.  
  575.     {
  576.  
  577.         if ( isDefined( notifyData.textLabel ) )
  578.  
  579.             self.notifyText.label = notifyData.textLabel;
  580.  
  581.         else
  582.  
  583.             self.notifyText.label = &"";
  584.  
  585.  
  586.  
  587.         if ( isDefined( notifyData.textLabel ) && !isDefined( notifyData.textIsString ) )
  588.  
  589.             self.notifyText setValue( notifyData.notifyText );
  590.  
  591.         else
  592.  
  593.             self.notifyText setText( notifyData.notifyText );
  594.  
  595.         self.notifyText setPulseFX( 100, int(duration*1000), 1000 );
  596.  
  597.         self.notifyText.glowColor = glowColor; 
  598.  
  599.         self.notifyText.alpha = 1;
  600.  
  601.         anchorElem = self.notifyText;
  602.  
  603.     }
  604.  
  605.  
  606.  
  607.     if ( isDefined( notifyData.notifyText2 ) )
  608.  
  609.     {
  610.  
  611.         self.notifyText2 setParent( anchorElem );
  612.  
  613.        
  614.  
  615.         if ( isDefined( notifyData.text2Label ) )
  616.  
  617.             self.notifyText2.label = notifyData.text2Label;
  618.  
  619.         else
  620.  
  621.             self.notifyText2.label = &"";
  622.  
  623.  
  624.  
  625.         self.notifyText2 setText( notifyData.notifyText2 );
  626.  
  627.         self.notifyText2 setPulseFX( 100, int(duration*1000), 1000 );
  628.  
  629.         self.notifyText2.glowColor = glowColor;
  630.  
  631.         self.notifyText2.alpha = 1;
  632.  
  633.         anchorElem = self.notifyText2;
  634.  
  635.     }
  636.  
  637.  
  638.  
  639.     if ( isDefined( notifyData.iconName ) )
  640.  
  641.     {
  642.  
  643.         self.notifyIcon setParent( anchorElem );
  644.  
  645.         self.notifyIcon setShader( notifyData.iconName, 60, 60 );
  646.  
  647.         self.notifyIcon.alpha = 0;
  648.  
  649.  
  650.  
  651.         if ( isDefined( notifyData.iconOverlay ) )
  652.  
  653.         {
  654.  
  655.             self.notifyIcon fadeOverTime( 0.15 );
  656.  
  657.             self.notifyIcon.alpha = 1;
  658.  
  659.  
  660.  
  661.             //if ( !isDefined( notifyData.overlayOffsetY ) )
  662.  
  663.                 notifyData.overlayOffsetY = 0;
  664.  
  665.  
  666.  
  667.             self.notifyOverlay setParent( self.notifyIcon );
  668.  
  669.             self.notifyOverlay setPoint( "CENTER", "CENTER", 0, notifyData.overlayOffsetY );
  670.  
  671.             self.notifyOverlay setShader( notifyData.iconOverlay, 512, 512 );
  672.  
  673.             self.notifyOverlay.alpha = 0;
  674.  
  675.             self.notifyOverlay.color = (1,0,0);
  676.  
  677.  
  678.  
  679.             self.notifyOverlay fadeOverTime( 0.4 );
  680.  
  681.             self.notifyOverlay.alpha = 0.85;
  682.  
  683.    
  684.  
  685.             self.notifyOverlay scaleOverTime( 0.4, 32, 32 );
  686.  
  687.            
  688.  
  689.             waitRequireVisibility( duration );
  690.  
  691.  
  692.  
  693.             self.notifyIcon fadeOverTime( 0.75 );
  694.  
  695.             self.notifyIcon.alpha = 0;
  696.  
  697.    
  698.  
  699.             self.notifyOverlay fadeOverTime( 0.75 );
  700.  
  701.             self.notifyOverlay.alpha = 0;
  702.  
  703.         }
  704.  
  705.         else
  706.  
  707.         {
  708.  
  709.             self.notifyIcon fadeOverTime( 1.0 );
  710.  
  711.             self.notifyIcon.alpha = 1;
  712.  
  713.  
  714.  
  715.             waitRequireVisibility( duration );
  716.  
  717.  
  718.  
  719.             self.notifyIcon fadeOverTime( 0.75 );
  720.  
  721.             self.notifyIcon.alpha = 0;
  722.  
  723.         }      
  724.  
  725.     }
  726.  
  727.     else
  728.  
  729.     {
  730.  
  731.         waitRequireVisibility( duration );
  732.  
  733.     }
  734.  
  735.  
  736.  
  737.     self notify ( "notifyMessageDone" );
  738.  
  739.     self.doingSplash[ slot ] = undefined;
  740.  
  741.  
  742.  
  743.     if ( self.splashQueue[ slot ].size )
  744.  
  745.         self thread dispatchNotify( slot );
  746.  
  747. }
  748.  
  749.  
  750.  
  751.  
  752.  
  753. killstreakSplashNotify( streakName, streakVal, appendString )
  754.  
  755. {
  756.  
  757.     self endon ( "disconnect" );
  758.  
  759.     waittillframeend;
  760.  
  761.  
  762.  
  763.     if ( level.gameEnded )
  764.  
  765.         return;
  766.  
  767.  
  768.  
  769.     actionData = spawnStruct();
  770.  
  771.    
  772.  
  773.     if ( isDefined( appendString ) )
  774.  
  775.         actionData.name = streakName + "_" + appendString;
  776.  
  777.     else
  778.  
  779.         actionData.name = streakName;
  780.  
  781.  
  782.  
  783.     actionData.type = "killstreak";
  784.  
  785.     actionData.optionalNumber = streakVal; 
  786.  
  787.     actionData.sound = maps\mp\killstreaks\_killstreaks::getKillstreakSound( streakName );
  788.  
  789.     actionData.leaderSound = streakName;
  790.  
  791.     actionData.leaderSoundGroup = "killstreak_earned";
  792.  
  793.     actionData.slot = 0;
  794.  
  795.  
  796.  
  797.     self thread actionNotify( actionData );
  798.  
  799. }
  800.  
  801.  
  802.  
  803.  
  804.  
  805. defconSplashNotify( defconLevel, forceNotify )
  806.  
  807. {
  808.  
  809.     /*
  810.  
  811.     actionData = spawnStruct();
  812.  
  813.    
  814.  
  815.     actionData.name = "defcon_" + defconLevel;
  816.  
  817.     actionData.sound = tableLookup( "mp/splashTable.csv", 0, actionData.name, 9 );
  818.  
  819.     actionData.slot = 0;
  820.  
  821.     actionData.forceNotify = forceNotify;
  822.  
  823.  
  824.  
  825.     self thread actionNotify( actionData );
  826.  
  827.     */
  828.  
  829. }
  830.  
  831.  
  832.  
  833.  
  834.  
  835. challengeSplashNotify( challengeRef )
  836.  
  837. {
  838.  
  839.     self endon ( "disconnect" );
  840.  
  841.     waittillframeend;
  842.  
  843.    
  844.  
  845.     // this is used to ensure the client receives the new challenge state before the splash is shown.
  846.  
  847.     wait ( 0.05 );
  848.  
  849.  
  850.  
  851.     //subtracting one from state becase state was incremented after completing challenge
  852.  
  853.     challengeState = ( self getPlayerData( "challengeState", challengeRef )  - 1 );
  854.  
  855.     challengeTarget = int( tableLookup( "mp/allChallengesTable.csv", 0, challengeRef, 6 + ((challengeState-1)*2) ) );
  856.  
  857.    
  858.  
  859.     if( challengeTarget == 0 )
  860.  
  861.         challengeTarget = 1;
  862.  
  863.    
  864.  
  865.     if( isSubStr( challengeRef,  "marathon" ) || isSubStr( challengeRef,  "lightweight" ) )
  866.  
  867.         challengeTarget = int( challengeTarget/5280 );
  868.  
  869.    
  870.  
  871.     actionData = spawnStruct();
  872.  
  873.     actionData.type = "challenge";
  874.  
  875.     actionData.optionalNumber = challengeTarget;
  876.  
  877.     actionData.name = challengeRef;
  878.  
  879.     actionData.sound = tableLookup( "mp/splashTable.csv", 0, actionData.name, 9 );
  880.  
  881.     actionData.slot = 0;
  882.  
  883.  
  884.  
  885.     self thread actionNotify( actionData );
  886.  
  887. }
  888.  
  889.  
  890.  
  891.  
  892.  
  893. splashNotify( text, optionalNumber )
  894.  
  895. {
  896.  
  897.     self endon ( "disconnect" );
  898.  
  899.     // wait until any challenges have been processed
  900.  
  901.     //self waittill( "playerKilledChallengesProcessed" );
  902.  
  903.     wait .05;
  904.  
  905.  
  906.  
  907.     actionData = spawnStruct();
  908.  
  909.    
  910.  
  911.     actionData.name = text;
  912.  
  913.     actionData.optionalNumber = optionalNumber;
  914.  
  915.     actionData.sound = tableLookup( "mp/splashTable.csv", 0, actionData.name, 9 );
  916.  
  917.     actionData.slot = 0;
  918.  
  919.  
  920.  
  921.     self thread actionNotify( actionData );
  922.  
  923. }
  924.  
  925.  
  926.  
  927.  
  928.  
  929. splashNotifyDelayed( text, optionalNumber )
  930.  
  931. {
  932.  
  933.     if ( level.hardcoreMode )
  934.  
  935.         return;
  936.  
  937.    
  938.  
  939.     self endon ( "disconnect" );
  940.  
  941.     waittillframeend;
  942.  
  943.  
  944.  
  945.     if ( level.gameEnded )
  946.  
  947.         return;
  948.  
  949.  
  950.  
  951.     actionData = spawnStruct();
  952.  
  953.    
  954.  
  955.     actionData.name = text;
  956.  
  957.     actionData.optionalNumber = optionalNumber;
  958.  
  959.     actionData.sound = tableLookup( "mp/splashTable.csv", 0, actionData.name, 9 );
  960.  
  961.     actionData.slot = 0;
  962.  
  963.  
  964.  
  965.     self thread actionNotify( actionData );
  966.  
  967. }
  968.  
  969.  
  970.  
  971.  
  972.  
  973. playerCardSplashNotify( splashRef, player, optionalNumber )
  974.  
  975. {
  976.  
  977.     self endon ( "disconnect" );
  978.  
  979.     waittillframeend;
  980.  
  981.  
  982.  
  983.     if ( level.gameEnded )
  984.  
  985.         return;
  986.  
  987.  
  988.  
  989.     actionData = spawnStruct();
  990.  
  991.    
  992.  
  993.     actionData.name = splashRef;
  994.  
  995.     actionData.optionalNumber = optionalNumber;
  996.  
  997.     actionData.sound = tableLookup( "mp/splashTable.csv", 0, actionData.name, 9 );
  998.  
  999.     actionData.playerCardPlayer = player;
  1000.  
  1001.     actionData.slot = 1;
  1002.  
  1003.  
  1004.  
  1005.     self thread actionNotify( actionData );
  1006.  
  1007. }
  1008.  
  1009.  
  1010.  
  1011.  
  1012.  
  1013. actionNotify( actionData )
  1014.  
  1015. {
  1016.  
  1017.     self endon ( "death" );
  1018.  
  1019.     self endon ( "disconnect" );
  1020.  
  1021.    
  1022.  
  1023.     assert( isDefined( actionData.slot ) );
  1024.  
  1025.    
  1026.  
  1027.     slot = actionData.slot;
  1028.  
  1029.  
  1030.  
  1031.     if ( !isDefined( actionData.type ) )
  1032.  
  1033.         actionData.type = "";
  1034.  
  1035.    
  1036.  
  1037.     if ( !isDefined( self.doingSplash[ slot ] ) )
  1038.  
  1039.     {
  1040.  
  1041.         self thread actionNotifyMessage( actionData );
  1042.  
  1043.         return;
  1044.  
  1045.     }
  1046.  
  1047.     else if ( actionData.type == "killstreak" && self.doingSplash[ slot ].type != "challenge" && self.doingSplash[ slot ].type != "rank" )
  1048.  
  1049.     {
  1050.  
  1051.         self.notifyText.alpha = 0;
  1052.  
  1053.         self.notifyText2.alpha = 0;
  1054.  
  1055.         self.notifyIcon.alpha = 0;
  1056.  
  1057.         self thread actionNotifyMessage( actionData );
  1058.  
  1059.         return;
  1060.  
  1061.     }
  1062.  
  1063.     else if ( actionData.type == "challenge" && self.doingSplash[ slot ].type != "killstreak" && self.doingSplash[ slot ].type != "challenge" && self.doingSplash[ slot ].type != "rank" )
  1064.  
  1065.     {
  1066.  
  1067.         self.notifyText.alpha = 0;
  1068.  
  1069.         self.notifyText2.alpha = 0;
  1070.  
  1071.         self.notifyIcon.alpha = 0;
  1072.  
  1073.         self thread actionNotifyMessage( actionData );
  1074.  
  1075.         return;
  1076.  
  1077.     }  
  1078.  
  1079.    
  1080.  
  1081.     // push to front of queue
  1082.  
  1083.     if ( actionData.type == "challenge" || actionData.type == "killstreak" )
  1084.  
  1085.     {
  1086.  
  1087.         if ( actionData.type == "killstreak" )
  1088.  
  1089.             self removeTypeFromQueue( "killstreak", slot );
  1090.  
  1091.        
  1092.  
  1093.         for ( i = self.splashQueue[ slot ].size; i > 0; i-- )
  1094.  
  1095.             self.splashQueue[ slot ][ i ] = self.splashQueue[ slot ][ i-1 ];
  1096.  
  1097.  
  1098.  
  1099.         self.splashQueue[ slot ][ 0 ] = actionData;
  1100.  
  1101.     }
  1102.  
  1103.     else
  1104.  
  1105.     {
  1106.  
  1107.         self.splashQueue[ slot ][ self.splashQueue[ slot ].size ] = actionData;
  1108.  
  1109.     }
  1110.  
  1111. }
  1112.  
  1113.  
  1114.  
  1115.  
  1116.  
  1117. removeTypeFromQueue( actionType, slot )
  1118.  
  1119. {
  1120.  
  1121.     newQueue = [];
  1122.  
  1123.  
  1124.  
  1125.     for ( i = 0; i < self.splashQueue[ slot ].size; i++ )
  1126.  
  1127.     {
  1128.  
  1129.         if ( self.splashQueue[ slot ][ i ].type != "killstreak" )
  1130.  
  1131.             newQueue[ newQueue.size ] = self.splashQueue[ slot ][ i ];
  1132.  
  1133.     }
  1134.  
  1135.  
  1136.  
  1137.     self.splashQueue[ slot ] = newQueue;
  1138.  
  1139. }
  1140.  
  1141.  
  1142.  
  1143.  
  1144.  
  1145. actionNotifyMessage( actionData )
  1146.  
  1147. {
  1148.  
  1149.     self endon ( "disconnect" );
  1150.  
  1151.  
  1152.  
  1153.     assert( isDefined( actionData.slot ) );
  1154.  
  1155.     slot = actionData.slot;
  1156.  
  1157.    
  1158.  
  1159.     if ( level.gameEnded )
  1160.  
  1161.     {
  1162.  
  1163.         // added to prevent potential stack overflow
  1164.  
  1165.         wait ( 0 );
  1166.  
  1167.  
  1168.  
  1169.         if ( isDefined( actionData.type ) && actionData.type == "rank" )
  1170.  
  1171.         {
  1172.  
  1173.             self setClientDvar( "ui_promotion", 1 );
  1174.  
  1175.             self.postGamePromotion = true;
  1176.  
  1177.         }      
  1178.  
  1179.         else if ( isDefined( actionData.type ) && actionData.type == "challenge" )
  1180.  
  1181.         {
  1182.  
  1183.             self.pers["postGameChallenges"]++;
  1184.  
  1185.             self setClientDvar( "ui_challenge_"+ self.pers["postGameChallenges"] +"_ref", actionData.name );
  1186.  
  1187.         }
  1188.  
  1189.  
  1190.  
  1191.         if ( self.splashQueue[ slot ].size )
  1192.  
  1193.             self thread dispatchNotify( slot );
  1194.  
  1195.  
  1196.  
  1197.         return;
  1198.  
  1199.     }
  1200.  
  1201.  
  1202.  
  1203.     assertEx( tableLookup( "mp/splashTable.csv", 0, actionData.name, 0 ) != "", "ERROR: unknown splash - " + actionData.name );
  1204.  
  1205.  
  1206.  
  1207.     // defensive ship hack for missing table entries
  1208.  
  1209.     if ( tableLookup( "mp/splashTable.csv", 0, actionData.name, 0 ) != "" )
  1210.  
  1211.     {
  1212.  
  1213.         if ( isDefined( actionData.playerCardPlayer ) )
  1214.  
  1215.             self SetCardDisplaySlot( actionData.playerCardPlayer, 5 );
  1216.  
  1217.        
  1218.  
  1219.         if ( isDefined( actionData.optionalNumber ) )
  1220.  
  1221.             self ShowHudSplash( actionData.name, actionData.slot, actionData.optionalNumber );
  1222.  
  1223.         else
  1224.  
  1225.             self ShowHudSplash( actionData.name, actionData.slot );
  1226.  
  1227.    
  1228.  
  1229.         self.doingSplash[ slot ] = actionData;
  1230.  
  1231.    
  1232.  
  1233.         duration = stringToFloat( tableLookup( "mp/splashTable.csv", 0, actionData.name, 4 ) );
  1234.  
  1235.        
  1236.  
  1237.         if ( isDefined( actionData.sound ) )
  1238.  
  1239.             self playLocalSound( actionData.sound );
  1240.  
  1241.    
  1242.  
  1243.         if ( isDefined( actionData.leaderSound ) )
  1244.  
  1245.         {
  1246.  
  1247.             if ( isDefined( actionData.leaderSoundGroup ) )
  1248.  
  1249.                 self leaderDialogOnPlayer( actionData.leaderSound, actionData.leaderSoundGroup, true );
  1250.  
  1251.             else
  1252.  
  1253.                 self leaderDialogOnPlayer( actionData.leaderSound );
  1254.  
  1255.         }
  1256.  
  1257.    
  1258.  
  1259.         self notify ( "actionNotifyMessage" + slot );
  1260.  
  1261.         self endon ( "actionNotifyMessage" + slot );
  1262.  
  1263.    
  1264.  
  1265.         wait ( duration - 0.05 );
  1266.  
  1267.    
  1268.  
  1269.         self.doingSplash[ slot ] = undefined;
  1270.  
  1271.     }
  1272.  
  1273.  
  1274.  
  1275.     if ( self.splashQueue[ slot ].size )
  1276.  
  1277.         self thread dispatchNotify( slot );
  1278.  
  1279. }
  1280.  
  1281.  
  1282.  
  1283.  
  1284.  
  1285. // waits for waitTime, plus any time required to let flashbangs go away.
  1286.  
  1287. waitRequireVisibility( waitTime )
  1288.  
  1289. {
  1290.  
  1291.     interval = .05;
  1292.  
  1293.    
  1294.  
  1295.     while ( !self canReadText() )
  1296.  
  1297.         wait interval;
  1298.  
  1299.    
  1300.  
  1301.     while ( waitTime > 0 )
  1302.  
  1303.     {
  1304.  
  1305.         wait interval;
  1306.  
  1307.         if ( self canReadText() )
  1308.  
  1309.             waitTime -= interval;
  1310.  
  1311.     }
  1312.  
  1313. }
  1314.  
  1315.  
  1316.  
  1317.  
  1318.  
  1319. canReadText()
  1320.  
  1321. {
  1322.  
  1323.     if ( self maps\mp\_flashgrenades::isFlashbanged() )
  1324.  
  1325.         return false;
  1326.  
  1327.    
  1328.  
  1329.     return true;
  1330.  
  1331. }
  1332.  
  1333.  
  1334.  
  1335.  
  1336.  
  1337. resetOnDeath()
  1338.  
  1339. {
  1340.  
  1341.     self endon ( "notifyMessageDone" );
  1342.  
  1343.     self endon ( "disconnect" );
  1344.  
  1345.     level endon ( "game_ended" );
  1346.  
  1347.     self waittill ( "death" );
  1348.  
  1349.  
  1350.  
  1351.     resetNotify();
  1352.  
  1353. }
  1354.  
  1355.  
  1356.  
  1357.  
  1358.  
  1359. resetOnCancel()
  1360.  
  1361. {
  1362.  
  1363.     self notify ( "resetOnCancel" );
  1364.  
  1365.     self endon ( "resetOnCancel" );
  1366.  
  1367.     self endon ( "notifyMessageDone" );
  1368.  
  1369.     self endon ( "disconnect" );
  1370.  
  1371.  
  1372.  
  1373.     level waittill ( "cancel_notify" );
  1374.  
  1375.    
  1376.  
  1377.     resetNotify();
  1378.  
  1379. }
  1380.  
  1381.  
  1382.  
  1383.  
  1384.  
  1385. resetNotify()
  1386.  
  1387. {
  1388.  
  1389.     self.notifyTitle.alpha = 0;
  1390.  
  1391.     self.notifyText.alpha = 0;
  1392.  
  1393.     self.notifyIcon.alpha = 0;
  1394.  
  1395.     self.notifyOverlay.alpha = 0;
  1396.  
  1397.    
  1398.  
  1399.     self.doingSplash[0] = undefined;
  1400.  
  1401.     self.doingSplash[1] = undefined;
  1402.  
  1403.     self.doingSplash[2] = undefined;
  1404.  
  1405.     self.doingSplash[3] = undefined;
  1406.  
  1407. }
  1408.  
  1409.  
  1410.  
  1411.  
  1412.  
  1413. hintMessageDeathThink()
  1414.  
  1415. {
  1416.  
  1417.     self endon ( "disconnect" );
  1418.  
  1419.  
  1420.  
  1421.     for ( ;; )
  1422.  
  1423.     {
  1424.  
  1425.         self waittill ( "death" );
  1426.  
  1427.        
  1428.  
  1429.         if ( isDefined( self.hintMessage ) )
  1430.  
  1431.             self.hintMessage destroyElem();
  1432.  
  1433.     }
  1434.  
  1435. }
  1436.  
  1437.  
  1438.  
  1439. lowerMessageThink()
  1440.  
  1441. {
  1442.  
  1443.     self endon ( "disconnect" );
  1444.  
  1445.    
  1446.  
  1447.     self.lowerMessages = [];
  1448.  
  1449.    
  1450.  
  1451.     self.lowerMessage = createFontString( "default", level.lowerTextFontSize );
  1452.  
  1453.     self.lowerMessage setPoint( "CENTER", level.lowerTextYAlign, 0, level.lowerTextY );
  1454.  
  1455.     self.lowerMessage setText( "" );
  1456.  
  1457.     self.lowerMessage.archived = false;
  1458.  
  1459.     self.lowerMessage.sort = 10;
  1460.  
  1461.    
  1462.  
  1463.     timerFontSize = 0.75;
  1464.  
  1465.     if ( level.splitscreen )
  1466.  
  1467.         timerFontSize = 0.5;
  1468.  
  1469.    
  1470.  
  1471.     self.lowerTimer = createFontString( "hudbig", timerFontSize );
  1472.  
  1473.     self.lowerTimer setParent( self.lowerMessage );
  1474.  
  1475.     self.lowerTimer setPoint( "TOP", "BOTTOM", 0, 0 );
  1476.  
  1477.     self.lowerTimer setText( "" );
  1478.  
  1479.     self.lowerTimer.archived = false;
  1480.  
  1481.     self.lowerTimer.sort = 10;
  1482.  
  1483. }
  1484.  
  1485.  
  1486.  
  1487.  
  1488.  
  1489. outcomeOverlay( winner )
  1490.  
  1491. {
  1492.  
  1493.     if ( level.teamBased )
  1494.  
  1495.     {
  1496.  
  1497.         if ( winner == "tie" )
  1498.  
  1499.             self matchOutcomeNotify( "draw" );
  1500.  
  1501.         else if ( winner == self.team )
  1502.  
  1503.             self matchOutcomeNotify( "victory" );
  1504.  
  1505.         else
  1506.  
  1507.             self matchOutcomeNotify( "defeat" );
  1508.  
  1509.     }
  1510.  
  1511.     else
  1512.  
  1513.     {
  1514.  
  1515.         if ( winner == self )
  1516.  
  1517.             self matchOutcomeNotify( "victory" );
  1518.  
  1519.         else
  1520.  
  1521.             self matchOutcomeNotify( "defeat" );
  1522.  
  1523.     }
  1524.  
  1525. }
  1526.  
  1527.  
  1528.  
  1529.  
  1530.  
  1531. matchOutcomeNotify( outcome )
  1532.  
  1533. {
  1534.  
  1535.     team = self.team;
  1536.  
  1537.    
  1538.  
  1539.     outcomeTitle = createFontString( "bigfixed", 1.0 );
  1540.  
  1541.     outcomeTitle setPoint( "TOP", undefined, 0, 50 );
  1542.  
  1543.     outcomeTitle.foreground = true;
  1544.  
  1545.     outcomeTitle.glowAlpha = 1;
  1546.  
  1547.     outcomeTitle.hideWhenInMenu = false;
  1548.  
  1549.     outcomeTitle.archived = false;
  1550.  
  1551.  
  1552.  
  1553.     outcomeTitle setText( game["strings"][outcome] );
  1554.  
  1555.     outcomeTitle.alpha = 0;
  1556.  
  1557.     outcomeTitle fadeOverTime( 0.5 );
  1558.  
  1559.     outcomeTitle.alpha = 1;
  1560.  
  1561.    
  1562.  
  1563.     switch( outcome )
  1564.  
  1565.     {
  1566.  
  1567.         case "victory":
  1568.  
  1569.             outcomeTitle.glowColor = (0.6, 0.9, 0.6);
  1570.  
  1571.             break;
  1572.  
  1573.         default:
  1574.  
  1575.             outcomeTitle.glowColor = (0.9, 0.6, 0.6);
  1576.  
  1577.             break;
  1578.  
  1579.     }
  1580.  
  1581.  
  1582.  
  1583.     centerIcon = createIcon( game["icons"][team], 64, 64 );
  1584.  
  1585.     centerIcon setParent( outcomeTitle );
  1586.  
  1587.     centerIcon setPoint( "TOP", "BOTTOM", 0, 30 );
  1588.  
  1589.     centerIcon.foreground = true;
  1590.  
  1591.     centerIcon.hideWhenInMenu = false;
  1592.  
  1593.     centerIcon.archived = false;
  1594.  
  1595.     centerIcon.alpha = 0;
  1596.  
  1597.     centerIcon fadeOverTime( 0.5 );
  1598.  
  1599.     centerIcon.alpha = 1;  
  1600.  
  1601.    
  1602.  
  1603.     wait ( 3.0 );
  1604.  
  1605.    
  1606.  
  1607.     outcomeTitle destroyElem();
  1608.  
  1609.     centerIcon destroyElem();
  1610.  
  1611. }
  1612.  
  1613.  
  1614.  
  1615.  
  1616.  
  1617. isDoingSplash()
  1618.  
  1619. {
  1620.  
  1621.     if ( isDefined( self.doingSplash[0] ) )
  1622.  
  1623.         return true;
  1624.  
  1625.  
  1626.  
  1627.     if ( isDefined( self.doingSplash[1] ) )
  1628.  
  1629.         return true;
  1630.  
  1631.  
  1632.  
  1633.     if ( isDefined( self.doingSplash[2] ) )
  1634.  
  1635.         return true;
  1636.  
  1637.  
  1638.  
  1639.     if ( isDefined( self.doingSplash[3] ) )
  1640.  
  1641.         return true;
  1642.  
  1643.  
  1644.  
  1645.     return false;      
  1646.  
  1647. }
  1648.  
  1649.  
  1650.  
  1651.  
  1652.  
  1653. teamOutcomeNotify( winner, isRound, endReasonText )
  1654.  
  1655. {
  1656.  
  1657.     self endon ( "disconnect" );
  1658.  
  1659.     self notify ( "reset_outcome" );
  1660.  
  1661.  
  1662.  
  1663.     wait ( 0.5 );
  1664.  
  1665.  
  1666.  
  1667.     team = self.pers["team"];
  1668.  
  1669.     if ( !isDefined( team ) || (team != "allies" && team != "axis") )
  1670.  
  1671.         team = "allies";
  1672.  
  1673.  
  1674.  
  1675.     // wait for notifies to finish
  1676.  
  1677.     while ( self isDoingSplash() )
  1678.  
  1679.         wait 0.05;
  1680.  
  1681.  
  1682.  
  1683.     self endon ( "reset_outcome" );
  1684.  
  1685.    
  1686.  
  1687.     if ( level.splitscreen )
  1688.  
  1689.     {
  1690.  
  1691.         // These are mostly fullscreen values divided by 1.5
  1692.  
  1693.         titleSize = 1;
  1694.  
  1695.         titleOffset = -76;
  1696.  
  1697.         textSize = 0.667;
  1698.  
  1699.         textOffset = 12;
  1700.  
  1701.         numberSize = 0.833;
  1702.  
  1703.         iconSize = 46;
  1704.  
  1705.         iconSpacingH = 40;
  1706.  
  1707.         iconSpacing = 30;
  1708.  
  1709.         scoreSpacing = 0;
  1710.  
  1711.         bonusSpacing = 60;
  1712.  
  1713.         font = "hudbig";
  1714.  
  1715.     }
  1716.  
  1717.     else
  1718.  
  1719.     {
  1720.  
  1721.         titleSize = 1.5;
  1722.  
  1723.         titleOffset = -134;
  1724.  
  1725.         textSize = 1.0;
  1726.  
  1727.         textOffset = 18;
  1728.  
  1729.         numberSize = 1.25;
  1730.  
  1731.         iconSize = 70;
  1732.  
  1733.         iconSpacingH = 60;
  1734.  
  1735.         iconSpacing = 45;
  1736.  
  1737.         scoreSpacing = 0;
  1738.  
  1739.         bonusSpacing = 90;
  1740.  
  1741.         font = "hudbig";
  1742.  
  1743.     }
  1744.  
  1745.  
  1746.  
  1747.     duration = 60000;
  1748.  
  1749.  
  1750.  
  1751.     outcomeTitle = createFontString( font, titleSize );
  1752.  
  1753.     outcomeTitle setPoint( "CENTER", undefined, 0, titleOffset );
  1754.  
  1755.     outcomeTitle.foreground = true;
  1756.  
  1757.     outcomeTitle.glowAlpha = 1;
  1758.  
  1759.     outcomeTitle.hideWhenInMenu = false;
  1760.  
  1761.     outcomeTitle.archived = false;
  1762.  
  1763.  
  1764.  
  1765.     outcomeText = createFontString( font, textSize );
  1766.  
  1767.     outcomeText setParent( outcomeTitle );
  1768.  
  1769.     outcomeText.foreground = true;
  1770.  
  1771.     outcomeText setPoint( "TOP", "BOTTOM", 0, textOffset );
  1772.  
  1773.     outcomeText.glowAlpha = 1;
  1774.  
  1775.     outcomeText.hideWhenInMenu = false;
  1776.  
  1777.     outcomeText.archived = false;
  1778.  
  1779.    
  1780.  
  1781.     if ( winner == "halftime" )
  1782.  
  1783.     {
  1784.  
  1785.         outcomeTitle.glowColor = (0.2, 0.3, 0.7);
  1786.  
  1787.         outcomeTitle setText( game["strings"]["halftime"] );
  1788.  
  1789.         outcomeTitle.color = (1, 1, 1);
  1790.  
  1791.        
  1792.  
  1793.         winner = "allies";
  1794.  
  1795.     }
  1796.  
  1797.     else if ( winner == "intermission" )
  1798.  
  1799.     {
  1800.  
  1801.         outcomeTitle.glowColor = (0.2, 0.3, 0.7);
  1802.  
  1803.         outcomeTitle setText( game["strings"]["intermission"] );
  1804.  
  1805.         outcomeTitle.color = (1, 1, 1);
  1806.  
  1807.        
  1808.  
  1809.         winner = "allies";
  1810.  
  1811.     }
  1812.  
  1813.     else if ( winner == "roundend" )
  1814.  
  1815.     {
  1816.  
  1817.         outcomeTitle.glowColor = (0.2, 0.3, 0.7);
  1818.  
  1819.         outcomeTitle setText( game["strings"]["roundend"] );
  1820.  
  1821.         outcomeTitle.color = (1, 1, 1);
  1822.  
  1823.        
  1824.  
  1825.         winner = "allies";
  1826.  
  1827.     }
  1828.  
  1829.     else if ( winner == "overtime" )
  1830.  
  1831.     {
  1832.  
  1833.         outcomeTitle.glowColor = (0.2, 0.3, 0.7);
  1834.  
  1835.         outcomeTitle setText( game["strings"]["overtime"] );
  1836.  
  1837.         outcomeTitle.color = (1, 1, 1);
  1838.  
  1839.        
  1840.  
  1841.         winner = "allies";
  1842.  
  1843.     }
  1844.  
  1845.     else if ( winner == "tie" )
  1846.  
  1847.     {
  1848.  
  1849.         outcomeTitle.glowColor = (0.2, 0.3, 0.7);
  1850.  
  1851.         if ( isRound )
  1852.  
  1853.             outcomeTitle setText( game["strings"]["round_draw"] );
  1854.  
  1855.         else
  1856.  
  1857.             outcomeTitle setText( game["strings"]["draw"] );
  1858.  
  1859.         outcomeTitle.color = (1, 1, 1);
  1860.  
  1861.        
  1862.  
  1863.         winner = "allies";
  1864.  
  1865.     }
  1866.  
  1867.     else if ( isDefined( self.pers["team"] ) && winner == team )
  1868.  
  1869.     {
  1870.  
  1871.         outcomeTitle.glowColor = (0, 0, 0);
  1872.  
  1873.         if ( isRound )
  1874.  
  1875.             outcomeTitle setText( game["strings"]["round_win"] );
  1876.  
  1877.         else
  1878.  
  1879.             outcomeTitle setText( game["strings"]["victory"] );
  1880.  
  1881.         outcomeTitle.color = (0.6, 0.9, 0.6);
  1882.  
  1883.     }
  1884.  
  1885.     else
  1886.  
  1887.     {
  1888.  
  1889.         outcomeTitle.glowColor = (0, 0, 0);
  1890.  
  1891.         if ( isRound )
  1892.  
  1893.             outcomeTitle setText( game["strings"]["round_loss"] );
  1894.  
  1895.         else
  1896.  
  1897.             outcomeTitle setText( game["strings"]["defeat"] );
  1898.  
  1899.         outcomeTitle.color = (0.7, 0.3, 0.2);
  1900.  
  1901.     }
  1902.  
  1903.    
  1904.  
  1905.     outcomeText.glowColor = (0.2, 0.3, 0.7);
  1906.  
  1907.     outcomeText setText( endReasonText );
  1908.  
  1909.    
  1910.  
  1911.     outcomeTitle setPulseFX( 100, duration, 1000 );
  1912.  
  1913.     outcomeText setPulseFX( 100, duration, 1000 );
  1914.  
  1915.    
  1916.  
  1917.     if ( getIntProperty( "useRelativeTeamColors", 0 ) )
  1918.  
  1919.         leftIcon = createIcon( game["icons"][team] + "_blue", iconSize, iconSize );
  1920.  
  1921.     else
  1922.  
  1923.         leftIcon = createIcon( game["icons"][team], iconSize, iconSize );
  1924.  
  1925.     leftIcon setParent( outcomeText );
  1926.  
  1927.     leftIcon setPoint( "TOP", "BOTTOM", (iconSpacingH*-1), iconSpacing );
  1928.  
  1929.     leftIcon.foreground = true;
  1930.  
  1931.     leftIcon.hideWhenInMenu = false;
  1932.  
  1933.     leftIcon.archived = false;
  1934.  
  1935.     leftIcon.alpha = 0;
  1936.  
  1937.     leftIcon fadeOverTime( 0.5 );
  1938.  
  1939.     leftIcon.alpha = 1;
  1940.  
  1941.  
  1942.  
  1943.     if ( getIntProperty( "useRelativeTeamColors", 0 ) )
  1944.  
  1945.         rightIcon = createIcon( game["icons"][level.otherTeam[team]] + "_red", iconSize, iconSize );
  1946.  
  1947.     else
  1948.  
  1949.         rightIcon = createIcon( game["icons"][level.otherTeam[team]], iconSize, iconSize );
  1950.  
  1951.     rightIcon setParent( outcomeText );
  1952.  
  1953.     rightIcon setPoint( "TOP", "BOTTOM", iconSpacingH, iconSpacing );
  1954.  
  1955.     rightIcon.foreground = true;
  1956.  
  1957.     rightIcon.hideWhenInMenu = false;
  1958.  
  1959.     rightIcon.archived = false;
  1960.  
  1961.     rightIcon.alpha = 0;
  1962.  
  1963.     rightIcon fadeOverTime( 0.5 );
  1964.  
  1965.     rightIcon.alpha = 1;
  1966.  
  1967.  
  1968.  
  1969.     leftScore = createFontString( font, numberSize );
  1970.  
  1971.     leftScore setParent( leftIcon );
  1972.  
  1973.     leftScore setPoint( "TOP", "BOTTOM", 0, scoreSpacing );
  1974.  
  1975.     if ( getIntProperty( "useRelativeTeamColors", 0 ) )
  1976.  
  1977.         leftScore.glowColor = game["colors"]["blue"];
  1978.  
  1979.     else
  1980.  
  1981.         leftScore.glowColor = game["colors"][team];
  1982.  
  1983.     leftScore.glowAlpha = 1;
  1984.  
  1985.     if ( !isRoundBased() || !isObjectiveBased() )
  1986.  
  1987.         leftScore setValue( maps\mp\gametypes\_gamescore::_getTeamScore( team ) );
  1988.  
  1989.     else
  1990.  
  1991.         leftScore setValue( game["roundsWon"][team] );
  1992.  
  1993.     leftScore.foreground = true;
  1994.  
  1995.     leftScore.hideWhenInMenu = false;
  1996.  
  1997.     leftScore.archived = false;
  1998.  
  1999.     leftScore setPulseFX( 100, duration, 1000 );
  2000.  
  2001.  
  2002.  
  2003.     rightScore = createFontString( font, numberSize );
  2004.  
  2005.     rightScore setParent( rightIcon );
  2006.  
  2007.     rightScore setPoint( "TOP", "BOTTOM", 0, scoreSpacing );
  2008.  
  2009.     if ( getIntProperty( "useRelativeTeamColors", 0 ) )
  2010.  
  2011.         rightScore.glowColor = game["colors"]["red"];
  2012.  
  2013.     else
  2014.  
  2015.         rightScore.glowColor = game["colors"][level.otherTeam[team]];
  2016.  
  2017.     rightScore.glowAlpha = 1;
  2018.  
  2019.     if ( !isRoundBased() || !isObjectiveBased() )
  2020.  
  2021.         rightScore setValue( maps\mp\gametypes\_gamescore::_getTeamScore( level.otherTeam[team] ) );
  2022.  
  2023.     else
  2024.  
  2025.         rightScore setValue( game["roundsWon"][level.otherTeam[team]] );
  2026.  
  2027.     rightScore.foreground = true;
  2028.  
  2029.     rightScore.hideWhenInMenu = false;
  2030.  
  2031.     rightScore.archived = false;
  2032.  
  2033.     rightScore setPulseFX( 100, duration, 1000 );
  2034.  
  2035.  
  2036.  
  2037.     matchBonus = undefined;
  2038.  
  2039.     if ( isDefined( self.matchBonus ) )
  2040.  
  2041.     {
  2042.  
  2043.         matchBonus = createFontString( font, textSize );
  2044.  
  2045.         matchBonus setParent( outcomeText );
  2046.  
  2047.         matchBonus setPoint( "TOP", "BOTTOM", 0, iconSize + bonusSpacing + leftScore.height );
  2048.  
  2049.         matchBonus.glowAlpha = 1;
  2050.  
  2051.         matchBonus.foreground = true;
  2052.  
  2053.         matchBonus.hideWhenInMenu = false;
  2054.  
  2055.         matchBonus.color = (1,1,0.5);
  2056.  
  2057.         matchBonus.archived = false;
  2058.  
  2059.         matchBonus.label = game["strings"]["match_bonus"];
  2060.  
  2061.         matchBonus setValue( self.matchBonus );
  2062.  
  2063.     }
  2064.  
  2065.    
  2066.  
  2067.     self thread resetTeamOutcomeNotify( outcomeTitle, outcomeText, leftIcon, rightIcon, leftScore, rightScore, matchBonus );
  2068.  
  2069. }
  2070.  
  2071.  
  2072.  
  2073.  
  2074.  
  2075. outcomeNotify( winner, endReasonText )
  2076.  
  2077. {
  2078.  
  2079.     self endon ( "disconnect" );
  2080.  
  2081.     self notify ( "reset_outcome" );
  2082.  
  2083.    
  2084.  
  2085.     // wait for notifies to finish
  2086.  
  2087.     while ( self isDoingSplash() )
  2088.  
  2089.         wait 0.05;
  2090.  
  2091.  
  2092.  
  2093.     self endon ( "reset_outcome" );
  2094.  
  2095.    
  2096.  
  2097.     if ( getDvar( "g_gametype" ) == "oitc" )
  2098.  
  2099.     {
  2100.  
  2101.         maps\mp\gametypes\_bohud::showEndGameScores();
  2102.  
  2103.     }
  2104.  
  2105.     else
  2106.  
  2107.     {
  2108.  
  2109.  
  2110.  
  2111.         if ( level.splitscreen )
  2112.  
  2113.         {
  2114.  
  2115.             titleSize = 2.0;
  2116.  
  2117.             winnerSize = 1.5;
  2118.  
  2119.             otherSize = 1.5;
  2120.  
  2121.             iconSize = 30;
  2122.  
  2123.             spacing = 2;
  2124.  
  2125.             font = "default";
  2126.  
  2127.         }
  2128.  
  2129.         else
  2130.  
  2131.         {
  2132.  
  2133.             titleSize = 3.0;
  2134.  
  2135.             winnerSize = 2.0;
  2136.  
  2137.             otherSize = 1.5;
  2138.  
  2139.             iconSize = 30;
  2140.  
  2141.             spacing = 20;
  2142.  
  2143.             font = "objective";
  2144.  
  2145.         }
  2146.  
  2147.  
  2148.  
  2149.         duration = 60000;
  2150.  
  2151.  
  2152.  
  2153.         players = level.placement["all"];
  2154.  
  2155.            
  2156.  
  2157.         outcomeTitle = createFontString( font, titleSize );
  2158.  
  2159.         outcomeTitle setPoint( "TOP", undefined, 0, spacing );
  2160.  
  2161.         if ( isDefined( players[1] ) && players[0].score == players[1].score && players[0].deaths == players[1].deaths && (self == players[0] || self == players[1]) )
  2162.  
  2163.         {
  2164.  
  2165.             outcomeTitle setText( game["strings"]["tie"] );
  2166.  
  2167.             outcomeTitle.glowColor = (0.2, 0.3, 0.7);
  2168.  
  2169.         }
  2170.  
  2171.         else if ( isDefined( players[2] ) && players[0].score == players[2].score && players[0].deaths == players[2].deaths && self == players[2] )
  2172.  
  2173.         {
  2174.  
  2175.             outcomeTitle setText( game["strings"]["tie"] );
  2176.  
  2177.             outcomeTitle.glowColor = (0.2, 0.3, 0.7);
  2178.  
  2179.         }
  2180.  
  2181.         else if ( isDefined( players[0] ) && self == players[0] )
  2182.  
  2183.         {
  2184.  
  2185.             outcomeTitle setText( game["strings"]["victory"] );
  2186.  
  2187.             outcomeTitle.glowColor = (0.2, 0.3, 0.7);
  2188.  
  2189.         }
  2190.  
  2191.         else
  2192.  
  2193.         {
  2194.  
  2195.             outcomeTitle setText( game["strings"]["defeat"] );
  2196.  
  2197.             outcomeTitle.glowColor = (0.7, 0.3, 0.2);
  2198.  
  2199.         }
  2200.  
  2201.         outcomeTitle.glowAlpha = 1;
  2202.  
  2203.         outcomeTitle.foreground = true;
  2204.  
  2205.         outcomeTitle.hideWhenInMenu = false;
  2206.  
  2207.         outcomeTitle.archived = false;
  2208.  
  2209.         outcomeTitle setPulseFX( 100, duration, 1000 );
  2210.  
  2211.  
  2212.  
  2213.         outcomeText = createFontString( font, 2.0 );
  2214.  
  2215.         outcomeText setParent( outcomeTitle );
  2216.  
  2217.         outcomeText setPoint( "TOP", "BOTTOM", 0, 0 );
  2218.  
  2219.         outcomeText.glowAlpha = 1;
  2220.  
  2221.         outcomeText.foreground = true;
  2222.  
  2223.         outcomeText.hideWhenInMenu = false;
  2224.  
  2225.         outcomeText.archived = false;
  2226.  
  2227.         outcomeText.glowColor = (0.2, 0.3, 0.7);
  2228.  
  2229.         outcomeText setText( endReasonText );
  2230.  
  2231.  
  2232.  
  2233.         firstTitle = createFontString( font, winnerSize );
  2234.  
  2235.         firstTitle setParent( outcomeText );
  2236.  
  2237.         firstTitle setPoint( "TOP", "BOTTOM", 0, spacing );
  2238.  
  2239.         firstTitle.glowColor = (0.3, 0.7, 0.2);
  2240.  
  2241.         firstTitle.glowAlpha = 1;
  2242.  
  2243.         firstTitle.foreground = true;
  2244.  
  2245.         firstTitle.hideWhenInMenu = false;
  2246.  
  2247.         firstTitle.archived = false;
  2248.  
  2249.         if ( isDefined( players[0] ) )
  2250.  
  2251.         {
  2252.  
  2253.             firstTitle.label = &"MP_FIRSTPLACE_NAME";
  2254.  
  2255.             firstTitle setPlayerNameString( players[0] );
  2256.  
  2257.             firstTitle setPulseFX( 100, duration, 1000 );
  2258.  
  2259.         }
  2260.  
  2261.  
  2262.  
  2263.         secondTitle = createFontString( font, otherSize );
  2264.  
  2265.         secondTitle setParent( firstTitle );
  2266.  
  2267.         secondTitle setPoint( "TOP", "BOTTOM", 0, spacing );
  2268.  
  2269.         secondTitle.glowColor = (0.2, 0.3, 0.7);
  2270.  
  2271.         secondTitle.glowAlpha = 1;
  2272.  
  2273.         secondTitle.foreground = true;
  2274.  
  2275.         secondTitle.hideWhenInMenu = false;
  2276.  
  2277.         secondTitle.archived = false;
  2278.  
  2279.         if ( isDefined( players[1] ) )
  2280.  
  2281.         {
  2282.  
  2283.             secondTitle.label = &"MP_SECONDPLACE_NAME";
  2284.  
  2285.             secondTitle setPlayerNameString( players[1] );
  2286.  
  2287.             secondTitle setPulseFX( 100, duration, 1000 );
  2288.  
  2289.         }
  2290.  
  2291.        
  2292.  
  2293.         thirdTitle = createFontString( font, otherSize );
  2294.  
  2295.         thirdTitle setParent( secondTitle );
  2296.  
  2297.         thirdTitle setPoint( "TOP", "BOTTOM", 0, spacing );
  2298.  
  2299.         thirdTitle setParent( secondTitle );
  2300.  
  2301.         thirdTitle.glowColor = (0.2, 0.3, 0.7);
  2302.  
  2303.         thirdTitle.glowAlpha = 1;
  2304.  
  2305.         thirdTitle.foreground = true;
  2306.  
  2307.         thirdTitle.hideWhenInMenu = false;
  2308.  
  2309.         thirdTitle.archived = false;
  2310.  
  2311.         if ( isDefined( players[2] ) )
  2312.  
  2313.         {
  2314.  
  2315.             thirdTitle.label = &"MP_THIRDPLACE_NAME";
  2316.  
  2317.             thirdTitle setPlayerNameString( players[2] );
  2318.  
  2319.             thirdTitle setPulseFX( 100, duration, 1000 );
  2320.  
  2321.         }
  2322.  
  2323.  
  2324.  
  2325.         matchBonus = createFontString( font, 2.0 );
  2326.  
  2327.         matchBonus setParent( thirdTitle );
  2328.  
  2329.         matchBonus setPoint( "TOP", "BOTTOM", 0, spacing );
  2330.  
  2331.         matchBonus.glowAlpha = 1;
  2332.  
  2333.         matchBonus.foreground = true;
  2334.  
  2335.         matchBonus.hideWhenInMenu = false;
  2336.  
  2337.         matchBonus.archived = false;
  2338.  
  2339.         if ( isDefined( self.matchBonus ) )
  2340.  
  2341.         {
  2342.  
  2343.             matchBonus.label = game["strings"]["match_bonus"];
  2344.  
  2345.             matchBonus setValue( self.matchBonus );
  2346.  
  2347.         }
  2348.  
  2349.  
  2350.  
  2351.         self thread updateOutcome( firstTitle, secondTitle, thirdTitle );
  2352.  
  2353.         self thread resetOutcomeNotify( outcomeTitle, outcomeText, firstTitle, secondTitle, thirdTitle, matchBonus );
  2354.  
  2355.     }
  2356.  
  2357. }
  2358.  
  2359.  
  2360.  
  2361.  
  2362.  
  2363. resetOutcomeNotify( outcomeTitle, outcomeText, firstTitle, secondTitle, thirdTitle, matchBonus )
  2364.  
  2365. {
  2366.  
  2367.     self endon ( "disconnect" );
  2368.  
  2369.     self waittill ( "reset_outcome" );
  2370.  
  2371.    
  2372.  
  2373.     if ( isDefined( outcomeTitle ) )
  2374.  
  2375.         outcomeTitle destroyElem();
  2376.  
  2377.     if ( isDefined( outcomeText ) )
  2378.  
  2379.         outcomeText destroyElem();
  2380.  
  2381.     if ( isDefined( firstTitle ) )
  2382.  
  2383.         firstTitle destroyElem();
  2384.  
  2385.     if ( isDefined( secondTitle ) )
  2386.  
  2387.         secondTitle destroyElem();
  2388.  
  2389.     if ( isDefined( thirdTitle ) )
  2390.  
  2391.         thirdTitle destroyElem();
  2392.  
  2393.     if ( isDefined( matchBonus ) )
  2394.  
  2395.         matchBonus destroyElem();
  2396.  
  2397. }
  2398.  
  2399.  
  2400.  
  2401. resetTeamOutcomeNotify( outcomeTitle, outcomeText, leftIcon, rightIcon, LeftScore, rightScore, matchBonus )
  2402.  
  2403. {
  2404.  
  2405.     self endon ( "disconnect" );
  2406.  
  2407.     self waittill ( "reset_outcome" );
  2408.  
  2409.  
  2410.  
  2411.     if ( isDefined( outcomeTitle ) )
  2412.  
  2413.         outcomeTitle destroyElem();
  2414.  
  2415.     if ( isDefined( outcomeText ) )
  2416.  
  2417.         outcomeText destroyElem();
  2418.  
  2419.     if ( isDefined( leftIcon ) )
  2420.  
  2421.         leftIcon destroyElem();
  2422.  
  2423.     if ( isDefined( rightIcon ) )
  2424.  
  2425.         rightIcon destroyElem();
  2426.  
  2427.     if ( isDefined( leftScore ) )
  2428.  
  2429.         leftScore destroyElem();
  2430.  
  2431.     if ( isDefined( rightScore ) )
  2432.  
  2433.         rightScore destroyElem();
  2434.  
  2435.     if ( isDefined( matchBonus ) )
  2436.  
  2437.         matchBonus destroyElem();
  2438.  
  2439. }
  2440.  
  2441.  
  2442.  
  2443.  
  2444.  
  2445. updateOutcome( firstTitle, secondTitle, thirdTitle )
  2446.  
  2447. {
  2448.  
  2449.     self endon( "disconnect" );
  2450.  
  2451.     self endon( "reset_outcome" );
  2452.  
  2453.    
  2454.  
  2455.     while( true )
  2456.  
  2457.     {
  2458.  
  2459.         self waittill( "update_outcome" );
  2460.  
  2461.  
  2462.  
  2463.         players = level.placement["all"];
  2464.  
  2465.  
  2466.  
  2467.         if ( isDefined( firstTitle ) && isDefined( players[0] ) )
  2468.  
  2469.             firstTitle setPlayerNameString( players[0] );
  2470.  
  2471.         else if ( isDefined( firstTitle ) )
  2472.  
  2473.             firstTitle.alpha = 0;
  2474.  
  2475.        
  2476.  
  2477.         if ( isDefined( secondTitle ) && isDefined( players[1] ) )
  2478.  
  2479.             secondTitle setPlayerNameString( players[1] );
  2480.  
  2481.         else if ( isDefined( secondTitle ) )
  2482.  
  2483.             secondTitle.alpha = 0;
  2484.  
  2485.        
  2486.  
  2487.         if ( isDefined( thirdTitle ) && isDefined( players[2] ) )
  2488.  
  2489.             thirdTitle setPlayerNameString( players[2] );
  2490.  
  2491.         else if ( isDefined( thirdTitle ) )
  2492.  
  2493.             thirdTitle.alpha = 0;
  2494.  
  2495.  
  2496.  
  2497.     }  
  2498.  
  2499. }
  2500.  
  2501.  
  2502.  
  2503. canShowSplash( type )
  2504.  
  2505. {
  2506.  
  2507.    
  2508.  
  2509. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement