## XIIIMP
Class XIIIMPHud

source: C:\XIII\XIIIMP\Classes\XIIIMPHud.uc

    Core.Object
       |
       +--Engine.Actor
          |
          +--Engine.HUD
             |
             +--XIII.XIIIBaseHud
                |
                +--XIIIMP.XIIIMPHud

Direct Known Subclasses:XIIIBirdHud, XIIITeamHud

class XIIIMPHud
extends XIII.XIIIBaseHud

    //-----------------------------------------------------------
    // XIIIMJHud || For XIIIDMGameInfo
    //-----------------------------------------------------------

Variables
`Texture` | `BadConnectTex` SouthEnd
`float` | `BonusActivationLifeTime[12]` SouthEnd
`float` | `BonusLifeTime[12]` SouthEnd
`int` | `BonusOn[12],OldBonusOn[12]` SouthEnd
`string` | `BonusText[12]` SouthEnd
`float` | `BonusTrans[12]` SouthEnd
`int` | `DrawBonusTextID` SouthEnd
`int` | `FragCount` SouthEnd
`Texture` | `HudMPWIcons` SouthEnd
`LastFragTime,` | `LastBonusTime` SouthEnd
`int` | `MarioBonus` s1st,s2nd,s3rd,s4th;
`array` | `MarioBonusTex[11]` s1st,s2nd,s3rd,s4th;
`int` | `OldMarioBonus` SouthEnd
`int` | `OldScore` SouthEnd
`color` | `PlayerColor` s1st,s2nd,s3rd,s4th;
`,` | `ScoreHeight` s1st,s2nd,s3rd,s4th;
`sound` | `SndFrag` SouthEnd
`color` | `TeamColor[2]`
`Texture` | `WaitInitTex` SouthEnd
`bool` | `bDrawBonusText` SouthEnd
`bool` | `bInit,bSplitt` s1st,s2nd,s3rd,s4th;
`Texture` | `inviteReceivedIcon` SouthEnd
`string` | `sKicked` s1st,s2nd,s3rd,s4th;
`string` | `sPosition[4]` s1st,s2nd,s3rd,s4th;
`sound` | `soundBonusOff[12]` SouthEnd
`sound` | `soundBonusOn[12]` SouthEnd
`Texture` | `texFrag` SouthEnd
`XboxLiveManager` | `xboxlive` SouthEnd

Function Summary
`void` | `DisplayBadConnectionAlert(Canvas C)`
    //____________________________________________________________________
`void` | `DrawBonusText(Canvas C)`
    //____________________________________________________________________
`void` | `DrawFrag(Canvas C)`
    //____________________________________________________________________
`void` | `DrawHUD(Canvas C)`
    //____________________________________________________________________
    // ELR Draw HUD
`void` | `DrawVersion(Canvas C)`
    //____________________________________________________________________
`void` | `DrawViewPortSeparator(Canvas C)`
    //____________________________________________________________________
    //
`simulated` | `DrawWaitForMPInit(Canvas C)`
    //____________________________________________________________________
`void` | `DrawWeaponIconsList(Canvas C)`
    //____________________________________________________________________
`void` | `MarioBonusDisplay(Canvas C)`
    //____________________________________________________________________
`void` | `PlayerNameDisplay(Canvas C)`
    //____________________________________________________________________
    //
`void` | `UpdateBonusSound()`
    //____________________________________________________________________

