## XIIIMP
Class XIIIMPCTFScoreBoard

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

    Core.Object
       |
       +--Engine.Actor
          |
          +--Engine.Info
             |
             +--Engine.ScoreBoard
                |
                +--XIIIMP.XIIIMPScoreBoard
                   |
                   +--XIIIMP.XIIIMPTeamScoreBoard
                      |
                      +--XIIIMP.XIIIMPCTFScoreBoard

Direct Known Subclasses:XIIIMPSabotageScoreBoard

class XIIIMPCTFScoreBoard
extends XIIIMP.XIIIMPTeamScoreBoard

    //-----------------------------------------------------------
    //
    //-----------------------------------------------------------

Variables
`string` | `strFlag`

Function Summary
`void` | `DrawInfoLine3(Canvas C, string Info1, string Info2, string Info3, color LineColor, color BgColor, bool AddBg, bool bFlag, int ViewPortNumber, optional bool, optional bool)`
`void` | `ShowScores(Canvas C, int ViewPortId, int PlayerNumber)`

Source Code

    00001	//-----------------------------------------------------------
    00002	//
    00003	//-----------------------------------------------------------
    00004	class XIIIMPCTFScoreBoard extends XIIIMPTeamScoreBoard;
    00005
    00006	var localized string strFlag;
    00007
    00008	function ShowScores( Canvas C , int ViewPortId , int PlayerNumber )
    00009	{
    00010	    local color BgColor;
    00011	    local int Loop;
    00012	    local string PName,PFrag,PDeath;
    00013	    local bool IsMe, HasTheFlag;
    00014	    local XIIIMPFlag Flag;
    00015	    local XIIIGameReplicationInfo TGRI;
    00016
    00017	    if ( (PlayerOwner == none) || (PlayerOwner.GameReplicationInfo == none) )
    00018	      return; // wait for init
    00019
    00020	    TGRI = XIIIGameReplicationInfo(PlayerOwner.GameReplicationInfo);
    00021
    00022	    if( (TGRI.iGameState==1) && ( Level.NetMode == NM_Standalone ) )
    00023	    {
    00024	      if( PlayerNumber == 1 )
    00025	        C.Font = BigFont;
    00026	      else
    00027	        C.Font = SmallFont;
    00028
    00029	      GetDownMargin( C , ViewPortId , PlayerNumber );
    00030	      DrawTrailer(C);
    00031	      return;
    00032	    }
    00033
    00034	    UpdatePlayerList();
    00035
    00036	    GetUpMargin( C , ViewPortId , PlayerNumber );
    00037
    00038	    // Header
    00039	    DrawInfoLine( C,PlayerString,FragsString,DeathsString,HudBasicColor,HudBasicColor,false,PlayerNumber );
    00040	    YP += 8;
    00041
    00042	    //Players ...
    00043	    for ( Loop=0; Loop<PlayerCount; Loop++ )
    00044	    {
    00045	        IsMe = ( Ordered[Loop] == PlayerOwner.PlayerReplicationInfo );
    00046	        BgColor = Teamcolor[Ordered[Loop].Team.TeamIndex];
    00047
    00048	        PName = Ordered[Loop].PlayerName;
    00049	        PFrag = string( int(Ordered[Loop].Score));
    00050	        PDeath = string( int(Ordered[Loop].Deaths));
    00051
    00052	        Flag = XIIIMPFlag(PlayerOwner.GameReplicationInfo.Teams[0].Flag);
    00053	        HasTheFlag = false;
    00054	        if ( (Flag != none) && (Flag.Holder != none) && (Flag.Holder.Controller.PlayerReplicationInfo == Ordered[Loop]) )
    00055	          HasTheFlag = true;
    00056	        if( !HasTheFlag )
    00057	        {
    00058	          Flag = XIIIMPFlag(PlayerOwner.GameReplicationInfo.Teams[1].Flag);
    00059	          if ( (Flag != none) && (Flag.Holder != none) && (Flag.Holder.Controller.PlayerReplicationInfo == Ordered[Loop]) )
    00060	            HasTheFlag = true;
    00061	        }
    00062	        DrawInfoLine3( C, PName,PFrag,PDeath,HudBasicColor,BgColor,IsMe, HasTheFlag,PlayerNumber, Ordered[Loop].bWaitingPlayer, !Ordered[Loop].bReadyToPlay  );
    00063	    }
    00064
    00065	    if (TGRI.iGameState==3)
    00066	        DrawTeamScore(C);
    00067
    00068	    // Trail
    00069	    GetDownMargin( C , ViewPortId , PlayerNumber );
    00070	    DrawTrailer(C);
    00071	}
    00072
    00073	function DrawInfoLine3(Canvas C, string Info1, string Info2, string Info3, color LineColor, color BgColor , bool AddBg, bool bFlag, int ViewPortNumber, optional bool bDrawReadyToPlay, optional bool bNotReadyToPlay)
    00074	{
    00075	    local float W,H, IconSize, Temp;
    00076	    local int XP;
    00077
    00078	    if( bFlag )
    00079	        Info1 = Info1@strFlag;
    00080
    00081	    if( ViewPortNumber == 1 )
    00082	        C.Font = BigFont;
    00083	    else
    00084	        C.Font = SmallFont;
    00085
    00086	    C.SpaceX = 1;
    00087	    C.StrLen(Info1, W, H);
    00088	//    IconSize = (H) / SkullTex.VSize;
    00089	    XP = C.CLipX*0.15;
    00090
    00091	    // BackGround Icon + Text
    00092	    C.bUseBorder = false;
    00093	    C.Style = ERenderStyle.STY_Alpha;
    00094	    C.DrawColor = BgColor*0.3;
    00095	    C.DrawColor.A = 60;
    00096
    00097	    C.SetPos(XP,YP);
    00098	    OwnerHud.DrawStdBackGround(C, H-4, C.CLipX*0.7 - 2*(H-4));
    00099
    00100	    C.Style = ERenderStyle.STY_Translucent;
    00101
    00102	    C.DrawColor = BgColor;
    00103	    C.DrawColor.A = 200;
    00104
    00105	    C.SetPos(XP,YP);
    00106	    OwnerHud.DrawStdBackGround(C, H-4, C.CLipX*0.7 - 2*(H-4));
    00107
    00108	    // Text
    00109	    C.Style=ERenderStyle.STY_Normal;
    00110
    00111	    C.DrawColor = LineColor*0.3;
    00112	    C.SetPos(XP+H+4+1,YP-1);
    00113	    C.DrawText(Info1, false);
    00114
    00115	    C.DrawColor = LineColor;
    00116	    C.SetPos(XP+H+4,YP-2);
    00117	    C.DrawText(Info1, false);
    00118
    00119	    C.StrLen(Info2, W, H);
    00120
    00121	    C.DrawColor = LineColor*0.3;
    00122	    C.SetPos(C.ClipX*0.58 + 1 - W/2,YP-1);
    00123	    C.DrawText(Info2, false);
    00124
    00125	    C.DrawColor = LineColor;
    00126	    C.SetPos(C.ClipX*0.58 - W/2,YP-2);
    00127	    C.DrawText(Info2, false);
    00128
    00129	    C.StrLen(Info3, W, H);
    00130
    00131	    C.DrawColor = LineColor*0.3;
    00132	    C.SetPos(C.ClipX*0.75 + 1 - W/2,YP-1);
    00133	    C.DrawText(Info3, false);
    00134
    00135	    C.DrawColor = LineColor;
    00136	    C.SetPos(C.ClipX*0.75 - W/2,YP-2);
    00137	    C.DrawText(Info3, false);
    00138
    00139	    // Player Ready ?
    00140	    if ( (Level.NetMode != NM_StandAlone) && bDrawReadyToPlay && XIIIGameReplicationInfo(PlayerOwner.GameReplicationInfo).iGameState != 2 )
    00141	    {
    00142	      C.Style = ERenderStyle.STY_Alpha;
    00143	      if ( bNotReadyToPlay )
    00144	        C.DrawColor = WhiteColor * 0.5;
    00145	      else
    00146	        C.DrawColor = GoldColor;
    00147	      C.SetPos(XP-H/4,YP-3);
    00148	      C.DrawIcon(NotReadyTex, (H+3)/NotReadyTex.VSize);
    00149	      bDrawReadyToPlay = true;
    00150	    }
    00151	    else
    00152	      bDrawReadyToPlay = false;
    00153
    00154	    if( AddBg )
    00155	    {
    00156	      C.Style=ERenderStyle.STY_Normal;
    00157	      C.DrawColor = HudBasicColor;
    00158	      C.DrawColor.A = 255;
    00159
    00160	      IconSize = H;
    00161	      IconSize *= sin((Level.TimeSeconds*0.9-int(Level.TimeSeconds*0.9))*3.14);
    00162	      if ( bDrawReadyToPlay )
    00163	        C.SetPos(XP-(IconSize)/2+(h-4)/2-H-3,YP-2);
    00164	      else
    00165	        C.SetPos(XP-(IconSize)/2+(h-4)/2,YP-2);
    00166	      C.DrawTile( PlayerTex,IconSize,H,0,0,PlayerTex.USize,PlayerTex.VSize);
    00167	      C.bUseBorder = false;
    00168	    }
    00169
    00170	    YP += H;
    00171	    C.SpaceX = 0;
    00172	}
    00173
    00174
    00175
    00176	defaultproperties
    00177	{
    00178	     strFlag="(Flag)"
    00179	     FragsString="Points"
    00180	}

End Source Code