improve scoreboard and replace spaces with tabs
This commit is contained in:
parent
04262cb27b
commit
6af64d1f51
@ -859,6 +859,7 @@ static final function string Trim(coerce string S)
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
// Font'UI_Canvas_Fonts.Font_Main'
|
||||
MainFont=Font'KFScoreboardExt_Assets.Font.KFMainFont'
|
||||
NumberFont=Font'UI_Canvas_Fonts.Font_General'
|
||||
InfiniteFont=Font'KFScoreboardExt_Assets.Font.KFInfiniteFont'
|
||||
|
@ -1,6 +1,7 @@
|
||||
class KFScoreBoard extends KFGUI_Page;
|
||||
|
||||
var transient float PerkXPos, PlayerXPos, StateXPos, TimeXPos, HealXPos, KillsXPos, AssistXPos, CashXPos, DeathXPos, PingXPos;
|
||||
var transient float StatusXPos, PerkXPos, PlayerXPos, HealthXPos, TimeXPos, KillsXPos, AssistXPos, CashXPos, DeathXPos, PingXPos;
|
||||
var transient float StatusWBox, PlayerWBox, PerkWBox, CashWBox, KillsWBox, AssistWBox, HealthWBox, PingWBox;
|
||||
var transient float NextScoreboardRefresh;
|
||||
|
||||
var int PlayerIndex;
|
||||
@ -188,35 +189,33 @@ function DrawMenu()
|
||||
Canvas.SetDrawColor(250, 250, 250, 255);
|
||||
|
||||
// Calc X offsets
|
||||
PerkXPos = Width * 0.01;
|
||||
PlayerXPos = Width * 0.2;
|
||||
KillsXPos = Width * 0.5;
|
||||
AssistXPos = Width * 0.6;
|
||||
CashXPos = Width * 0.7;
|
||||
StateXPos = Width * 0.8;
|
||||
PingXPos = Width * 0.92;
|
||||
StatusXPos = Width * 0.01;
|
||||
PlayerXPos = Width * 0.20;
|
||||
PerkXPos = Width * 0.40;
|
||||
CashXPos = Width * 0.57;
|
||||
KillsXPos = Width * 0.66;
|
||||
AssistXPos = Width * 0.75;
|
||||
HealthXPos = Width * 0.84;
|
||||
PingXPos = Width * 0.93;
|
||||
|
||||
StatusWBox = PlayerXPos - StatusXPos;
|
||||
PlayerWBox = PerkXPos - PlayerXPos;
|
||||
PerkWBox = CashXPos - PerkXPos;
|
||||
CashWBox = KillsXPos - CashXPos;
|
||||
KillsWBox = AssistXPos - KillsXPos;
|
||||
AssistWBox = HealthXPos - AssistXPos;
|
||||
HealthWBox = PingXPos - HealthXPos;
|
||||
PingWBox = Width - PingXPos;
|
||||
|
||||
// Header texts
|
||||
Canvas.SetPos (XPos + PerkXPos, YPos);
|
||||
Canvas.DrawText (class'KFGFxMenu_Inventory'.default.PerkFilterString, , FontScalar, FontScalar);
|
||||
|
||||
Canvas.SetPos (XPos + KillsXPos, YPos);
|
||||
Canvas.DrawText (class'KFGFxHUD_ScoreboardWidget'.default.KillsString, , FontScalar, FontScalar);
|
||||
|
||||
Canvas.SetPos (XPos + AssistXPos, YPos);
|
||||
Canvas.DrawText (class'KFGFxHUD_ScoreboardWidget'.default.AssistsString, , FontScalar, FontScalar);
|
||||
|
||||
Canvas.SetPos (XPos + CashXPos, YPos);
|
||||
Canvas.DrawText (class'KFGFxHUD_ScoreboardWidget'.default.DoshString, , FontScalar, FontScalar);
|
||||
|
||||
Canvas.SetPos (XPos + StateXPos, YPos);
|
||||
Canvas.DrawText ("STATE", , FontScalar, FontScalar);
|
||||
|
||||
Canvas.SetPos (XPos + PlayerXPos, YPos);
|
||||
Canvas.DrawText (class'KFGFxHUD_ScoreboardWidget'.default.PlayerString, , FontScalar, FontScalar);
|
||||
|
||||
Canvas.SetPos (XPos + PingXPos, YPos);
|
||||
Canvas.DrawText (class'KFGFxHUD_ScoreboardWidget'.default.PingString, , FontScalar, FontScalar);
|
||||
DrawTextWLeft("STATUS", XPos + StatusXPos, YPos, FontScalar);
|
||||
DrawTextWLeft(class'KFGFxHUD_ScoreboardWidget'.default.PlayerString, XPos + PlayerXPos, YPos, FontScalar);
|
||||
DrawTextWLeft(class'KFGFxMenu_Inventory'.default.PerkFilterString, XPos + PerkXPos, YPos, FontScalar);
|
||||
DrawTextWCenter(class'KFGFxHUD_ScoreboardWidget'.default.KillsString, XPos + KillsXPos, YPos, KillsWBox, FontScalar);
|
||||
DrawTextWCenter(class'KFGFxHUD_ScoreboardWidget'.default.AssistsString, XPos + AssistXPos, YPos, AssistWBox, FontScalar);
|
||||
DrawTextWCenter(class'KFGFxHUD_ScoreboardWidget'.default.DoshString, XPos + CashXPos, YPos, CashWBox, FontScalar);
|
||||
DrawTextWCenter("HEALTH", XPos + HealthXPos, YPos, HealthWBox, FontScalar);
|
||||
DrawTextWCenter(class'KFGFxHUD_ScoreboardWidget'.default.PingString, XPos + PingXPos, YPos, PingWBox, FontScalar);
|
||||
|
||||
PlayersList.XPosition = ((Canvas.ClipX - Width) * 0.5) / InputPos[2];
|
||||
PlayersList.YPosition = (YPos + (YL + 4)) / InputPos[3];
|
||||
@ -225,6 +224,23 @@ function DrawMenu()
|
||||
PlayersList.ChangeListSize(KFPRIArray.Length);
|
||||
}
|
||||
|
||||
function DrawTextWCenter(string Str, float XPos, float YPos, float BoxWidth, float FontScalar)
|
||||
{
|
||||
local float TextWidth;
|
||||
local float TextHeight;
|
||||
|
||||
Canvas.TextSize(Str, TextWidth, TextHeight, FontScalar, FontScalar);
|
||||
|
||||
Canvas.SetPos(XPos + (BoxWidth - TextWidth)/2 , YPos);
|
||||
Canvas.DrawText(Str, , FontScalar, FontScalar);
|
||||
}
|
||||
|
||||
function DrawTextWLeft(string Str, float XPos, float YPos, float FontScalar)
|
||||
{
|
||||
Canvas.SetPos(XPos, YPos);
|
||||
Canvas.DrawText(Str, , FontScalar, FontScalar);
|
||||
}
|
||||
|
||||
function DrawPlayerEntry( Canvas C, int Index, float YOffset, float Height, float Width, bool bFocus )
|
||||
{
|
||||
local string S, StrValue;
|
||||
@ -251,6 +267,17 @@ function DrawPlayerEntry( Canvas C, int Index, float YOffset, float Height, floa
|
||||
|
||||
C.SetDrawColor(250,250,250,255);
|
||||
|
||||
// Status
|
||||
if (KFPRI.bAdmin)
|
||||
{
|
||||
S = "Admin";
|
||||
}
|
||||
else
|
||||
{
|
||||
S = "Player";
|
||||
}
|
||||
DrawTextWLeft(S, StatusXPos, TextYOffset, FontScalar);
|
||||
|
||||
// Perk
|
||||
if( bIsZED )
|
||||
{
|
||||
@ -259,8 +286,7 @@ function DrawPlayerEntry( Canvas C, int Index, float YOffset, float Height, floa
|
||||
C.DrawRect (Height-5, Height-5, Texture2D'UI_Widgets.MenuBarWidget_SWF_IF');
|
||||
|
||||
S = "ZED";
|
||||
C.SetPos (PerkXPos + Height, TextYOffset);
|
||||
C.DrawText (S, , FontScalar, FontScalar);
|
||||
DrawTextWLeft(S, PerkXPos + Height, TextYOffset, FontScalar);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -290,15 +316,14 @@ function DrawPlayerEntry( Canvas C, int Index, float YOffset, float Height, floa
|
||||
}
|
||||
|
||||
C.SetDrawColor(250,250,250,255);
|
||||
C.SetPos(PerkIconPosX + PerkIconSize + (Owner.HUDOwner.ScaledBorderSize*2), TextYOffset);
|
||||
C.DrawText(Level@KFPRI.CurrentPerkClass.default.PerkName, , FontScalar, FontScalar);
|
||||
S = Level@KFPRI.CurrentPerkClass.default.PerkName;
|
||||
DrawTextWLeft(S, PerkIconPosX + PerkIconSize + (Owner.HUDOwner.ScaledBorderSize*2), TextYOffset, FontScalar);
|
||||
}
|
||||
else
|
||||
{
|
||||
C.SetDrawColor(250,250,250,255);
|
||||
S = "No Perk";
|
||||
C.SetPos (PerkXPos + Height, TextYOffset);
|
||||
C.DrawText (S, , FontScalar, FontScalar);
|
||||
DrawTextWLeft(S, PerkXPos + Height, TextYOffset, FontScalar);
|
||||
}
|
||||
}
|
||||
|
||||
@ -317,25 +342,20 @@ function DrawPlayerEntry( Canvas C, int Index, float YOffset, float Height, floa
|
||||
CheckAvatar(KFPRI, OwnerPC);
|
||||
|
||||
// Player
|
||||
C.SetPos (PlayerXPos, TextYOffset);
|
||||
|
||||
if( Len(KFPRI.PlayerName) > 25 )
|
||||
S = Left(KFPRI.PlayerName, 25);
|
||||
else S = KFPRI.PlayerName;
|
||||
C.DrawText (S, , FontScalar, FontScalar);
|
||||
DrawTextWLeft(S, PlayerXPos, TextYOffset, FontScalar);
|
||||
|
||||
C.SetDrawColor(255,255,255,255);
|
||||
|
||||
// Kill
|
||||
C.SetPos (KillsXPos, TextYOffset);
|
||||
C.DrawText (string (KFPRI.Kills), , FontScalar, FontScalar);
|
||||
DrawTextWCenter(string (KFPRI.Kills), KillsXPos, TextYOffset, KillsWBox, FontScalar);
|
||||
|
||||
// Assist
|
||||
C.SetPos (AssistXPos, TextYOffset);
|
||||
C.DrawText (string (KFPRI.Assists), , FontScalar, FontScalar);
|
||||
DrawTextWCenter(string (KFPRI.Assists), AssistXPos, TextYOffset, AssistWBox, FontScalar);
|
||||
|
||||
// Cash
|
||||
C.SetPos (CashXPos, TextYOffset);
|
||||
if( bIsZED )
|
||||
{
|
||||
C.SetDrawColor(250, 0, 0, 255);
|
||||
@ -346,11 +366,11 @@ function DrawPlayerEntry( Canvas C, int Index, float YOffset, float Height, floa
|
||||
C.SetDrawColor(250, 250, 100, 255);
|
||||
StrValue = GetNiceSize(int(KFPRI.Score));
|
||||
}
|
||||
C.DrawText (StrValue, , FontScalar, FontScalar);
|
||||
DrawTextWCenter(StrValue, CashXPos, TextYOffset, CashWBox, FontScalar);
|
||||
|
||||
C.SetDrawColor(255,255,255,255);
|
||||
|
||||
// State
|
||||
// Health
|
||||
if( !KFPRI.bReadyToPlay && KFGRI.bMatchHasBegun )
|
||||
{
|
||||
C.SetDrawColor(250,0,0,255);
|
||||
@ -381,9 +401,7 @@ function DrawPlayerEntry( Canvas C, int Index, float YOffset, float Height, floa
|
||||
|
||||
S = string (KFPRI.PlayerHealth) @"HP";
|
||||
}
|
||||
|
||||
C.SetPos (StateXPos, TextYOffset);
|
||||
C.DrawText (S, , FontScalar, FontScalar);
|
||||
DrawTextWCenter(S, HealthXPos, TextYOffset, HealthWBox, FontScalar);
|
||||
|
||||
C.SetDrawColor(250,250,250,255);
|
||||
|
||||
@ -405,8 +423,7 @@ function DrawPlayerEntry( Canvas C, int Index, float YOffset, float Height, floa
|
||||
|
||||
C.TextSize(MaxPing, XL, YL, FontScalar, FontScalar);
|
||||
|
||||
C.SetPos(PingXPos, TextYOffset);
|
||||
C.DrawText(S,, FontScalar, FontScalar);
|
||||
DrawTextWLeft(S, PingXPos, TextYOffset, FontScalar);
|
||||
|
||||
DrawPingBars(C, YOffset + (Height/2) - ((Height*0.5)/2), Width - (Height*0.5) - (Owner.HUDOwner.ScaledBorderSize*2), Height*0.5, Height*0.5, float(Ping));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user