WIP: style

This commit is contained in:
GenZmeY 2021-06-09 02:22:35 +03:00
parent bb8452fa0b
commit 77300e10b2
5 changed files with 255 additions and 100 deletions

View File

@ -21,13 +21,8 @@ var float PingBars,IdealPing,MaxPing;
var array<RankInfo> CustomRanks; var array<RankInfo> CustomRanks;
var array<UIDRankRelation> PlayerRankRelations; var array<UIDRankRelation> PlayerRankRelations;
var string SystemAdminRank; var SCESettings Settings;
var ColorRGB SystemAdminColor; var SCEStyle Style;
var Fields SystemAdminApplyColorToFields;
var string SystemPlayerRank;
var ColorRGB SystemPlayerColor;
var Fields SystemPlayerApplyColorToFields;
function InitMenu() function InitMenu()
{ {
@ -179,10 +174,10 @@ function DrawMenu()
BoxH = YL + BorderSize; BoxH = YL + BorderSize;
// Top Rect (Server name) // Top Rect (Server name)
Canvas.SetDrawColor(75, 0, 0, 200); SetDrawColor(Canvas, Style.ServerNameBoxColor);
Owner.CurrentStyle.DrawRectBox(BoxX, YPos, BoxW, BoxH, Edge, 2); Owner.CurrentStyle.DrawRectBox(BoxX, YPos, BoxW, BoxH, Edge, 2);
Canvas.SetDrawColor(250, 250, 250, 255); SetDrawColor(Canvas, Style.ServerNameTextColor);
S = KFGRI.ServerName; S = KFGRI.ServerName;
DrawTextShadowHVCenter(S, BoxX, YPos, BoxW, FontScalar); DrawTextShadowHVCenter(S, BoxX, YPos, BoxW, FontScalar);
@ -191,10 +186,10 @@ function DrawMenu()
// Mid Left Rect (Info) // Mid Left Rect (Info)
BoxW = Width * 0.7; BoxW = Width * 0.7;
BoxH = YL * 2 + BorderSize * 2; BoxH = YL * 2 + BorderSize * 2;
Canvas.SetDrawColor(30, 30, 30, 200); SetDrawColor(Canvas, Style.GameInfoBoxColor);
Owner.CurrentStyle.DrawRectBox(BoxX, YPos, BoxW, BoxH, Edge, 1); Owner.CurrentStyle.DrawRectBox(BoxX, YPos, BoxW, BoxH, Edge, 1);
Canvas.SetDrawColor(250, 250, 250, 255); SetDrawColor(Canvas, Style.GameInfoTextColor);
S = class'KFCommon_LocalizedStrings'.static.GetFriendlyMapName(PC.WorldInfo.GetMapName(true)); S = class'KFCommon_LocalizedStrings'.static.GetFriendlyMapName(PC.WorldInfo.GetMapName(true));
DrawTextShadowHLeftVCenter(S, BoxX + Edge, YPos, FontScalar); DrawTextShadowHLeftVCenter(S, BoxX + Edge, YPos, FontScalar);
@ -204,10 +199,10 @@ function DrawMenu()
// Mid Right Rect (Wave) // Mid Right Rect (Wave)
BoxX = BoxX + BoxW; BoxX = BoxX + BoxW;
BoxW = Width - BoxW; BoxW = Width - BoxW;
Canvas.SetDrawColor(10, 10, 10, 200); SetDrawColor(Canvas, Style.WaveBoxColor);
Owner.CurrentStyle.DrawRectBox(BoxX, YPos, BoxW, BoxH, Edge, 0); Owner.CurrentStyle.DrawRectBox(BoxX, YPos, BoxW, BoxH, Edge, 0);
Canvas.SetDrawColor(250, 250, 250, 255); SetDrawColor(Canvas, Style.WaveTextColor);
S = class'KFGFxHUD_ScoreboardMapInfoContainer'.default.WaveString; S = class'KFGFxHUD_ScoreboardMapInfoContainer'.default.WaveString;
DrawTextShadowHVCenter(S, BoxX, YPos, BoxW, FontScalar); DrawTextShadowHVCenter(S, BoxX, YPos, BoxW, FontScalar);
DrawTextShadowHVCenter(WaveText(), BoxX, YPos + YL, BoxW, FontScalar); DrawTextShadowHVCenter(WaveText(), BoxX, YPos + YL, BoxW, FontScalar);
@ -218,10 +213,10 @@ function DrawMenu()
BoxX = XPos; BoxX = XPos;
BoxW = Width; BoxW = Width;
BoxH = YL + BorderSize; BoxH = YL + BorderSize;
Canvas.SetDrawColor(75, 0, 0, 200); SetDrawColor(Canvas, Style.PlayerCountBoxColor);
Owner.CurrentStyle.DrawRectBox(BoxX, YPos, BoxW, BoxH, Edge, 4); Owner.CurrentStyle.DrawRectBox(BoxX, YPos, BoxW, BoxH, Edge, 4);
Canvas.SetDrawColor(250, 250, 250, 255); SetDrawColor(Canvas, Style.PlayerCountTextColor);
S = "Players: " $ NumPlayer $ " / " $ KFGRI.MaxHumanCount $ " " $ "Spectators: " $ NumSpec; S = "Players: " $ NumPlayer $ " / " $ KFGRI.MaxHumanCount $ " " $ "Spectators: " $ NumSpec;
Canvas.TextSize(S, XL, YL, FontScalar, FontScalar); Canvas.TextSize(S, XL, YL, FontScalar, FontScalar);
DrawTextShadowHLeftVCenter(S, BoxX + Edge, YPos, FontScalar); DrawTextShadowHLeftVCenter(S, BoxX + Edge, YPos, FontScalar);
@ -243,7 +238,7 @@ function DrawMenu()
XPos = (Canvas.ClipX - Width) * 0.5; XPos = (Canvas.ClipX - Width) * 0.5;
YPos += YL; YPos += YL;
BoxH = YL + BorderSize; BoxH = YL + BorderSize;
Canvas.SetDrawColor (10, 10, 10, 200); SetDrawColor(Canvas, Style.ListHeaderBoxColor);
Owner.CurrentStyle.DrawRectBox( Owner.CurrentStyle.DrawRectBox(
XPos - BorderSize * 2, XPos - BorderSize * 2,
YPos, YPos,
@ -252,8 +247,6 @@ function DrawMenu()
Edge, Edge,
2); 2);
Canvas.SetDrawColor(250, 250, 250, 255);
// Calc X offsets // Calc X offsets
RankXPos = Owner.HUDOwner.ScaledBorderSize * 8 + Edge; RankXPos = Owner.HUDOwner.ScaledBorderSize * 8 + Edge;
PlayerXPos = Width * 0.20; PlayerXPos = Width * 0.20;
@ -274,6 +267,7 @@ function DrawMenu()
PingWBox = Width - PingXPos; PingWBox = Width - PingXPos;
// Header texts // Header texts
SetDrawColor(Canvas, Style.ListHeaderTextColor);
DrawTextShadowHLeftVCenter("RANK", XPos + RankXPos, YPos, FontScalar); DrawTextShadowHLeftVCenter("RANK", XPos + RankXPos, YPos, FontScalar);
DrawTextShadowHLeftVCenter(class'KFGFxHUD_ScoreboardWidget'.default.PlayerString, XPos + PlayerXPos, YPos, FontScalar); DrawTextShadowHLeftVCenter(class'KFGFxHUD_ScoreboardWidget'.default.PlayerString, XPos + PlayerXPos, YPos, FontScalar);
DrawTextShadowHLeftVCenter(class'KFGFxMenu_Inventory'.default.PerkFilterString, XPos + PerkXPos, YPos, FontScalar); DrawTextShadowHLeftVCenter(class'KFGFxMenu_Inventory'.default.PerkFilterString, XPos + PerkXPos, YPos, FontScalar);
@ -315,6 +309,11 @@ function DrawTextShadowHRightVCenter(string Str, float XPos, float YPos, float B
Owner.CurrentStyle.DrawTextShadow(Str, XPos + BoxWidth - TextWidth, YPos, 1, FontScalar); Owner.CurrentStyle.DrawTextShadow(Str, XPos + BoxWidth - TextWidth, YPos, 1, FontScalar);
} }
function SetDrawColor(Canvas C, ColorRGBA Color)
{
C.SetDrawColor(Color.R, Color.G, Color.B, Color.A);
}
function DrawPlayerEntry( Canvas C, int Index, float YOffset, float Height, float Width, bool bFocus ) function DrawPlayerEntry( Canvas C, int Index, float YOffset, float Height, float Width, bool bFocus )
{ {
local string S, StrValue; local string S, StrValue;
@ -378,28 +377,28 @@ function DrawPlayerEntry( Canvas C, int Index, float YOffset, float Height, floa
// change rect color by HP // change rect color by HP
if( !KFPRI.bReadyToPlay && KFGRI.bMatchHasBegun ) if( !KFPRI.bReadyToPlay && KFGRI.bMatchHasBegun )
{ {
C.SetDrawColor(150,150,150,150); SetDrawColor(C, Style.LeftHPBoxColorNone);
} }
else if ( !KFGRI.bMatchHasBegun ) else if ( !KFGRI.bMatchHasBegun )
{ {
C.SetDrawColor(150,150,150,150); SetDrawColor(C, Style.LeftHPBoxColorNone);
} }
else if( bIsZED && KFTeamInfo_Zeds(GetPlayer().PlayerReplicationInfo.Team) == None ) else if( bIsZED && KFTeamInfo_Zeds(GetPlayer().PlayerReplicationInfo.Team) == None )
{ {
C.SetDrawColor(150,150,150,150); SetDrawColor(C, Style.LeftHPBoxColorNone);
} }
else if (KFPRI.PlayerHealth <= 0 || KFPRI.PlayerHealthPercent <= 0) else if (KFPRI.PlayerHealth <= 0 || KFPRI.PlayerHealthPercent <= 0)
{ {
C.SetDrawColor(200,0,0,150); SetDrawColor(C, Style.LeftHPBoxColorDead);
} }
else else
{ {
if (ByteToFloat(KFPRI.PlayerHealthPercent) >= 0.8) if (ByteToFloat(KFPRI.PlayerHealthPercent) >= float(Settings.HP_High) / 100.0)
C.SetDrawColor(0,200,0,150); SetDrawColor(C, Style.LeftHPBoxColorHigh);
else if (ByteToFloat(KFPRI.PlayerHealthPercent) >= 0.4) else if (ByteToFloat(KFPRI.PlayerHealthPercent) >= float(Settings.HP_Low) / 100.0)
C.SetDrawColor(200,200,0,150); SetDrawColor(C, Style.LeftHPBoxColorMid);
else else
C.SetDrawColor(200,50,50,150); SetDrawColor(C, Style.LeftHPBoxColorLow);
} }
BoxWidth = Owner.HUDOwner.ScaledBorderSize * 8; BoxWidth = Owner.HUDOwner.ScaledBorderSize * 8;
@ -414,9 +413,9 @@ function DrawPlayerEntry( Canvas C, int Index, float YOffset, float Height, floa
TextYOffset = YOffset + (Height * 0.5f) - (YL * 0.5f); TextYOffset = YOffset + (Height * 0.5f) - (YL * 0.5f);
if (PlayerIndex == Index) if (PlayerIndex == Index)
C.SetDrawColor (100, 10, 10, 150); SetDrawColor(C, Style.PlayerOwnerBoxColor);
else else
C.SetDrawColor (30, 30, 30, 150); SetDrawColor(C, Style.PlayerBoxColor);
BoxWidth = CashXPos + Owner.HUDOwner.ScaledBorderSize - BoxWidth; BoxWidth = CashXPos + Owner.HUDOwner.ScaledBorderSize - BoxWidth;
Owner.CurrentStyle.DrawRectBox(XPos, YOffset, BoxWidth, Height, 8); Owner.CurrentStyle.DrawRectBox(XPos, YOffset, BoxWidth, Height, 8);
@ -425,7 +424,7 @@ function DrawPlayerEntry( Canvas C, int Index, float YOffset, float Height, floa
// Right stats box // Right stats box
BoxWidth = Width - XPos; BoxWidth = Width - XPos;
C.SetDrawColor (10, 10, 10, 150); SetDrawColor(C, Style.StatsBoxColor);
Owner.CurrentStyle.DrawRectBox( Owner.CurrentStyle.DrawRectBox(
XPos, XPos,
YOffset, YOffset,
@ -433,21 +432,21 @@ function DrawPlayerEntry( Canvas C, int Index, float YOffset, float Height, floa
Height, Height,
8, 3); 8, 3);
C.SetDrawColor(250,250,250,255);
// Rank // Rank
if (CurrentRank.ApplyColorToFields.Rank) if (CurrentRank.ApplyColorToFields.Rank)
C.SetDrawColor(CurrentRank.TextColor.R,CurrentRank.TextColor.G,CurrentRank.TextColor.B,255); SetDrawColor(C, CurrentRank.TextColor);
else
SetDrawColor(C, Style.RankTextColor);
S = CurrentRank.Rank; S = CurrentRank.Rank;
DrawTextShadowHLeftVCenter(S, RankXPos, TextYOffset, FontScalar); DrawTextShadowHLeftVCenter(S, RankXPos, TextYOffset, FontScalar);
C.SetDrawColor(250,250,250,255);
// Perk // Perk
if( bIsZED ) if( bIsZED )
{ {
C.SetDrawColor(255,0,0,255);
if (CurrentRank.ApplyColorToFields.Perk) if (CurrentRank.ApplyColorToFields.Perk)
C.SetDrawColor(CurrentRank.TextColor.R,CurrentRank.TextColor.G,CurrentRank.TextColor.B,255); SetDrawColor(C, CurrentRank.TextColor);
else
SetDrawColor(C, Style.ZedTextColor);
C.SetPos (PerkXPos, YOffset - ((Height-5) * 0.5f)); C.SetPos (PerkXPos, YOffset - ((Height-5) * 0.5f));
C.DrawRect (Height-5, Height-5, Texture2D'UI_Widgets.MenuBarWidget_SWF_IF'); C.DrawRect (Height-5, Height-5, Texture2D'UI_Widgets.MenuBarWidget_SWF_IF');
@ -481,22 +480,23 @@ function DrawPlayerEntry( Canvas C, int Index, float YOffset, float Height, floa
C.DrawTile(KFPRI.CurrentPerkClass.default.PerkIcon, PerkIconSize, PerkIconSize, 0, 0, 256, 256); C.DrawTile(KFPRI.CurrentPerkClass.default.PerkIcon, PerkIconSize, PerkIconSize, 0, 0, 256, 256);
} }
C.SetDrawColor(250,250,250,255);
if (CurrentRank.ApplyColorToFields.Perk) if (CurrentRank.ApplyColorToFields.Perk)
C.SetDrawColor(CurrentRank.TextColor.R,CurrentRank.TextColor.G,CurrentRank.TextColor.B,255); SetDrawColor(C, CurrentRank.TextColor);
else
SetDrawColor(C, Style.PerkTextColor); // TODO: LevelTextColor
S = Level@KFPRI.CurrentPerkClass.default.PerkName; S = Level@KFPRI.CurrentPerkClass.default.PerkName;
DrawTextShadowHLeftVCenter(S, PerkXPos, TextYOffset, FontScalar); DrawTextShadowHLeftVCenter(S, PerkXPos, TextYOffset, FontScalar);
} }
else else
{ {
C.SetDrawColor(250,250,250,255);
if (CurrentRank.ApplyColorToFields.Perk) if (CurrentRank.ApplyColorToFields.Perk)
C.SetDrawColor(CurrentRank.TextColor.R,CurrentRank.TextColor.G,CurrentRank.TextColor.B,255); SetDrawColor(C, CurrentRank.TextColor);
else
SetDrawColor(C, Style.PerkTextColor);
S = "No Perk"; S = "No Perk";
DrawTextShadowHLeftVCenter(S, PerkXPos, TextYOffset, FontScalar); DrawTextShadowHLeftVCenter(S, PerkXPos, TextYOffset, FontScalar);
} }
} }
C.SetDrawColor(250,250,250,255);
// Avatar // Avatar
if( KFPRI.Avatar != None ) if( KFPRI.Avatar != None )
@ -504,112 +504,129 @@ function DrawPlayerEntry( Canvas C, int Index, float YOffset, float Height, floa
if( KFPRI.Avatar == default.DefaultAvatar ) if( KFPRI.Avatar == default.DefaultAvatar )
CheckAvatar(KFPRI, OwnerPC); CheckAvatar(KFPRI, OwnerPC);
C.SetDrawColor(255,255,255,255); SetDrawColor(C, Style.AvatarBorderColor); // Check
C.SetPos(PlayerXPos - (Height * 1.075), YOffset + (Height * 0.5f) - ((Height - 6) * 0.5f)); C.SetPos(PlayerXPos - (Height * 1.075), YOffset + (Height * 0.5f) - ((Height - 6) * 0.5f));
C.DrawTile(KFPRI.Avatar,Height - 6,Height - 6,0,0,KFPRI.Avatar.SizeX,KFPRI.Avatar.SizeY); C.DrawTile(KFPRI.Avatar,Height - 6,Height - 6,0,0,KFPRI.Avatar.SizeX,KFPRI.Avatar.SizeY);
Owner.CurrentStyle.DrawBoxHollow(PlayerXPos - (Height * 1.075), YOffset + (Height * 0.5f) - ((Height - 6) * 0.5f), Height - 6, Height - 6, 1); Owner.CurrentStyle.DrawBoxHollow(PlayerXPos - (Height * 1.075), YOffset + (Height * 0.5f) - ((Height - 6) * 0.5f), Height - 6, Height - 6, 1);
} }
else if( !KFPRI.bBot ) else if( !KFPRI.bBot )
CheckAvatar(KFPRI, OwnerPC); CheckAvatar(KFPRI, OwnerPC);
C.SetDrawColor(250,250,250,255);
// Player // Player
if (CurrentRank.ApplyColorToFields.Player) if (CurrentRank.ApplyColorToFields.Player)
C.SetDrawColor(CurrentRank.TextColor.R,CurrentRank.TextColor.G,CurrentRank.TextColor.B,255); SetDrawColor(C, CurrentRank.TextColor);
else
SetDrawColor(C, Style.PlayerNameTextColor);
if( Len(KFPRI.PlayerName) > 25 ) if( Len(KFPRI.PlayerName) > 25 )
S = Left(KFPRI.PlayerName, 25); S = Left(KFPRI.PlayerName, 25);
else S = KFPRI.PlayerName; else S = KFPRI.PlayerName;
DrawTextShadowHLeftVCenter(S, PlayerXPos, TextYOffset, FontScalar); DrawTextShadowHLeftVCenter(S, PlayerXPos, TextYOffset, FontScalar);
C.SetDrawColor(250,250,250,255);
// Kill // Kill
if (CurrentRank.ApplyColorToFields.Kills) if (CurrentRank.ApplyColorToFields.Kills)
C.SetDrawColor(CurrentRank.TextColor.R,CurrentRank.TextColor.G,CurrentRank.TextColor.B,255); SetDrawColor(C, CurrentRank.TextColor);
else
SetDrawColor(C, Style.KillsTextColor);
DrawTextShadowHVCenter(string (KFPRI.Kills), KillsXPos, TextYOffset, KillsWBox, FontScalar); DrawTextShadowHVCenter(string (KFPRI.Kills), KillsXPos, TextYOffset, KillsWBox, FontScalar);
C.SetDrawColor(250,250,250,255);
// Assist // Assist
if (CurrentRank.ApplyColorToFields.Assists) if (CurrentRank.ApplyColorToFields.Assists)
C.SetDrawColor(CurrentRank.TextColor.R,CurrentRank.TextColor.G,CurrentRank.TextColor.B,255); SetDrawColor(C, CurrentRank.TextColor);
else
SetDrawColor(C, Style.AssistsTextColor);
DrawTextShadowHVCenter(string (KFPRI.Assists), AssistXPos, TextYOffset, AssistWBox, FontScalar); DrawTextShadowHVCenter(string (KFPRI.Assists), AssistXPos, TextYOffset, AssistWBox, FontScalar);
C.SetDrawColor(250,250,250,255);
// Cash // Cash
if( bIsZED ) if( bIsZED )
{ {
C.SetDrawColor(250, 0, 0, 255); SetDrawColor(C, Style.ZedTextColor);
StrValue = "Brains!"; StrValue = "Brains!";
} }
else else
{ {
C.SetDrawColor(250, 250, 100, 255); if (CurrentRank.ApplyColorToFields.Dosh)
SetDrawColor(C, CurrentRank.TextColor);
else
SetDrawColor(C, Style.DoshTextColor);
StrValue = GetNiceSize(int(KFPRI.Score)); StrValue = GetNiceSize(int(KFPRI.Score));
} }
if (CurrentRank.ApplyColorToFields.Dosh)
C.SetDrawColor(CurrentRank.TextColor.R,CurrentRank.TextColor.G,CurrentRank.TextColor.B,255);
DrawTextShadowHVCenter(StrValue, CashXPos, TextYOffset, CashWBox, FontScalar); DrawTextShadowHVCenter(StrValue, CashXPos, TextYOffset, CashWBox, FontScalar);
C.SetDrawColor(250,250,250,255); // State
// Health
if( !KFPRI.bReadyToPlay && KFGRI.bMatchHasBegun ) if( !KFPRI.bReadyToPlay && KFGRI.bMatchHasBegun )
{ {
C.SetDrawColor(250,0,0,255); SetDrawColor(C, Style.StateTextColorLobby);
S = "LOBBY"; S = "LOBBY";
} }
else if( !KFGRI.bMatchHasBegun ) else if( !KFGRI.bMatchHasBegun )
{ {
C.SetDrawColor(250,0,0,255); if (KFPRI.bReadyToPlay)
S = KFPRI.bReadyToPlay ? "Ready" : "Not Ready"; {
SetDrawColor(C, Style.StateTextColorReady);
S = "Ready";
}
else
{
SetDrawColor(C, Style.StateTextColorNotReady);
S = "Not Ready";
}
} }
else if( bIsZED && KFTeamInfo_Zeds(GetPlayer().PlayerReplicationInfo.Team) == None ) else if( bIsZED && KFTeamInfo_Zeds(GetPlayer().PlayerReplicationInfo.Team) == None )
{ {
C.SetDrawColor(250,0,0,255); SetDrawColor(C, Style.StateTextColorNone);
S = "Unknown"; S = "Unknown";
} }
else if (KFPRI.PlayerHealth <= 0 || KFPRI.PlayerHealthPercent <= 0) else if (KFPRI.PlayerHealth <= 0 || KFPRI.PlayerHealthPercent <= 0)
{ {
C.SetDrawColor(250,0,0,255); if (KFPRI.bOnlySpectator)
S = (KFPRI.bOnlySpectator) ? "Spectator" : "DEAD"; {
SetDrawColor(C, Style.StateTextColorSpectator);
S = "Spectator";
} }
else else
{ {
if (ByteToFloat(KFPRI.PlayerHealthPercent) >= 0.8) SetDrawColor(C, Style.StateTextColorDead);
C.SetDrawColor(0,250,0,255); S = "DEAD";
else if (ByteToFloat(KFPRI.PlayerHealthPercent) >= 0.4) }
C.SetDrawColor(250,250,0,255); }
else else
C.SetDrawColor(250,100,100,255); {
if (ByteToFloat(KFPRI.PlayerHealthPercent) >= float(Settings.HP_High) / 100.0)
SetDrawColor(C, Style.StateTextColorHighHP);
else if (ByteToFloat(KFPRI.PlayerHealthPercent) >= float(Settings.HP_Low) / 100.0)
SetDrawColor(C, Style.StateTextColorMidHP);
else
SetDrawColor(C, Style.StateTextColorLowHP);
S = string (KFPRI.PlayerHealth) @"HP"; S = string (KFPRI.PlayerHealth) @"HP";
} }
if (CurrentRank.ApplyColorToFields.Health) if (CurrentRank.ApplyColorToFields.Health)
C.SetDrawColor(CurrentRank.TextColor.R,CurrentRank.TextColor.G,CurrentRank.TextColor.B,255); SetDrawColor(C, CurrentRank.TextColor);
DrawTextShadowHVCenter(S, HealthXPos, TextYOffset, HealthWBox, FontScalar); DrawTextShadowHVCenter(S, HealthXPos, TextYOffset, HealthWBox, FontScalar);
C.SetDrawColor(250,250,250,255);
// Ping // Ping
if (KFPRI.bBot) if (KFPRI.bBot)
{
SetDrawColor(C, Style.PingTextColorNone);
S = "-"; S = "-";
}
else else
{ {
Ping = int(KFPRI.Ping * `PING_SCALE); Ping = int(KFPRI.Ping * `PING_SCALE);
if (Ping <= 100) if (CurrentRank.ApplyColorToFields.Ping)
C.SetDrawColor(0,250,0,255); SetDrawColor(C, CurrentRank.TextColor);
else if (Ping <= 200) else if (Ping <= Settings.Ping_Low)
C.SetDrawColor(250,250,0,255); SetDrawColor(C, Style.PingTextColorLow);
else C.SetDrawColor(250,100,100,255); else if (Ping <= Settings.Ping_High)
SetDrawColor(C, Style.PingTextColorMid);
else
SetDrawColor(C, Style.PingTextColorHigh);
S = string(Ping); S = string(Ping);
} }
C.TextSize(MaxPing, XL, YL, FontScalar, FontScalar); C.TextSize(MaxPing, XL, YL, FontScalar, FontScalar);
if (CurrentRank.ApplyColorToFields.Ping)
C.SetDrawColor(CurrentRank.TextColor.R,CurrentRank.TextColor.G,CurrentRank.TextColor.B,255);
DrawTextShadowHVCenter(S, PingXPos, TextYOffset, PingWBox/2, FontScalar); DrawTextShadowHVCenter(S, PingXPos, TextYOffset, PingWBox/2, FontScalar);
C.SetDrawColor(250,250,250,255); C.SetDrawColor(250,250,250,255);
@ -621,7 +638,7 @@ final function DrawPingBars( Canvas C, float YOffset, float XOffset, float W, fl
local float PingMul, BarW, BarH, BaseH, XPos, YPos; local float PingMul, BarW, BarH, BaseH, XPos, YPos;
local byte i; local byte i;
PingMul = 1.f - FClamp(FMax(Ping - IdealPing, 1.f) / MaxPing, 0.f, 1.f); PingMul = 1.f - FClamp(FMax(Ping - Settings.Ping_Low, 1.f) / Settings.Ping_High, 0.f, 1.f);
BarW = W / PingBars; BarW = W / PingBars;
BaseH = H / PingBars; BaseH = H / PingBars;
@ -683,14 +700,6 @@ defaultproperties
MaxPing=200.0 MaxPing=200.0
PingBars=5.0 PingBars=5.0
SystemAdminRank="Admin"
SystemAdminColor=(R=250,G=0,B=0)
SystemAdminApplyColorToFields=(Rank=True,Player=True,Perk=False,Dosh=False,Kills=False,Assists=False,Health=False,Ping=False)
SystemPlayerRank="Player"
SystemPlayerColor=(R=250,G=250,B=250)
SystemPlayerApplyColorToFields=(Rank=True,Player=True,Perk=False,Dosh=False,Kills=False,Assists=False,Health=False,Ping=False)
Begin Object Class=KFGUI_List Name=PlayerList Begin Object Class=KFGUI_List Name=PlayerList
XSize=0.625 XSize=0.625
OnDrawItem=DrawPlayerEntry OnDrawItem=DrawPlayerEntry

View File

@ -4,11 +4,11 @@ var public array<UIDRankRelation> PlayerRankRelations;
var public array<RankInfo> CustomRanks; var public array<RankInfo> CustomRanks;
var public string SystemAdminRank; var public string SystemAdminRank;
var public ColorRGB SystemAdminColor; var public ColorRGBA SystemAdminColor;
var public Fields SystemAdminApplyColorToFields; var public Fields SystemAdminApplyColorToFields;
var public string SystemPlayerRank; var public string SystemPlayerRank;
var public ColorRGB SystemPlayerColor; var public ColorRGBA SystemPlayerColor;
var public Fields SystemPlayerApplyColorToFields; var public Fields SystemPlayerApplyColorToFields;
var private bool InitFinished, RanksFinished, InfosFinished; var private bool InitFinished, RanksFinished, InfosFinished;
@ -96,10 +96,10 @@ private reliable client function InfosReplicationFinished()
private reliable client function ClientInitSystem( private reliable client function ClientInitSystem(
string _SystemAdminRank, string _SystemAdminRank,
ColorRGB _SystemAdminColor, ColorRGBA _SystemAdminColor,
Fields _SystemAdminApplyColorToFields, Fields _SystemAdminApplyColorToFields,
string _SystemPlayerRank, string _SystemPlayerRank,
ColorRGB _SystemPlayerColor, ColorRGBA _SystemPlayerColor,
Fields _SystemPlayerApplyColorToFields) Fields _SystemPlayerApplyColorToFields)
{ {
SystemAdminRank = _SystemAdminRank; SystemAdminRank = _SystemAdminRank;

View File

@ -3,7 +3,7 @@ class SystemAdminRank extends Object
config(ScoreboardExt); config(ScoreboardExt);
var config string Rank; var config string Rank;
var config ColorRGB TextColor; var config ColorRGBA TextColor;
var config Fields ApplyColorToFields; var config Fields ApplyColorToFields;
DefaultProperties DefaultProperties

View File

@ -3,7 +3,7 @@ class SystemPlayerRank extends Object
config(ScoreboardExt); config(ScoreboardExt);
var config string Rank; var config string Rank;
var config ColorRGB TextColor; var config ColorRGBA TextColor;
var config Fields ApplyColorToFields; var config Fields ApplyColorToFields;
DefaultProperties DefaultProperties

View File

@ -1,17 +1,163 @@
class Types extends Object; class Types extends Object;
struct ColorRGB struct SCESettings
{ {
var byte R, G, B; string SystemAdminRank;
ColorRGBA SystemAdminColor;
Fields SystemAdminApplyColorToFields;
string SystemPlayerRank;
ColorRGBA SystemPlayerColor;
Fields SystemPlayerApplyColorToFields;
int HP_Low;
int HP_High;
int Ping_Low;
int Ping_High;
int Normal_Low;
int Normal_High;
int Hard_Low;
int Hard_High;
int Suicide_Low;
int Suicide_High;
int HellOnEarth_Low;
int HellOnEarth_High;
StructDefaultProperties StructDefaultProperties
{ {
R=250 SystemAdminRank="Admin"
G=250 SystemAdminColor=(R=250,G=0,B=0)
B=250 SystemAdminApplyColorToFields=(Rank=True,Player=True,Perk=False,Dosh=False,Kills=False,Assists=False,Health=False,Ping=False)
SystemPlayerRank="Player"
SystemPlayerColor=(R=250,G=250,B=250)
SystemPlayerApplyColorToFields=(Rank=True,Player=True,Perk=False,Dosh=False,Kills=False,Assists=False,Health=False,Ping=False)
HP_Low=40
HP_High=80
Ping_Low=60
Ping_High=120;
Normal_Low=0;
Normal_High=0;
Hard_Low=5;
Hard_High=15;
Suicide_Low=15;
Suicide_High=20;
HellOnEarth_Low=20;
HellOnEarth_High=25;
} }
}; };
struct SCEStyle
{
ColorRGBA ServerNameBoxColor;
ColorRGBA ServerNameTextColor
ColorRGBA GameInfoBoxColor;
ColorRGBA GameInfoTextColor;
ColorRGBA WaveBoxColor;
ColorRGBA WaveTextColor;
ColorRGBA PlayerCountBoxColor;
ColorRGBA PlayerCountTextColor;
ColorRGBA ListHeaderBoxColor;
ColorRGBA ListHeaderTextColor;
ColorRGBA LeftHPBoxColorNone;
ColorRGBA LeftHPBoxColorDead;
ColorRGBA LeftHPBoxColorLow;
ColorRGBA LeftHPBoxColorMid;
ColorRGBA LeftHPBoxColorHigh;
ColorRGBA PlayerOwnerBoxColor;
ColorRGBA PlayerBoxColor;
ColorRGBA StatsBoxColor;
ColorRGBA RankTextColor;
ColorRGBA ZedTextColor;
ColorRGBA PerkTextColor;
ColorRGBA LevelTextColor;
ColorRGBA AvatarBorderColor;
ColorRGBA PlayerNameTextColor;
ColorRGBA KillsTextColor;
ColorRGBA AssistsTextColor;
ColorRGBA DoshTextColor;
ColorRGBA StateTextColorLobby;
ColorRGBA StateTextColorReady;
ColorRGBA StateTextColorNotReady;
ColorRGBA StateTextColorNone;
ColorRGBA StateTextColorSpectator;
ColorRGBA StateTextColorDead;
ColorRGBA StateTextColorLowHP;
ColorRGBA StateTextColorMidHP;
ColorRGBA StateTextColorHighHP;
ColorRGBA PingTextColorNone;
ColorRGBA PingTextColorLow;
ColorRGBA PingTextColorMid
ColorRGBA PingTextColorHigh;
StructDefaultProperties
{
ServerNameBoxColor=(R=75,G=0,B=0,A=200)
ServerNameTextColor=(R=250,G=250,B=250,A=255)
GameInfoBoxColor=(R=30,G=30,B=30,A=200)
GameInfoTextColor=(R=250,G=250,B=250,A=255)
WaveBoxColor=(R=10,G=10,B=10,A=200)
WaveTextColor=(R=250,G=250,B=250,A=255)
PlayerCountBoxColor=(R=75,G=0,B=0,A=200)
PlayerCountTextColor=(R=250,G=250,B=250,A=255)
ListHeaderBoxColor=(R=10,G=10,B=10,A=200)
ListHeaderTextColor=(R=250,G=250,B=250,A=255)
LeftHPBoxColorNone=(R=150,G=150,B=150,A=150)
LeftHPBoxColorDead=(R=200,G=0,B=0,A=150)
LeftHPBoxColorLow=(R=200,G=50,B=50,A=150)
LeftHPBoxColorMid=(R=200,G=200,B=0,A=150)
LeftHPBoxColorHigh=(R=0,G=200,B=0,A=150)
PlayerOwnerBoxColor=(R=100,G=10,B=10,A=150)
PlayerBoxColor=(R=30,G=30,B=30,A=150)
StatsBoxColor=(R=10,G=10,B=10,A=150)
RankTextColor=(R=250,G=250,B=250,A=255)
ZedTextColor=(R=255,G=0,B=0,A=255)
PerkTextColor=(R=250,G=250,B=250,A=255)
LevelTextColor=(R=250,G=250,B=250,A=255)
AvatarBorderColor=(R=255,G=255,B=255,A=255)
PlayerNameColor=(R=250,G=250,B=250,A=255)
KillsTextColor=(R=250,G=250,B=250,A=255)
AssistsTextColor=(R=250,G=250,B=250,A=255)
DoshTextColor=(R=250,G=250,B=100,A=255)
StateTextColorLobby=(R=150,G=150,B=150,A=150)
StateTextColorReady=(R=150,G=150,B=150,A=150)
StateTextColorNotReady=(R=150,G=150,B=150,A=150)
StateTextColorNone=(R=150,G=150,B=150,A=150)
StateTextColorSpectator=(R=150,G=150,B=150,A=150)
StateTextColorDead=(R=250,G=0,B=0,A=255)
StateTextColorLowHP=(R=250,G=100,B=100,A=255)
StateTextColorMidHP=(R=250,G=250,B=0,A=255)
StateTextColorHighHP=(R=0,G=250,B=0,A=255)
PingTextColorNone=(R=250,G=250,B=250,A=255)
PingTextColorLow=(R=0,G=250,B=0,A=255)
PingTextColorMid=(R=250,G=250,B=0,A=255)
PingTextColorHigh=(R=250,G=0,B=0,A=255)
}
}
struct ColorRGBA struct ColorRGBA
{ {
var byte R, G, B, A; var byte R, G, B, A;