SarkBall
Class SarkBallScoreBoard

source: c:\runehov\SarkBall\Classes\SarkBallScoreBoard.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.Info
         |
         +--Engine.ScoreBoard
            |
            +--RuneI.RuneScoreBoard
               |
               +--RuneI.RuneScoreBoardTeam
                  |
                  +--SarkBall.SarkBallScoreBoard
Direct Known Subclasses:None

class SarkBallScoreBoard
extends RuneI.RuneScoreBoardTeam

//----------------------------------------------------------- // SarkBallScoreBoard //-----------------------------------------------------------

Function Summary
 void DrawPlayerInfo(Canvas Canvas, PlayerReplicationInfo PRI, float XOffset, float YOffset)
 void DrawTableHeadings(Canvas Canvas)



Source Code


00001	//-----------------------------------------------------------
00002	// SarkBallScoreBoard
00003	//-----------------------------------------------------------
00004	class SarkBallScoreBoard expands RuneScoreboardTeam;
00005	
00006	function DrawTableHeadings( canvas Canvas)
00007	{
00008	     local float XL, YL;
00009	     local float YOffset;
00010	
00011	     Canvas.DrawColor = GoldColor;
00012	     Canvas.StrLen("00", XL, YL);
00013	     YOffset = Canvas.CurY;
00014	
00015	     // Name
00016	     Canvas.SetPos(Canvas.ClipX*0.13, YOffset);
00017	     Canvas.DrawText(NameText, false);
00018	
00019	     // Frags
00020	     Canvas.SetPos(Canvas.ClipX*0.35, YOffset);
00021	     Canvas.DrawText(FragsText, false);
00022	
00023	     // Draw Deaths
00024	     Canvas.SetPos(Canvas.ClipX*0.40, YOffset);
00025	     Canvas.DrawText(DeathsText, false);
00026	
00027	     // Draw Goals
00028	     Canvas.SetPos(Canvas.ClipX*0.45, YOffset);
00029	     Canvas.DrawText("Gls", false);
00030	
00031	     // Draw Assists
00032	     Canvas.SetPos(Canvas.ClipX*0.50, YOffset);
00033	     Canvas.DrawText("Ast", false);
00034	
00035	     // Draw Interceptions
00036	     Canvas.SetPos(Canvas.ClipX*0.55, YOffset);
00037	     Canvas.DrawText("Int", false);
00038	
00039	     // Draw Score
00040	     Canvas.SetPos(Canvas.ClipX*0.60, YOffset);
00041	     Canvas.DrawText("Score", false);
00042	
00043	     if (Canvas.ClipX > 512)
00044	     {
00045	          // Ping
00046	          Canvas.SetPos(Canvas.ClipX*0.8, YOffset);
00047	          Canvas.DrawText(PingText, false);
00048	     }
00049	
00050	     // Draw seperator
00051	     YOffset += YL*1.25;
00052	     Canvas.DrawColor = WhiteColor;
00053	     Canvas.SetPos(Canvas.ClipX*0.1, YOffset);
00054	     Canvas.DrawTile(Seperator, Canvas.ClipX*0.8, YL*0.5, 0, 0, Seperator.USize, Seperator.VSize);
00055	     YOffset += YL*0.75;
00056	     Canvas.SetPos(Canvas.ClipX*0.1, YOffset);
00057	}
00058	
00059	function DrawPlayerInfo( canvas Canvas, PlayerReplicationInfo PRI, float XOffset, float YOffset)
00060	{
00061	     local bool bLocalPlayer;
00062	     local PlayerPawn PlayerOwner;
00063	     local float XL,YL;
00064	     local int AwardPos;
00065	     local float TeamScore;
00066	
00067	     PlayerOwner = PlayerPawn(Owner);
00068	     bLocalPlayer = (PRI.PlayerName == PlayerOwner.PlayerReplicationInfo.PlayerName);
00069	          //FONT ALTER
00070	//     Canvas.Font = RegFont;
00071	     if(MyFonts != None)
00072	          Canvas.Font = MyFonts.GetStaticMedFont();
00073	     else
00074	          Canvas.Font = RegFont;
00075	
00076	     if (PRI.Team < 4)
00077	          TeamScore = RuneGameReplicationInfo(PlayerOwner.GameReplicationInfo).Teams[PRI.Team].Score;
00078	     else
00079	          TeamScore = 0;
00080	
00081	     // Draw Ready
00082	     if (PRI.bReadyToPlay)
00083	     {
00084	          Canvas.StrLen("R ", XL, YL);
00085	          Canvas.SetPos(Canvas.ClipX*0.1-XL, YOffset);
00086	          Canvas.DrawText(ReadyText, false);
00087	     }
00088	
00089	     Canvas.DrawColor = GetTeamColor(PRI.Team);
00090	     if (!bLocalPlayer)
00091	     {
00092	          Canvas.DrawColor.R = byte(float(Canvas.DrawColor.R) * 0.9);
00093	          Canvas.DrawColor.G = byte(float(Canvas.DrawColor.G) * 0.9);
00094	          Canvas.DrawColor.B = byte(float(Canvas.DrawColor.B) * 0.9);
00095	     }
00096	
00097	     // Draw Name
00098	     if (PRI.bAdmin)     
00099	     {     //FONT ALTER
00100	          //Canvas.Font = Font'SmallFont';
00101	          if(MyFonts != None)
00102	               Canvas.Font = MyFonts.GetStaticSmallFont();
00103	          else
00104	               Canvas.Font = Font'SmallFont';
00105	     }
00106	     else
00107	     {     //FONT ALTER
00108	          //Canvas.Font = RegFont;
00109	          if(MyFonts != None)
00110	               Canvas.Font = MyFonts.GetStaticMedFont();
00111	          else
00112	               Canvas.Font = RegFont;
00113	     }
00114	
00115	     Canvas.SetPos(Canvas.ClipX*0.13, YOffset);
00116	     Canvas.DrawText(PRI.PlayerName, false);
00117	               //FONT ALTER
00118	     //Canvas.Font = RegFont;
00119	     if(MyFonts != None)
00120	          Canvas.Font = MyFonts.GetStaticMedFont();
00121	     else
00122	          Canvas.Font = RegFont;
00123	
00124	     // Draw Frags
00125	     Canvas.SetPos(Canvas.ClipX*0.35, YOffset);
00126	     Canvas.DrawText(int(PRI.Score), false);
00127	
00128	     // Draw Deaths
00129	     Canvas.SetPos(Canvas.ClipX*0.40, YOffset);
00130	     Canvas.DrawText(int(PRI.Deaths), false);
00131	
00132	     // Draw Goals
00133	     Canvas.SetPos(Canvas.ClipX*0.45, YOffset);
00134	     Canvas.DrawText(SarkBallPlayerReplicationInfo(PRI).Goals, false);
00135	
00136	     // Draw Assists
00137	     Canvas.SetPos(Canvas.ClipX*0.50, YOffset);
00138	     Canvas.DrawText(SarkBallPlayerReplicationInfo(PRI).Assists, false);
00139	
00140	     // Draw Interceptions
00141	     Canvas.SetPos(Canvas.ClipX*0.55, YOffset);
00142	     Canvas.DrawText(SarkBallPlayerReplicationInfo(PRI).Interceptions, false);
00143	
00144	     // Draw Score
00145	     Canvas.SetPos(Canvas.ClipX*0.60, YOffset);
00146	     Canvas.DrawText(SarkBallPlayerReplicationInfo(PRI).PlayerScore, false);
00147	
00148	
00149	     if (Canvas.ClipX > 512 && Level.Netmode != NM_Standalone)
00150	     {
00151	          // Draw Ping
00152	          Canvas.SetPos(Canvas.ClipX*0.8, YOffset);
00153	          Canvas.DrawText(PRI.Ping, false);
00154	
00155	          // Packetloss
00156	
00157	          //FONT ALTER
00158	     //     Canvas.Font = RegFont;
00159	          if(MyFonts != None)
00160	               Canvas.Font = MyFonts.GetStaticMedFont();
00161	          else
00162	               Canvas.Font = RegFont;
00163	
00164	          Canvas.DrawColor = WhiteColor;
00165	     }
00166	
00167	     // Draw Awards
00168	     AwardPos = Canvas.ClipX*0.8;
00169	     Canvas.DrawColor = WhiteColor;
00170	          //FONT ALTER
00171	//     Canvas.Font = Font'SmallFont';
00172	     if(MyFonts != None)
00173	          Canvas.Font = MyFonts.GetStaticSmallFont();
00174	     else
00175	          Canvas.Font = Font'SmallFont';
00176	
00177	     Canvas.StrLen("00", XL, YL);
00178	
00179	          //FONT ALTER
00180	     //Canvas.Font = RegFont;
00181	     if(MyFonts != None)
00182	          Canvas.Font = MyFonts.GetStaticMedFont();
00183	     else
00184	          Canvas.Font = RegFont;
00185	}
00186	
00187	defaultproperties
00188	{
00189	    FragsText="Frgs"
00190	    DeathsText="Dths"
00191	    AwardsText="Player Score"
00192	}

End Source Code