Source Code

    00001	//-----------------------------------------------------------
    00002	// XIIIMJHud || For XIIIDMGameInfo
    00003	//-----------------------------------------------------------
    00004	class XIIIMPHud extends XIIIBaseHud;
    00005
    00006	#exec OBJ LOAD FILE=XIIIXboxPacket.utx
    00007
    00008	var color TeamColor[2];
    00009	var localized string sPosition[4]; //s1st,s2nd,s3rd,s4th;
    00010	var localized string sKicked;
    00011	var float  ScoreWidth , ScoreHeight;
    00012	var color PlayerColor;
    00013	var bool bInit,bSplitt;
    00014	var int MarioBonus;
    00015	var array<texture> MarioBonusTex[11];
    00016
    00017	// Xbox live stuff
    00018	var XboxLiveManager xboxlive; // SouthEnd
    00019	var texture inviteReceivedIcon;
    00020	var texture HudMPWIcons;
    00021
    00022	var int OldScore;
    00023	var sound SndFrag;
    00024	var int FragCount;
    00025	var texture texFrag;
    00026	var float LastFragTime, LastBonusTime;
    00027	var int BonusOn[12],OldBonusOn[12];
    00028	var int OldMarioBonus;
    00029	var sound soundBonusOn[12];
    00030	var sound soundBonusOff[12];
    00031	var bool bDrawBonusText;
    00032	var int DrawBonusTextID;
    00033	var localized string BonusText[12];
    00034	var float BonusLifeTime[12];
    00035	var float BonusActivationLifeTime[12];
    00036	var float BonusTrans[12];
    00037
    00038	var texture WaitInitTex;
    00039	var texture BadConnectTex;
    00040
    00041	//____________________________________________________________________
    00042	simulated function DrawWaitForMPInit(Canvas C)
    00043	{
    00044	    local float W,H;
    00045
    00046	    C.SetPos(C.ClipX/2.0 - WaitInitTex.USize/2.0, C.ClipY/2.0 - WaitInitTex.VSize/2.0);
    00047	    C.Style = ERenderStyle.STY_Alpha;
    00048	    C.DrawColor = OrangeColor;
    00049	    C.DrawIcon(WaitInitTex, 1.0);
    00050	    C.DrawColor = WhiteColor;
    00051	    C.SpaceX = 0;
    00052	    UseHugeFont(C);
    00053	    if ( (PlayerOwner != none) && PlayerOwner.IsInState('Kicked') )
    00054	      C.StrLen(sKicked, W, H );
    00055	    else
    00056	      C.StrLen(class'XIIIMPScoreBoard'.default.strPleaseWait, W, H );
    00057	    C.SetPos((C.ClipX -W)/2.0, C.ClipY/2 + WaitInitTex.VSize/2.0 - H*2);
    00058	    C.bTextShadow = true;
    00059	    if ( (PlayerOwner != none) && PlayerOwner.IsInState('Kicked') )
    00060	      C.DrawText(sKicked);
    00061	    else
    00062	      C.DrawText(class'XIIIMPScoreBoard'.default.strPleaseWait);
    00063	    C.bTextShadow = false;
    00064	}
    00065
    00066	//____________________________________________________________________
    00067	simulated event PostRender( canvas C )
    00068	{
    00069	    if ( (PlayerOwner == none) || (PlayerOwner.GameReplicationInfo == none) || (PlayerOwner.PlayerReplicationInfo == none) )
    00070	    {
    00071	      DrawWaitForMPInit(C);
    00072	      return; // wait for game initialization/replications
    00073	    }
    00074	    Super.PostRender(C);
    00075	}
    00076
    00077	//____________________________________________________________________
    00078	function DisplayBadConnectionAlert(Canvas C)
    00079	{
    00080	    C.Style = ERenderStyle.STY_Alpha;
    00081	    C.DrawColor = WhiteColor;
    00082	    if ((Level.TimeSeconds*2.0 - int(Level.TimeSeconds*2.0)) > 0.5 )
    00083	    {
    00084	      C.SetPos(C.ClipX/2.0 - BadConnectTex.USize, C.ClipY*UpMargin );
    00085	      C.DrawIcon(BadConnectTex, 1.0);
    00086	    }
    00087	    else
    00088	    {
    00089	      C.SetPos(C.ClipX/2.0, C.ClipY*UpMargin );
    00090	      C.DrawTile(BadConnectTex, BadConnectTex.USize, BadConnectTex.VSize, 0, 0, -BadConnectTex.USize, BadConnectTex.VSize);
    00091	    }
    00092	}
    00093
    00094	//____________________________________________________________________
    00095	function DrawBonusText(Canvas C)
    00096	{
    00097	    local string TmpTxt;
    00098	    local float W,H;
    00099	    local float AlfaTrans;
    00100
    00101	    TmpTxt=BonusText[ DrawBonusTextID ];
    00102
    00103	    if( (Level.NetMode == NM_StandAlone) && ( Level.Game.NumPlayers > 2 ) )
    00104	       C.Font = SmallFont;
    00105	    else
    00106	       C.Font = BigFont;
    00107
    00108	    C.SpaceX = 1;
    00109	    C.bUseBorder = false;
    00110	    C.Style = ERenderStyle.STY_Alpha;
    00111	    C.StrLen(TmpTxt, W, H );
    00112
    00113	    C.DrawColor = WhiteColor;
    00114
    00115	    AlfaTrans= (2.5+LastBonusTime-Level.TimeSeconds)*102;
    00116
    00117	    if( AlfaTrans < 0.0 )
    00118	    {
    00119	       AlfaTrans = 0.0;
    00120	       bDrawBonusText=false;
    00121	    }
    00122
    00123	    C.DrawColor.A = int(AlfaTrans);
    00124
    00125	    C.SetPos( C.ClipX/2-W/2, C.ClipY/3+C.ClipX*0.06+2);
    00126	    C.DrawText(TmpTxt,false);
    00127	}
    00128
    00129	//____________________________________________________________________
    00130
    00131	function UpdateBonusSound()
    00132	{
    00133	    local int Loop,BonusIndex,BonusValue;
    00134
    00135
    00136	    for( Loop =0 ; Loop < 12 ; Loop++ )
    00137	         OldBonusOn[Loop]=BonusOn[Loop];
    00138
    00139	    BonusValue = 1;
    00140
    00141	    For( Loop = 0 ; Loop < 12 ; Loop ++ )
    00142	    {
    00143	        if( ( MarioBonus & BonusValue ) != 0 )
    00144	            BonusOn[Loop]=1;
    00145	        else
    00146	            BonusOn[Loop]=0;
    00147
    00148	        if( ( BonusOn[Loop] == 1 ) && ( OldBonusOn[Loop] == 0 ) )
    00149	        {
    00150	//            PlayerOwner.PlayMenu( soundBonusOn[Loop] );
    00151	            PlayerOwner.PlaySound( soundBonusOn[Loop] );
    00152	            //log("--- SOund="@soundBonusOn[Loop]@"sur"@PlayerOwner);
    00153	            DrawBonusTextID=Loop;
    00154	            LastBonusTime = Level.TimeSeconds;
    00155	            bDrawBonusText=true;
    00156	            BonusActivationLifeTime[Loop] = Level.TimeSeconds;
    00157	            BonusTrans[Loop] = 255;
    00158	        }
    00159	        else if( ( BonusOn[Loop] == 0 ) && ( OldBonusOn[Loop] == 1 ) )
    00160	        {
    00161	            //log("--- SOund="@soundBonusOff[Loop]@"sur"@PlayerOwner);
    00162	//            PlayerOwner.PlayMenu( soundBonusOff[Loop] );
    00163	            PlayerOwner.PlaySound( soundBonusOff[Loop] );
    00164	        }
    00165
    00166	        BonusValue *= 2;
    00167	    }
    00168	}
    00169
    00170	//____________________________________________________________________
    00171
    00172	event Timer2()
    00173	{
    00174	    FragCount = 0;
    00175	    SetTimer2( 0.0, false );
    00176	}
    00177
    00178	//____________________________________________________________________
    00179
    00180	function DrawFrag( Canvas C )
    00181	{
    00182	    local int Loop;
    00183	    local float TextSize;
    00184	    local float AlfaTrans;
    00185
    00186	    if( FragCount > 5 )
    00187		FragCount = 5;
    00188
    00189	    TextSize = C.ClipX*0.06;
    00190
    00191	    C.bUseBorder = false;
    00192	    C.Style = ERenderStyle.STY_Alpha;
    00193
    00194	    C.DrawColor = WhiteColor;
    00195	    AlfaTrans= (2+LastFragTime-Level.TimeSeconds)*127;
    00196
    00197	    if( AlfaTrans < 0.0 )
    00198	    {
    00199	       AlfaTrans = 0.0;
    00200	       Timer2();
    00201	    }
    00202
    00203	    C.DrawColor.A = int(AlfaTrans);
    00204
    00205	    C.SetPos( C.ClipX/2 - FragCount*TextSize*0.5, C.ClipY*0.3);
    00206
    00207	    for( Loop=0; Loop < FragCount ; Loop++ )
    00208	    {
    00209	        C.DrawRect(texFrag, TextSize,TextSize);
    00210	    }
    00211	}
    00212
    00213	//____________________________________________________________________
    00214
    00215	function MarioBonusDisplay(Canvas C)
    00216	{
    00217	    local string  strMarioBonus;
    00218	    local float W,H, TmpTime ;
    00219	    local int Loop,BonusIndex,BonusValue;
    00220	    local texture BonusTex;
    00221
    00222	    if ( (PlayerOwner == none) || (PlayerOwner.Pawn == none) )
    00223	      return;
    00224
    00225	    if ( Level.NetMode != NM_Standalone )
    00226	    {
    00227		MarioBonus = XIIIMPPlayerPawn(PlayerOwner.Pawn).MarioBonusLAN;
    00228	    }
    00229
    00230	    if( MarioBonus != OldMarioBonus )
    00231		UpdateBonusSound();
    00232
    00233	    OldMarioBonus = MarioBonus;
    00234
    00235	    if( MarioBonus < 0 )
    00236	    {
    00237	        MarioBonus = 0;
    00238	        bDrawBonusText= false;
    00239	    }
    00240
    00241	    if( bDrawBonusText )
    00242	        DrawBonusText(C);
    00243
    00244
    00245
if( MarioBonus != 0 ) 00246 { 00247 UseHugeFont(C); 00248 C.SpaceX = 0; 00249 C.bUseBorder = true; 00250 C.Style = ERenderStyle.STY_Alpha; 00251 C.BorderColor = WhiteColor; 00252 C.StrLen("A", W, H ); 00253 C.DrawColor = WhiteColor; 00254 C.DrawColor.A = 255; 00255 00256 YP = YP + H + 4; 00257 00258 BonusValue = 1; 00259 00260 BonusIndex = 0; 00261 00262 For( Loop = 0 ; Loop < 11 ; Loop ++ ) 00263 { 00264 if( ( MarioBonus & BonusValue ) != 0 ) 00265 { 00266 TmpTime = Level.TimeSeconds - BonusActivationLifeTime[Loop]; 00267 00268 if( TmpTime < BonusLifeTime[Loop] - 3 ) 00269 { 00270 C.DrawColor.A = 255; 00271 } 00272 else 00273 { 00274 C.DrawColor.A = BonusTrans[Loop]; 00275 BonusTrans[Loop] -= 5; 00276 if( BonusTrans[Loop] <= 0.0 ) BonusTrans[Loop] = 255; 00277 } 00278 00279 BonusTex = MarioBonusTex[Loop]; 00280 C.SetPos( XP+BonusIndex*(H+4),YP); 00281 C.DrawTile(BonusTex, H,H, 0, 0, BonusTex.USize, BonusTex.VSize); 00282 00283 BonusIndex ++; 00284 } 00285 00286 BonusValue *= 2; 00287 } 00288 00289 C.bUseBorder = false; 00290 } 00291 } 00292 00293 00294 //____________________________________________________________________ 00295 // 00296 function DrawViewPortSeparator(Canvas C) 00297 { 00298 local float H,W,H2,W2; 00299 00300 00301 if ( (Level.Game == none) || (Level.NetMode != NM_StandAlone) ) 00302 return; 00303 if( Level.Game.NumPlayers == 2 ) 00304 { 00305 H = C.ClipY*0.01; 00306 W = C.ClipX; 00307 00308 if( ViewPortId == 0 ) 00309 { 00310 C.bUseBorder = false; 00311 00312 // C.DrawColor = WhiteColor; 00313 // C.DrawColor.A = 255; 00314 // 00315 // C.SetPos( 0, C.ClipY-H-1); 00316 // C.DrawTile(WhiteTex, W,H+1, 0, 0, WhiteTex.USize, WhiteTex.VSize); 00317 00318 C.DrawColor = BlackColor; 00319 C.DrawColor.A = 255; 00320 00321 C.SetPos( 0, C.ClipY-H); 00322 C.DrawTile(BlackTex, W,H, 0, 0, BlackTex.USize, BlackTex.VSize); 00323 } 00324 else if( ViewPortId == 1 ) 00325 { 00326 C.bUseBorder = false; 00327 00328 // C.DrawColor = WhiteColor; 00329 // C.DrawColor.A = 255; 00330 // 00331 // C.SetPos( 0, 0); 00332 // C.DrawTile(WhiteTex, W,H+1, 0, 0, WhiteTex.USize, WhiteTex.VSize); 00333 00334 C.DrawColor = BlackColor; 00335 C.DrawColor.A = 255; 00336 00337 C.SetPos( 0, 0); 00338 C.DrawTile(BlackTex, W,H, 0, 0, BlackTex.USize, BlackTex.VSize); 00339 } 00340 } 00341 else if( Level.Game.NumPlayers > 2 ) 00342 { 00343 H = C.ClipY*0.01; 00344 W = C.ClipX; 00345 H2 = C.ClipY; 00346 W2 = C.ClipX*0.0075; 00347 00348 if( ViewPortId == 0 ) 00349 { 00350 C.bUseBorder = false; 00351 00352 // C.DrawColor = WhiteColor; 00353 // C.DrawColor.A = 255; 00354 // 00355 // C.SetPos( 0, C.ClipY-H-1); 00356 // C.DrawTile(WhiteTex, W,H+1, 0, 0, WhiteTex.USize, WhiteTex.VSize); 00357 // 00358 // C.SetPos( C.ClipX - W2-1, 0); 00359 // C.DrawTile(WhiteTex, W2+1,H2, 0, 0, WhiteTex.USize, WhiteTex.VSize); 00360 00361 C.DrawColor = BlackColor; 00362 C.DrawColor.A = 255; 00363 00364 C.SetPos( 0, C.ClipY-H); 00365 C.DrawTile(BlackTex, W,H, 0, 0, BlackTex.USize, BlackTex.VSize); 00366 00367 C.SetPos( C.ClipX - W2, 0); 00368 C.DrawTile(BlackTex, W2,H2, 0, 0, BlackTex.USize, BlackTex.VSize); 00369 } 00370 else if( ViewPortId == 1 ) 00371 { 00372 C.bUseBorder = false; 00373 00374 // C.DrawColor = WhiteColor; 00375 // C.DrawColor.A = 255; 00376 // 00377 // C.SetPos( 0, C.ClipY-H-1); 00378 // C.DrawTile(WhiteTex, W,H+1, 0, 0, WhiteTex.USize, WhiteTex.VSize); 00379 // 00380 // C.SetPos( 0, 0); 00381 // C.DrawTile(WhiteTex, W2+1,H2, 0, 0, WhiteTex.USize, WhiteTex.VSize); 00382 00383 C.DrawColor = BlackColor; 00384 C.DrawColor.A = 255; 00385 00386 C.SetPos( 0, C.ClipY-H); 00387 C.DrawTile(BlackTex, W,H, 0, 0, BlackTex.USize, BlackTex.VSize); 00388 00389 C.SetPos( 0, 0); 00390 C.DrawTile(BlackTex, W2,H2, 0, 0, BlackTex.USize, BlackTex.VSize); 00391 } 00392 else if( ViewPortId == 2 ) 00393 { 00394 C.bUseBorder = false; 00395 00396 // C.DrawColor = WhiteColor; 00397 // C.DrawColor.A = 255; 00398 // 00399 // C.SetPos( 0, 0); 00400 // C.DrawTile(WhiteTex, W,H+1, 0, 0, WhiteTex.USize, WhiteTex.VSize); 00401 // 00402 // C.SetPos( C.ClipX - W2-1, 0); 00403 // C.DrawTile(WhiteTex, W2+1,H2, 0, 0, WhiteTex.USize, WhiteTex.VSize); 00404 00405 C.DrawColor = BlackColor; 00406 C.DrawColor.A = 255; 00407 00408 C.SetPos( 0, 0); 00409 C.DrawTile(BlackTex, W,H, 0, 0, BlackTex.USize, BlackTex.VSize); 00410 00411 C.SetPos( C.ClipX - W2, 0); 00412 C.DrawTile(BlackTex, W2,H2, 0, 0, BlackTex.USize, BlackTex.VSize); 00413 } 00414 else if( ViewPortId == 3 ) 00415 { 00416 C.bUseBorder = false; 00417 00418 // C.DrawColor = WhiteColor; 00419 // C.DrawColor.A = 255; 00420 // 00421 // C.SetPos( 0, 0); 00422 // C.DrawTile(WhiteTex, W,H+1, 0, 0, WhiteTex.USize, WhiteTex.VSize); 00423 // 00424 // C.SetPos( 0, 0); 00425 // C.DrawTile(WhiteTex, W2+1,H2, 0, 0, WhiteTex.USize, WhiteTex.VSize); 00426 00427 C.DrawColor = BlackColor; 00428 C.DrawColor.A = 255; 00429 00430 C.SetPos( 0, 0); 00431 C.DrawTile(BlackTex, W,H, 0, 0, BlackTex.USize, BlackTex.VSize); 00432 00433 C.SetPos( 0, 0); 00434 C.DrawTile(BlackTex, W2,H2, 0, 0, BlackTex.USize, BlackTex.VSize); 00435 } 00436 } 00437 } 00438 00439 //____________________________________________________________________ 00440 // 00441 function PlayerNameDisplay(Canvas C) 00442 { 00443 local float W,H ; 00444 local string strRank, strScore; 00445 local int Loop, Rank, Score ; 00446 00447 UseHugeFont(C); 00448 C.SpaceX = 0; 00449 00450 if( ! bInit ) 00451 { // can't be in postbeginplay because need canvas 00452 bInit = true; 00453 PlayerColor = HudBasicColor; 00454 ScoreWidth = 0; 00455 for( Loop=0 ; Loop < 4 ;Loop++) 00456 { 00457 C.StrLen(sPosition[Loop], W, H ); 00458 if( ScoreWidth < W ) 00459 ScoreWidth = W; 00460 } 00461 C.StrLen("999", W, H ); 00462 if( ScoreWidth < W ) 00463 ScoreWidth = W; 00464 ScoreHeight = H; 00465 ScoreHeight -= 4; 00466 ScoreWidth += 4; 00467 if ( (Level.NetMode != NM_Standalone) || (Level.bLonePlayer) ) 00468 bSplitt = false; 00469 else 00470 bSplitt = true; 00471 } 00472 00473 Scoring.UpdateScores(); 00474 00475 for( Loop = 0 ; Loop < 32 ; Loop++ ) 00476 { 00477 if( XIIIMPScoreBoard(Scoring).Ordered[ Loop ] == PlayerOwner.PlayerReplicationInfo ) 00478 { 00479 Rank = Loop+1; 00480 break; 00481 } 00482 } 00483 00484 Score = XIIIMPScoreBoard(Scoring).Ordered[ Loop ].Score; 00485 strRank = string( Rank ); 00486 if( Rank > 3 ) 00487 Rank = 4; 00488 00489 strRank = strRank$sPosition[ Rank -1 ]; 00490 strScore = string( Score ); 00491 00492 C.Style = ERenderStyle.STY_Alpha; 00493 C.DrawColor = PlayerColor*0.1; 00494 C.DrawColor.A = 90; 00495 C.bUseBorder = false; 00496 // 1rst part of background, display rank 00497 C.SetPos( XP, YP); 00498 C.DrawRect(RoundBackGroundTex, ScoreHeight,ScoreHeight); 00499 C.DrawRect(FondMsg, ScoreWidth,ScoreHeight); 00500 // 2nd part of background, display score 00501 C.SetPos(C.CurX + 4 , C.CurY); 00502 C.DrawRect(FondMsg, ScoreWidth,ScoreHeight); 00503 C.DrawTile(RoundBackGroundTex, ScoreHeight,ScoreHeight, 0, 0, -RoundBackGroundTex.USize, RoundBackGroundTex.VSize); 00504 00505 C.bTextShadow = true; 00506 C.DrawColor = PlayerColor; 00507 C.DrawColor.A = 255; 00508 00509 C.StrLen(StrRank, W, H ); 00510 C.SetPos( XP + ScoreHeight + ScoreWidth/2- W/2-2, YP-1); 00511 C.DrawText(strRank, false); 00512 00513 C.StrLen(strScore, W, H ); 00514 C.SetPos( XP + ScoreHeight + ScoreWidth+4 + ScoreWidth/2- W/2 +4 -2, YP-1); 00515 C.DrawText(strScore, false); 00516 00517 C.bTextShadow = false; 00518 00519 if( OldScore != XIIIPlayerReplicationInfo(PlayerOwner.PlayerReplicationInfo).MyDeathScore ) 00520 { 00521 FragCount=XIIIPlayerReplicationInfo(PlayerOwner.PlayerReplicationInfo).MyDeathScore-OldScore; 00522 // Log("FRAG new FragCount="$FragCount); 00523 00524 if( FragCount > 0 ) 00525 { 00526 SetTimer2( 2.0, true ); 00527 PlayerOwner.PlayMenu( SndFrag ); 00528 LastFragTime=Level.TimeSeconds; 00529 } 00530 else 00531 FragCount = 0; 00532 } 00533 00534 OldScore = XIIIPlayerReplicationInfo(PlayerOwner.PlayerReplicationInfo).MyDeathScore; 00535 00536 if( FragCount != 0 ) 00537 DrawFrag(C); 00538 00539 MarioBonusDisplay(C); 00540 } 00541 00542 //____________________________________________________________________ 00543 00544 function DrawVersion( canvas C ) 00545 { 00546 local float W,H ; 00547 local string strVersion; 00548 00549 UseHugeFont(C); 00550 C.SpaceX = 0; 00551 00552 strVersion = "--- 6.3 ---"; 00553 C.StrLen(strVersion, W, H ); 00554 00555 C.Style = ERenderStyle.STY_Alpha; 00556 C.DrawColor = WhiteColor; 00557 C.DrawColor.A = 100; 00558 C.bUseBorder = false; 00559 00560 C.SetPos( C.ClipX/2 - W/2, C.ClipY*0.07); 00561 C.DrawText(strVersion, false); 00562 } 00563 00564 //____________________________________________________________________ 00565 // ELR Draw HUD 00566 function DrawHUD( canvas C ) 00567 { 00568 local float alphavalue; 00569 00570 if ( (PlayerOwner == none) || (PlayerOwner.GameReplicationInfo == none) ) 00571 return; // wait for game initialization/replications 00572 00573 HUDSetup( C ); 00574 00575 00576 // Draw the gameinvite icon 00577 if (xboxlive == none) 00578 xboxlive=New Class'XboxLiveManager'; 00579 if (!PlayerOwner.Player.LocalInteractions[0].IsInState('UWindows') && xboxlive.IsLoggedIn(xboxlive.GetCurrentUser()) && xboxlive.ShouldRenderInvite()) 00580 { 00581 alphavalue = abs(sin(Level.TimeSeconds*4.0))*255.0; 00582 00583 // render a blinking invite icon 00584 C.SetPos(540, 100); 00585 C.DrawColor = WhiteColor; 00586 C.DrawColor.A = alphavalue; 00587 C.Style = 5; // ERenderStyle.STY_Alpha; 00588 C.DrawTile(inviteReceivedIcon, inviteReceivedIcon.USize, inviteReceivedIcon.VSize, 0, 0, inviteReceivedIcon.USize, inviteReceivedIcon.VSize); 00589 C.Style = 1; // ERenderStyle.STY_Normal; 00590 } 00591 00592 // ELR Do show scores if needed. 00593 if ( (PlayerOwner.Pawn == none) || (XIIIGameReplicationInfo(PlayerOwner.GameReplicationInfo).iGameState != 2) ) 00594 { 00595 if ( Scoring != None ) 00596 { 00597 Scoring.OwnerHUD = self; 00598 if ( (Level.Game == none) || (Level.NetMode != NM_StandAlone) ) 00599 Scoring.ShowScores(C, ViewPortId, 1); 00600 else 00601 Scoring.ShowScores(C, ViewPortId, Level.Game.NumPlayers); 00602 DrawViewPortSeparator(C); 00603 return; 00604 } 00605 } 00606 00607 if ( bShowScores && (Scoring != None) ) // Clean Frags Icon if displaying scores 00608 OldScore = XIIIPlayerReplicationInfo(PlayerOwner.PlayerReplicationInfo).MyDeathScore; 00609 00610 Super.DrawHud(C); 00611 00612 if ( bHideHud && (PawnOwner != none) && !PawnOwner.bIsDead ) 00613 bHideHud = false; 00614 00615 DrawViewPortSeparator(C); 00616 00617 00618 00619 //DrawVersion( C ); 00620 } 00621 00622 //____________________________________________________________________ 00623 simulated function LocalizedMessage( class<LocalMessage> Message, optional int Switch, optional PlayerReplicationInfo RelatedPRI_1, optional PlayerReplicationInfo RelatedPRI_2, optional Object OptionalObject, optional string CriticalString ) 00624 { 00625 if( ( Level.NetMode == NM_StandAlone) && ( ( Level.Game == none ) || ( Level.Game.NumPlayers > 2 ) ) ) 00626 return; 00627 00628 if ( Message == class'XIIIEndGameMessage' ) 00629 { 00630 AddHudEndMessage( Message, Switch, RelatedPRI_1, RelatedPRI_2, OptionalObject, CriticalString ); 00631 bHideHud = true; 00632 } 00633 // else if ( ( Message == class'XIIIDeathMessage' ) && ( PawnOwner.bIsDead ) ) 00634 // { 00635 // AddHudEndMessage( Message, Switch, RelatedPRI_1, RelatedPRI_2, OptionalObject, CriticalString ); 00636 // bHideHud = true; 00637 // } 00638 // else 00639 if( ( ( ( Message == class'XIIIDeathMessage' ) || ( Message == class'XIIIMPCTFMessage') ) || ( Message == class'XIIIMultiMessage' ) ) || ( Message == class'XIIIMPDuckMessage' ) ) 00640 AddHudMPMessage( Message, Switch, RelatedPRI_1, RelatedPRI_2, OptionalObject, CriticalString ); 00641 else 00642 AddHudMessage( Message, Switch, RelatedPRI_1, RelatedPRI_2, OptionalObject, CriticalString ); 00643 } 00644 00645 //____________________________________________________________________ 00646 00647 function DrawWeaponIconsList(canvas C) 00648 { 00649 local string ItemText; 00650 local int Loop, NbWeapon, MaxWeaponIndex,AmmoPerCharger, Ammo, Loop2, CurrentId , PrevId, NextID; 00651 local float WeaponPos; 00652 local Weapon W,TW[22],TW2[7]; 00653 local inventory I; 00654 local int XCoords, YCoords; 00655 00656 if ( !bSplitt || (Level.Game.NumPlayers <= 2) ) 00657 { 00658 super.DrawWeaponIconsList(C); 00659 return; 00660 } 00661 00662 NbWeapon = 0; 00663 I = PawnOwner.Inventory; 00664 // Add weapons in array TW 00665 while ( I != none ) 00666 { 00667 W = Weapon(I); 00668 if ( (W != none) && !((W.default.ReLoadCount==0) && !W.HasAmmo()) && (DecoWeapon(W) == none) && !XIIIWeapon(W).bIsSlave ) 00669 { 00670 TW[W.InventoryGroup] = W; 00671 MaxWeaponIndex = Max(MaxWeaponIndex, W.InventoryGroup); 00672 NbWeapon++; 00673 } 00674 I = I.Inventory; 00675 } 00676 00677 if( NbWeapon <= 3 ) 00678 { 00679 super.DrawWeaponIconsList(C); 00680 return; 00681 } 00682 00683 NbWeapon = 0; 00684 00685 for( Loop=0;Loop<22;Loop++) 00686 { // 2nd pass to have prior & next weapons 00687 if( TW[Loop] != none ) 00688 { 00689 W = TW[ Loop ]; 00690 if( NbWeapon < 7 ) 00691 { 00692 TW2[ NbWeapon ] = W; 00693 if( W == DrawnWeapon ) 00694 CurrentId = NbWeapon; 00695 NbWeapon++; 00696 } 00697 } 00698 } 00699 00700 PrevId = CurrentId-1; 00701 if ( PrevId == -1 ) 00702 PrevId = NbWeapon-1; 00703 NextId = CurrentId+1; 00704 if( NextId == NbWeapon ) 00705 NextId = 0; 00706 00707 YP = C.ClipY * (1 - downMargin) - LifeDisplayHeight; 00708 WeaponPos = C.ClipX * (1 - RightMargin) - (3)*(2*LifeDisplayHeight+4) - LifeDisplayHeight; 00709 C.bUseBorder = false; 00710 C.Style = ERenderStyle.STY_Alpha; 00711 00712 for( Loop=0;Loop<3;Loop++) 00713 { 00714 Switch( Loop ) 00715 { 00716 case 0 : W = TW2[PrevId]; break ; 00717 case 1 : W = TW2[CurrentId]; break ; 00718 case 2 : W = TW2[NextId]; break ; 00719 } 00720 00721 if ( !W.HasAmmo() && !XIIIWeapon(W).HasAltAmmo() ) 00722 C.DrawColor = RedColor; 00723 else if ( ( XIIIWeapon(W).WHand==WHA_2HShot ) && PawnOwner.bHaveOnlyOneHandFree ) 00724 C.DrawColor = OrangeColor; 00725 else 00726 C.DrawColor = HudBasicColor*0.1; 00727 00728 if ( W == DrawnWeapon ) 00729 C.DrawColor.A=140 ; 00730 else 00731 C.DrawColor.A=70 ; 00732 00733 C.SetPos( WeaponPos,YP); 00734 C.DrawRect(FondMsg, 2*LifeDisplayHeight,LifeDisplayHeight); 00735 00736 C.DrawColor= WhiteColor; 00737 if ( W == DrawnWeapon ) 00738 { 00739 C.bUseBorder = true; 00740 C.BorderColor= HudBasicColor; 00741 C.BorderColor.A= 255 ; 00742 } 00743 C.SetPos(WeaponPos,YP); 00744 00745 //C.DrawRect(W.Icon, 2*LifeDisplayHeight,LifeDisplayHeight); 00746 00747 YCoords = W.InventoryGroup / 4; 00748 XCoords = W.InventoryGroup - YCoords * 4; 00749 C.DrawTile(HudMPWIcons, 2*LifeDisplayHeight, LifeDisplayHeight, 64*XCoords, 32*YCoords, 64, 32); 00750 00751 00752 C.bUseBorder = false; 00753 00754 // Draw Ammo 00755 C.DrawColor = HudBasicColor; 00756 if ( W == DrawnWeapon ) 00757 C.DrawColor.A = 255; 00758 else 00759 C.DrawColor.A = 150; 00760 00761 if( XIIIWeapon(W).default.ReLoadCount > 0 ) 00762 { 00763 Ammo = W.Ammotype.AmmoAmount; 00764 AmmoPerCharger = W.default.ReLoadCount; 00765 Ammo /= AmmoPerCharger; 00766 } 00767 else 00768 { 00769 if ( (XIIIWeapon(W).WHand == WHA_Fist) || (XIIIWeapon(W).WHand == WHA_Deco) ) 00770 Ammo = -1; 00771 else 00772 Ammo = W.Ammotype.AmmoAmount; 00773 } 00774 00775 if( Ammo > 0 ) 00776 { 00777 if( Ammo > 6 ) Ammo = 6 ; 00778 ItemText = Left(sAmmoRef, Ammo); 00779 C.SetPos( WeaponPos,YP-LifeDisplayHeight/2-7 ); 00780 C.DrawText(ItemText, false); 00781 } 00782 WeaponPos += 2*LifeDisplayHeight + 4; 00783 } 00784 00785 C.DrawColor = HudBasicColor*0.1; 00786 C.DrawColor.A= 70 ; 00787 00788 C.SetPos( WeaponPos,YP); 00789 C.DrawTile(RoundBackGroundTex, LifeDisplayHeight,LifeDisplayHeight, 0, 0, -RoundBackGroundTex.USize, RoundBackGroundTex.VSize); 00790 00791 WeaponPos= C.ClipX * ( 1 - RightMargin ) - (3)*(2*LifeDisplayHeight+4) - 2*LifeDisplayHeight - 4; 00792 C.SetPos( WeaponPos,C.CurY); 00793 C.DrawTile(RoundBackGroundTex, LifeDisplayHeight,LifeDisplayHeight, 0, 0, RoundBackGroundTex.USize, RoundBackGroundTex.VSize); 00794 } 00795 00796 00797 00798 defaultproperties 00799 { 00800 TeamColor(0)=(R=200,A=255) 00801 TeamColor(1)=(B=255,G=159,R=64,A=255) 00802 sPosition(0)=" st" 00803 sPosition(1)=" nd" 00804 sPosition(2)=" rd" 00805 sPosition(3)=" th" 00806 sKicked="KICKED" 00807 MarioBonusTex(0)=Texture'XIIIMenu.HUD.mul_invulnerability' 00808 MarioBonusTex(1)=Texture'XIIIMenu.HUD.mul_invisibility' 00809 MarioBonusTex(2)=Texture'XIIIMenu.HUD.mul_quad' 00810 MarioBonusTex(3)=Texture'XIIIMenu.HUD.mul_regen' 00811 MarioBonusTex(4)=Texture'XIIIMenu.HUD.mul_teleport' 00812 MarioBonusTex(5)=Texture'XIIIMenu.HUD.mul_boost' 00813 MarioBonusTex(6)=Texture'XIIIMenu.HUD.mul_moinsdarmure' 00814 MarioBonusTex(7)=Texture'XIIIMenu.HUD.mul_moinsdevie' 00815 MarioBonusTex(8)=Texture'XIIIMenu.HUD.mul_mouette' 00816 MarioBonusTex(9)=Texture'XIIIMenu.HUD.mul_flag' 00817 MarioBonusTex(10)=Texture'XIIIMenu.HUD.mul_bombe' 00818 HudMPWIcons=Texture'XIIIMenu.HUD.Weapon1Icons' 00819 SndFrag=Sound'XIIIsound.Multi__SFXMulti.SFXMulti__hScoreUp' 00820 texFrag=Texture'XIIIMenu.HUD.mul_fright' 00821 soundBonusOn(0)=Sound'XIIIsound.Multi__SFXMulti.SFXMulti__hInvulnOn' 00822 soundBonusOn(1)=Sound'XIIIsound.Multi__SFXMulti.SFXMulti__hInvisibOn' 00823 soundBonusOn(2)=Sound'XIIIsound.Multi__SFXMulti.SFXMulti__hSuperDamOn' 00824 soundBonusOn(3)=Sound'XIIIsound.Multi__SFXMulti.SFXMulti__hRegenAct' 00825 soundBonusOn(4)=Sound'XIIIsound.Multi__SFXMulti.SFXMulti__hTeleportable' 00826 soundBonusOn(5)=Sound'XIIIsound.Multi__SFXMulti.SFXMulti__hBoostOn' 00827 soundBonusOn(6)=Sound'XIIIsound.Multi__SFXMulti.SFXMulti__hLoosArmurOn' 00828 soundBonusOn(7)=Sound'XIIIsound.Multi__SFXMulti.SFXMulti__hLoosLifeOn' 00829 soundBonusOn(11)=Sound'XIIIsound.Multi__SFXMulti.SFXMulti__hSuperArmor' 00830 soundBonusOff(0)=Sound'XIIIsound.Multi__SFXMulti.SFXMulti__hInvulnOff' 00831 soundBonusOff(1)=Sound'XIIIsound.Multi__SFXMulti.SFXMulti__hInvisibOff' 00832 soundBonusOff(2)=Sound'XIIIsound.Multi__SFXMulti.SFXMulti__hSuperDamOff' 00833 soundBonusOff(3)=Sound'XIIIsound.Multi__SFXMulti.SFXMulti__hRegenOff' 00834 soundBonusOff(4)=Sound'XIIIsound.Multi__SFXMulti.SFXMulti__hTeleportAct' 00835 soundBonusOff(5)=Sound'XIIIsound.Multi__SFXMulti.SFXMulti__hBoostOff' 00836 soundBonusOff(6)=Sound'XIIIsound.Multi__SFXMulti.SFXMulti__hLoosArmurOff' 00837 soundBonusOff(7)=Sound'XIIIsound.Multi__SFXMulti.SFXMulti__hLoosLifeOff' 00838 BonusText(0)="Invulnerability" 00839 BonusText(1)="Invisibility" 00840 BonusText(2)="Super Damage" 00841 BonusText(3)="Regeneration" 00842 BonusText(4)="Teleport" 00843 BonusText(5)="Super Boost" 00844 BonusText(6)="Lose Armor" 00845 BonusText(7)="Lose Life" 00846 BonusText(8)="Super Armor" 00847 BonusText(9)="You Got The Flag" 00848 BonusText(10)="You Got The Bomb" 00849 BonusText(11)="Super Armor" 00850 BonusLifeTime(0)=15.000000 00851 BonusLifeTime(1)=15.000000 00852 BonusLifeTime(2)=15.000000 00853 BonusLifeTime(3)=15.000000 00854 BonusLifeTime(4)=60.000000 00855 BonusLifeTime(5)=15.000000 00856 BonusLifeTime(6)=20.000000 00857 BonusLifeTime(7)=20.000000 00858 BonusLifeTime(8)=20000.000000 00859 BonusLifeTime(9)=20000.000000 00860 BonusLifeTime(10)=20000.000000 00861 BonusLifeTime(11)=20000.000000 00862 WaitInitTex=Texture'XIIICine.effets.Baommm' 00863 BadConnectTex=Texture'XIIIMenu.HUD.badconnection' 00864 fTranspWarningDamage=0.500000 00865 }

End Source Code