2017-10-25 22:21:13 +00:00
|
|
|
class UI_Scoreboard_CD extends UI_Scoreboard;
|
|
|
|
|
|
|
|
var transient float AdminXPos, PerkXPos, PlayerXPos, StateXPos, TimeXPos;
|
|
|
|
var int MaxPlayerCount;
|
|
|
|
|
2020-09-01 07:19:52 +00:00
|
|
|
var localized string HeaderPerkText;
|
|
|
|
var localized string HeaderStateText;
|
|
|
|
var localized string HeaderRankText;
|
|
|
|
var localized string DeveloperText;
|
|
|
|
var localized string VoteKickText;
|
|
|
|
|
|
|
|
function FRowItem NewFRowItem(string Text, bool isSplitter)
|
|
|
|
{
|
|
|
|
local FRowItem newItem;
|
|
|
|
newItem.Text=Text;
|
|
|
|
newItem.bSplitter=isSplitter;
|
|
|
|
return newItem;
|
|
|
|
}
|
|
|
|
|
|
|
|
function InitMenu()
|
|
|
|
{
|
|
|
|
Super.InitMenu();
|
|
|
|
|
|
|
|
SpecButton.ButtonText=SpecButtonText;
|
|
|
|
SpecButton.Tooltip=SpecButtonTooltip;
|
|
|
|
|
|
|
|
PlayerContext.ItemRows.AddItem(NewFRowItem(SpectateThisPlayerText, false));
|
|
|
|
PlayerContext.ItemRows.AddItem(NewFRowItem(ViewPlayerProfileText, false));
|
|
|
|
PlayerContext.ItemRows.AddItem(NewFRowItem(MuteText, false));
|
|
|
|
PlayerContext.ItemRows.AddItem(NewFRowItem(VoteKickText, false));
|
|
|
|
PlayerContext.ItemRows.AddItem(NewFRowItem("", true));
|
|
|
|
}
|
|
|
|
|
2017-10-25 22:21:13 +00:00
|
|
|
static final function string FormatTimeSMH (float Sec)
|
|
|
|
{
|
2020-11-28 19:53:57 +00:00
|
|
|
local int Hours, Seconds, Minutes;
|
2017-10-25 22:21:13 +00:00
|
|
|
|
2020-11-28 19:53:57 +00:00
|
|
|
Sec = Abs (Sec);
|
|
|
|
Seconds = int (Sec);
|
|
|
|
Minutes = Seconds / 60;
|
|
|
|
Seconds -= Minutes * 60;
|
|
|
|
Hours = Minutes / 60;
|
2017-10-25 22:21:13 +00:00
|
|
|
|
2020-11-28 19:53:57 +00:00
|
|
|
return ((Hours < 1) ? "0" $Hours : string (Hours)) @":" @((Minutes < 10) ? "0" $Minutes : string (Minutes)) @":" @((Seconds < 10) ? "0" $Seconds : string (Seconds));
|
2017-10-25 22:21:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function DrawMenu()
|
|
|
|
{
|
2020-11-28 19:53:57 +00:00
|
|
|
local string S;
|
|
|
|
local PlayerController PC;
|
|
|
|
local PlayerReplicationInfo PRI;
|
|
|
|
local ExtPlayerReplicationInfo KFPRI;
|
|
|
|
local float XPos, YPos, XL, YL, FontScalar, XPosCenter, CurrentBoxY;
|
|
|
|
local int i, j, NumSpec, NumPlayer, NumAlivePlayer, Width, NotShownCount;
|
2017-10-25 22:21:13 +00:00
|
|
|
local byte DefFont;
|
|
|
|
|
2020-11-28 19:53:57 +00:00
|
|
|
PC = GetPlayer ();
|
|
|
|
if (KFGRI == None) {
|
|
|
|
KFGRI = KFGameReplicationInfo (PC.WorldInfo.GRI);
|
|
|
|
if (KFGRI == None)
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Sort player list.
|
|
|
|
for (i = (KFGRI.PRIArray.Length - 1); i > 0; --i) {
|
|
|
|
for (j = i - 1; j >= 0; --j) {
|
|
|
|
if (!InOrder (KFGRI.PRIArray [i], KFGRI.PRIArray [j])) {
|
|
|
|
PRI = KFGRI.PRIArray [i];
|
|
|
|
KFGRI.PRIArray [i] = KFGRI.PRIArray [j];
|
|
|
|
KFGRI.PRIArray [j] = PRI;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Check players.
|
|
|
|
NumPlayer = 0;
|
|
|
|
for (i = (KFGRI.PRIArray.Length - 1); i >= 0; --i) {
|
|
|
|
KFPRI = ExtPlayerReplicationInfo (KFGRI.PRIArray [i]);
|
|
|
|
if (KFPRI == None)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
if (KFPRI.bOnlySpectator) {
|
|
|
|
++NumSpec;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (KFPRI.PlayerHealth > 0 && KFPRI.PlayerHealthPercent > 0 && KFPRI.GetTeamNum () == 0)
|
|
|
|
++NumAlivePlayer;
|
|
|
|
++NumPlayer;
|
|
|
|
}
|
|
|
|
|
|
|
|
//`Log ("DrawMenu (): PlayList.Length = " @PRIList.Length);
|
|
|
|
|
|
|
|
// Header font info.
|
2017-10-25 22:21:13 +00:00
|
|
|
DefFont = Owner.CurrentStyle.DefaultFontSize;
|
2020-11-28 19:53:57 +00:00
|
|
|
Canvas.Font = Owner.CurrentStyle.PickFont(DefFont, FontScalar);
|
2017-10-25 22:21:13 +00:00
|
|
|
|
2020-11-28 19:53:57 +00:00
|
|
|
YL = Owner.CurrentStyle.DefaultHeight;
|
|
|
|
XPosCenter = (Canvas.ClipX * 0.5);
|
2017-10-25 22:21:13 +00:00
|
|
|
|
|
|
|
// ServerName
|
|
|
|
|
|
|
|
XPos = XPosCenter;
|
|
|
|
YPos = Canvas.ClipY * 0.05;
|
|
|
|
|
|
|
|
S = " " $KFGRI.ServerName $" ";
|
|
|
|
Canvas.TextSize (S, XL, YL, FontScalar, FontScalar);
|
|
|
|
|
|
|
|
XPos -= (XL * 0.5);
|
|
|
|
|
|
|
|
Canvas.SetDrawColor (10, 10, 10, 200);
|
|
|
|
Owner.CurrentStyle.DrawRectBox (XPos, YPos, XL, YL, 4);
|
|
|
|
|
|
|
|
Canvas.DrawColor = MakeColor (250, 0, 0, 255);
|
|
|
|
XPos += 5;
|
|
|
|
|
|
|
|
S = KFGRI.ServerName;
|
|
|
|
Canvas.SetPos (XPos, YPos);
|
|
|
|
Canvas.DrawText (S, , FontScalar, FontScalar);
|
|
|
|
|
|
|
|
// Deficulty | Wave | MapName | ElapsedTime
|
|
|
|
|
|
|
|
XPos = XPosCenter;
|
|
|
|
YPos += YL;
|
|
|
|
|
|
|
|
S = " " $Class'KFCommon_LocalizedStrings'.Static.GetDifficultyString (KFGRI.GameDifficulty) $" | WAVE " $KFGRI.WaveNum $" | " $PC.WorldInfo.Title $" | 00 : 00 : 00 ";
|
|
|
|
Canvas.TextSize (S, XL, YL, FontScalar, FontScalar);
|
|
|
|
|
|
|
|
XPos -= (XL * 0.5);
|
|
|
|
|
|
|
|
Canvas.SetDrawColor (10, 10, 10, 200);
|
|
|
|
Owner.CurrentStyle.DrawRectBox (XPos, YPos, XL, YL, 4);
|
|
|
|
|
|
|
|
Canvas.DrawColor = MakeColor (0, 250, 0, 255);
|
|
|
|
XPos += 5;
|
|
|
|
|
|
|
|
S = Class'KFCommon_LocalizedStrings'.Static.GetDifficultyString (KFGRI.GameDifficulty);
|
|
|
|
Canvas.SetPos (XPos, YPos);
|
|
|
|
Canvas.DrawText (S, , FontScalar, FontScalar);
|
|
|
|
Canvas.TextSize (S, XL, YL, FontScalar, FontScalar);
|
|
|
|
|
|
|
|
XPos += XL;
|
2020-09-01 07:19:52 +00:00
|
|
|
S = " | "$HeaderWaveText$" " $KFGRI.WaveNum;
|
2017-10-25 22:21:13 +00:00
|
|
|
Canvas.SetPos (XPos, YPos);
|
|
|
|
Canvas.DrawText (S, , FontScalar, FontScalar);
|
|
|
|
Canvas.TextSize (S, XL, YL, FontScalar, FontScalar);
|
|
|
|
|
|
|
|
XPos += XL;
|
|
|
|
S = " | " $class'KFCommon_LocalizedStrings'.static.GetFriendlyMapName(PC.WorldInfo.GetMapName(true));
|
|
|
|
Canvas.SetPos (XPos, YPos);
|
|
|
|
Canvas.DrawText (S, , FontScalar, FontScalar);
|
|
|
|
Canvas.TextSize (S, XL, YL, FontScalar, FontScalar);
|
|
|
|
|
|
|
|
XPos += XL;
|
|
|
|
S = " | " $FormatTimeSMH (KFGRI.ElapsedTime);
|
|
|
|
Canvas.SetPos (XPos, YPos);
|
|
|
|
Canvas.DrawText (S, , FontScalar, FontScalar);
|
|
|
|
|
|
|
|
// Players | Alive | Spectators
|
|
|
|
|
|
|
|
XPos = XPosCenter;
|
|
|
|
YPos += YL;
|
|
|
|
|
2020-09-01 07:19:52 +00:00
|
|
|
S = " "$PlayersText$" : " $NumPlayer $" | "$AliveText$" : " $NumAlivePlayer $" | "$SpectatorsText$" : " $NumSpec $" ";
|
2017-10-25 22:21:13 +00:00
|
|
|
Canvas.TextSize (S, XL, YL, FontScalar, FontScalar);
|
|
|
|
|
|
|
|
XPos -= (XL * 0.5);
|
|
|
|
|
|
|
|
Canvas.SetDrawColor (10, 10, 10, 200);
|
|
|
|
Owner.CurrentStyle.DrawRectBox (XPos, YPos, XL, YL, 4);
|
|
|
|
|
|
|
|
Canvas.DrawColor = MakeColor (250, 250, 0, 255);
|
|
|
|
XPos += 5;
|
|
|
|
|
2020-09-01 07:19:52 +00:00
|
|
|
S = PlayersText$" : " $NumPlayer;
|
2017-10-25 22:21:13 +00:00
|
|
|
Canvas.SetPos (XPos, YPos);
|
|
|
|
Canvas.DrawText (S, , FontScalar, FontScalar);
|
|
|
|
Canvas.TextSize (S, XL, YL, FontScalar, FontScalar);
|
|
|
|
|
|
|
|
XPos += XL;
|
2020-09-01 07:19:52 +00:00
|
|
|
S = " | "$AliveText$" : " $NumAlivePlayer;
|
2017-10-25 22:21:13 +00:00
|
|
|
Canvas.SetPos (XPos, YPos);
|
|
|
|
Canvas.DrawText (S, , FontScalar, FontScalar);
|
|
|
|
Canvas.TextSize (S, XL, YL, FontScalar, FontScalar);
|
|
|
|
|
|
|
|
XPos += XL;
|
2020-09-01 07:19:52 +00:00
|
|
|
S = " | "$SpectatorsText$" : " $NumSpec;
|
2017-10-25 22:21:13 +00:00
|
|
|
Canvas.SetPos (XPos, YPos);
|
|
|
|
Canvas.DrawText (S, , FontScalar, FontScalar);
|
|
|
|
|
|
|
|
Width = Canvas.ClipX * 0.7;
|
|
|
|
|
|
|
|
XPos = (Canvas.ClipX - Width) * 0.5;
|
|
|
|
YPos += YL * 2.0;
|
|
|
|
|
|
|
|
Canvas.SetDrawColor (10, 10, 10, 200);
|
|
|
|
Owner.CurrentStyle.DrawRectBox (XPos, YPos, Width, YL, 4);
|
|
|
|
|
|
|
|
Canvas.DrawColor = MakeColor (250, 250, 250, 255);
|
|
|
|
|
|
|
|
// Calc X offsets
|
|
|
|
|
|
|
|
AdminXPos = Width * 0.0;
|
|
|
|
PerkXPos = Width * 0.1;
|
|
|
|
PlayerXPos = Width * 0.3;
|
|
|
|
KillsXPos = Width * 0.5;
|
|
|
|
AssistXPos = Width * 0.6;
|
|
|
|
CashXPos = Width * 0.7;
|
|
|
|
StateXPos = Width * 0.8;
|
|
|
|
PingXPos = Width * 0.95;
|
|
|
|
|
|
|
|
// Header texts
|
2020-11-28 20:12:58 +00:00
|
|
|
if (!bShowSpectatorsOnly)
|
2017-10-25 22:21:13 +00:00
|
|
|
{
|
|
|
|
Canvas.SetPos (XPos + PerkXPos, YPos);
|
2020-09-01 07:19:52 +00:00
|
|
|
Canvas.DrawText (HeaderPerkText, , FontScalar, FontScalar);
|
2017-10-25 22:21:13 +00:00
|
|
|
|
|
|
|
Canvas.SetPos (XPos + KillsXPos, YPos);
|
2020-09-01 07:19:52 +00:00
|
|
|
Canvas.DrawText (HeaderKillsText, , FontScalar, FontScalar);
|
2017-10-25 22:21:13 +00:00
|
|
|
|
|
|
|
Canvas.SetPos (XPos + AssistXPos, YPos);
|
2020-09-01 07:19:52 +00:00
|
|
|
Canvas.DrawText (HeaderAssistText, , FontScalar, FontScalar);
|
2017-10-25 22:21:13 +00:00
|
|
|
|
|
|
|
Canvas.SetPos (XPos + CashXPos, YPos);
|
2020-09-01 07:19:52 +00:00
|
|
|
Canvas.DrawText (HeaderDoshText, , FontScalar, FontScalar);
|
2017-10-25 22:21:13 +00:00
|
|
|
|
|
|
|
Canvas.SetPos (XPos + StateXPos, YPos);
|
2020-09-01 07:19:52 +00:00
|
|
|
Canvas.DrawText (HeaderStateText, , FontScalar, FontScalar);
|
2017-10-25 22:21:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Canvas.SetPos (XPos, YPos);
|
2020-09-01 07:19:52 +00:00
|
|
|
Canvas.DrawText (HeaderRankText, , FontScalar, FontScalar);
|
2017-10-25 22:21:13 +00:00
|
|
|
|
|
|
|
Canvas.SetPos (XPos + PlayerXPos, YPos);
|
2020-09-01 07:19:52 +00:00
|
|
|
Canvas.DrawText (HeaderPlayerText, , FontScalar, FontScalar);
|
2017-10-25 22:21:13 +00:00
|
|
|
|
|
|
|
Canvas.SetPos (XPos + PingXPos, YPos);
|
2020-09-01 07:19:52 +00:00
|
|
|
Canvas.DrawText (HeaderPingText, , FontScalar, FontScalar);
|
2017-10-25 22:21:13 +00:00
|
|
|
|
|
|
|
PRIList.Length = (bShowSpectatorsOnly ? NumSpec : NumPlayer);
|
|
|
|
j = PRIList.Length;
|
2020-11-28 20:12:58 +00:00
|
|
|
for (i=(KFGRI.PRIArray.Length-1); i>=0; --i)
|
2017-10-25 22:21:13 +00:00
|
|
|
{
|
|
|
|
KFPRI = ExtPlayerReplicationInfo(KFGRI.PRIArray[i]);
|
2020-11-28 20:12:58 +00:00
|
|
|
if (KFPRI!=None && bShowSpectatorsOnly==KFPRI.bOnlySpectator)
|
2017-10-25 22:21:13 +00:00
|
|
|
{
|
|
|
|
PRIList[--j] = KFPRI;
|
2020-11-28 20:12:58 +00:00
|
|
|
if (KFPRI==PC.PlayerReplicationInfo)
|
2017-10-25 22:21:13 +00:00
|
|
|
PlayerIndex = j;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
CurrentBoxY = (YL + 4) * MaxPlayerCount;
|
2020-11-28 20:12:58 +00:00
|
|
|
while (CurrentBoxY > (Canvas.ClipY-YPos))
|
2017-10-25 22:21:13 +00:00
|
|
|
{
|
2020-11-28 20:12:58 +00:00
|
|
|
if (++i>=5)
|
2017-10-25 22:21:13 +00:00
|
|
|
{
|
|
|
|
NotShownCount = MaxPlayerCount-int((Canvas.ClipY-YPos)/CurrentBoxY)+1;
|
|
|
|
MaxPlayerCount-=NotShownCount;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
PlayersList.XPosition = ((Canvas.ClipX - Width) * 0.5) / InputPos[2];
|
|
|
|
PlayersList.YPosition = (YPos + (YL + 4)) / InputPos[3];
|
|
|
|
PlayersList.XSize = (Width * 1.022) / InputPos[2];
|
|
|
|
PlayersList.YSize = CurrentBoxY / InputPos[3];
|
|
|
|
PlayersList.ListItemsPerPage = MaxPlayerCount;
|
|
|
|
PlayersList.ChangeListSize(PRIList.Length);
|
|
|
|
}
|
|
|
|
|
2020-11-28 20:04:55 +00:00
|
|
|
function DrawPlayerEntry(Canvas C, int Index, float YOffset, float Height, float Width, bool bFocus)
|
2017-10-25 22:21:13 +00:00
|
|
|
{
|
|
|
|
local float FontScalar;
|
|
|
|
local ExtPlayerReplicationInfo KFPRI;
|
|
|
|
local string S, StrValue;
|
|
|
|
local byte DefFont;
|
|
|
|
local int Ping;
|
|
|
|
|
|
|
|
KFPRI = PRIList[Index];
|
|
|
|
|
|
|
|
bFocus = bFocus || (bHasSelectedPlayer && RightClickPlayer==KFPRI);
|
|
|
|
|
|
|
|
DefFont = Owner.CurrentStyle.DefaultFontSize;
|
2020-11-28 19:53:57 +00:00
|
|
|
C.Font = Owner.CurrentStyle.PickFont(DefFont, FontScalar);
|
2017-10-25 22:21:13 +00:00
|
|
|
|
|
|
|
if (KFPRI == GetPlayer().PlayerReplicationInfo)
|
|
|
|
{
|
2020-11-28 20:12:58 +00:00
|
|
|
if (bFocus)
|
2017-10-25 22:21:13 +00:00
|
|
|
C.SetDrawColor(0, 83, 255, 150);
|
|
|
|
else C.SetDrawColor (51, 30, 101, 150);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2020-11-28 20:12:58 +00:00
|
|
|
if (bFocus)
|
2017-10-25 22:21:13 +00:00
|
|
|
C.SetDrawColor(0, 83, 255, 150);
|
|
|
|
else C.SetDrawColor (30, 30, 30, 150);
|
|
|
|
}
|
|
|
|
|
|
|
|
Owner.CurrentStyle.DrawRectBox (0.f, YOffset, Width, Height, 4);
|
|
|
|
|
|
|
|
C.DrawColor = MakeColor (250, 250, 250, 255);
|
|
|
|
|
|
|
|
// Perk
|
2020-11-28 20:12:58 +00:00
|
|
|
if (!bShowSpectatorsOnly)
|
2017-10-25 22:21:13 +00:00
|
|
|
{
|
|
|
|
C.DrawColor = KFPRI.HUDPerkColor;
|
2020-11-28 20:12:58 +00:00
|
|
|
if (KFPRI.ECurrentPerk!=None)
|
2017-10-25 22:21:13 +00:00
|
|
|
{
|
|
|
|
C.SetPos (0.f + PerkXPos, YOffset + 2.5);
|
|
|
|
C.DrawRect (Height-5, Height-5, KFPRI.ECurrentPerk.Default.PerkIcon);
|
|
|
|
|
|
|
|
S = KFPRI.GetPerkLevelStr()@KFPRI.ECurrentPerk.Default.PerkName;
|
|
|
|
C.SetPos (0.f + PerkXPos + Height, YOffset);
|
|
|
|
C.DrawText (S, , FontScalar, FontScalar);
|
|
|
|
}
|
2020-11-28 20:12:58 +00:00
|
|
|
else if (KFPRI.bBot && KFPRI.CurrentPerkClass!=None)
|
2017-10-25 22:21:13 +00:00
|
|
|
{
|
|
|
|
C.SetPos (0.f + PerkXPos, YOffset + 2.5);
|
|
|
|
C.DrawRect (Height-5, Height-5, KFPRI.CurrentPerkClass.Default.PerkIcon);
|
|
|
|
|
|
|
|
S = KFPRI.CurrentPerkClass.Default.PerkName;
|
|
|
|
C.SetPos (0.f + PerkXPos + Height, YOffset);
|
|
|
|
C.DrawText (S, , FontScalar, FontScalar);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
C.DrawColor = MakeColor (250, 250, 250, 255);
|
2020-09-01 07:19:52 +00:00
|
|
|
S = NoPerkText;
|
2017-10-25 22:21:13 +00:00
|
|
|
C.SetPos (0.f + PerkXPos + Height, YOffset);
|
|
|
|
C.DrawText (S, , FontScalar, FontScalar);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Avatar
|
2020-11-28 20:12:58 +00:00
|
|
|
if (KFPRI.Avatar!=None)
|
2017-10-25 22:21:13 +00:00
|
|
|
{
|
|
|
|
C.SetDrawColor(255,255,255,255);
|
|
|
|
C.SetPos(0.f + PlayerXPos - (Height * 1.2), YOffset);
|
|
|
|
C.DrawTile(KFPRI.Avatar,Height,Height,0,0,KFPRI.Avatar.SizeX,KFPRI.Avatar.SizeY);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// Try to obtain avatar.
|
2020-11-28 20:12:58 +00:00
|
|
|
if (!KFPRI.bBot)
|
2017-10-25 22:21:13 +00:00
|
|
|
KFPRI.Avatar = FindAvatar(KFPRI.UniqueId);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Rank
|
2020-11-28 20:12:58 +00:00
|
|
|
if (KFPRI.ShowAdminName())
|
2017-10-25 22:21:13 +00:00
|
|
|
{
|
|
|
|
S = KFPRI.GetAdminName();
|
|
|
|
C.DrawColor = KFPRI.GetAdminColorC();
|
|
|
|
}
|
2020-11-28 20:12:58 +00:00
|
|
|
else if (KFPRI.bIsDev)
|
2017-10-25 22:21:13 +00:00
|
|
|
{
|
2020-09-01 07:19:52 +00:00
|
|
|
S = DeveloperText;
|
2017-10-25 22:21:13 +00:00
|
|
|
C.DrawColor = MakeColor(130,255,235,255);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2020-09-01 07:19:52 +00:00
|
|
|
S = PlayerText;
|
2017-10-25 22:21:13 +00:00
|
|
|
C.DrawColor = MakeColor(255,255,255,255);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Rank
|
|
|
|
C.SetPos (0.f + AdminXPos, YOffset);
|
|
|
|
C.DrawText (S, , FontScalar, FontScalar);
|
|
|
|
|
|
|
|
// Player
|
|
|
|
C.SetPos (0.f + PlayerXPos, YOffset);
|
|
|
|
C.DrawText (KFPRI.PlayerName, , FontScalar, FontScalar);
|
|
|
|
|
|
|
|
C.DrawColor = MakeColor(255,255,255,255);
|
|
|
|
|
2020-11-28 20:12:58 +00:00
|
|
|
if (!bShowSpectatorsOnly)
|
2017-10-25 22:21:13 +00:00
|
|
|
{
|
|
|
|
// Kill
|
|
|
|
C.SetDrawColor(255,51,51,255);
|
|
|
|
C.SetPos (0.f + KillsXPos, YOffset);
|
|
|
|
C.DrawText (string (KFPRI.Kills), , FontScalar, FontScalar);
|
|
|
|
|
|
|
|
// Assist
|
|
|
|
C.SetDrawColor(255,255,51,255);
|
|
|
|
C.SetPos (0.f + AssistXPos, YOffset);
|
|
|
|
C.DrawText (string (KFPRI.Assists), , FontScalar, FontScalar);
|
|
|
|
|
|
|
|
// Dosh
|
|
|
|
C.SetDrawColor(51,255,51,255);
|
|
|
|
C.SetPos (0.f + CashXPos, YOffset);
|
|
|
|
StrValue = ConvertValueLarge(KFPRI.Score);
|
|
|
|
C.DrawText (StrValue, , FontScalar, FontScalar);
|
|
|
|
|
|
|
|
// State
|
|
|
|
if (KFPRI.PlayerHealth <= 0 || KFPRI.PlayerHealthPercent <= 0)
|
|
|
|
{
|
|
|
|
C.DrawColor = MakeColor (250, 0, 0, 255);
|
2020-09-01 07:19:52 +00:00
|
|
|
S = DeadText;
|
2017-10-25 22:21:13 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (KFPRI.PlayerHealth >= 80)
|
|
|
|
C.DrawColor = MakeColor (0, 250, 0, 255);
|
|
|
|
else if (KFPRI.PlayerHealth >= 30)
|
|
|
|
C.DrawColor = MakeColor (250, 250, 0, 255);
|
|
|
|
else C.DrawColor = MakeColor (250, 100, 100, 255);
|
|
|
|
|
|
|
|
S = string (KFPRI.PlayerHealth) @"HP";
|
|
|
|
}
|
|
|
|
|
|
|
|
C.SetPos (0.f + StateXPos, YOffset);
|
|
|
|
C.DrawText (S, , FontScalar, FontScalar);
|
|
|
|
|
|
|
|
C.DrawColor = MakeColor (250, 250, 250, 255);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Ping
|
|
|
|
if (KFPRI.bBot)
|
|
|
|
S = "-";
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Ping = int(KFPRI.Ping * `PING_SCALE);
|
|
|
|
|
|
|
|
if (Ping <= 100)
|
|
|
|
C.DrawColor = MakeColor (0, 250, 0, 255);
|
|
|
|
else if (Ping <= 200)
|
|
|
|
C.DrawColor = MakeColor (250, 250, 0, 255);
|
|
|
|
else C.DrawColor = MakeColor (250, 100, 100, 255);
|
|
|
|
|
|
|
|
S = string(Ping);
|
|
|
|
}
|
|
|
|
|
|
|
|
C.SetPos (0.f + PingXPos, YOffset);
|
|
|
|
C.DrawText (S, , FontScalar, FontScalar);
|
|
|
|
}
|
|
|
|
|
2020-11-28 20:04:55 +00:00
|
|
|
function ShowPlayerTooltip(int Index)
|
2017-10-25 22:21:13 +00:00
|
|
|
{
|
|
|
|
local ExtPlayerReplicationInfo PRI;
|
|
|
|
local string S;
|
|
|
|
|
|
|
|
PRI = PRIList[Index];
|
2020-11-28 20:12:58 +00:00
|
|
|
if (PRI!=None)
|
2017-10-25 22:21:13 +00:00
|
|
|
{
|
2020-11-28 20:12:58 +00:00
|
|
|
if (ToolTipItem==None)
|
2017-10-25 22:21:13 +00:00
|
|
|
{
|
|
|
|
ToolTipItem = New(None)Class'KFGUI_Tooltip_CD';
|
|
|
|
ToolTipItem.Owner = Owner;
|
|
|
|
ToolTipItem.ParentComponent = Self;
|
|
|
|
ToolTipItem.InitMenu();
|
|
|
|
}
|
2020-09-01 07:19:52 +00:00
|
|
|
S = PlayerText$": "$PRI.TaggedPlayerName$"|"$HealthText$": "$(PRI.PlayerHealthPercent<=0 ? "0" : string(PRI.PlayerHealth));
|
2020-11-28 20:12:58 +00:00
|
|
|
if (PRI.ShowAdminName())
|
2017-10-25 22:21:13 +00:00
|
|
|
S = S$"|"$PRI.GetAdminName();
|
2020-09-01 07:19:52 +00:00
|
|
|
S = S$"|"$RClickForOptsText;
|
2017-10-25 22:21:13 +00:00
|
|
|
ToolTipItem.SetText(S);
|
|
|
|
ToolTipItem.ShowMenu();
|
|
|
|
ToolTipItem.CompPos[0] = Owner.MousePosition.X;
|
|
|
|
ToolTipItem.CompPos[1] = Owner.MousePosition.Y;
|
|
|
|
ToolTipItem.GetInputFocus();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function string ConvertValueLarge(int FValue)
|
|
|
|
{
|
|
|
|
local string StrValue, StrType;
|
|
|
|
local float FltValue;
|
|
|
|
local int i;
|
|
|
|
|
|
|
|
FltValue = float(FValue);
|
|
|
|
StrValue = string(FltValue);
|
2020-11-28 20:12:58 +00:00
|
|
|
if (FltValue < 10000.f)
|
2017-10-25 22:21:13 +00:00
|
|
|
{
|
|
|
|
StrValue = string(int(FltValue));
|
|
|
|
StrType = "";
|
|
|
|
}
|
2020-11-28 20:12:58 +00:00
|
|
|
else if (FltValue < 1000000.f)
|
2017-10-25 22:21:13 +00:00
|
|
|
{
|
|
|
|
StrValue = string(FltValue / 1000);//.0
|
|
|
|
StrType = "k";
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
StrValue = string(FltValue / 1000000);//.0
|
|
|
|
StrType = "m";
|
|
|
|
}
|
|
|
|
i = InStr(StrValue,".");
|
2020-11-28 20:12:58 +00:00
|
|
|
if (i != -1 && StrType != "")
|
2017-10-25 22:21:13 +00:00
|
|
|
return Left(StrValue,i+2) $ StrType;
|
|
|
|
return StrValue;
|
|
|
|
}
|
|
|
|
|
2020-11-28 20:04:55 +00:00
|
|
|
function SelectedRCItem(int Index)
|
2017-10-25 22:21:13 +00:00
|
|
|
{
|
|
|
|
local PlayerController PC;
|
|
|
|
local KFPlayerReplicationInfo KFPRI;
|
|
|
|
|
|
|
|
PC = GetPlayer();
|
|
|
|
KFPRI = KFPlayerReplicationInfo(PC.PlayerReplicationInfo);
|
|
|
|
|
2020-11-28 20:12:58 +00:00
|
|
|
switch (Index)
|
2017-10-25 22:21:13 +00:00
|
|
|
{
|
|
|
|
case 3: // Vote kick.
|
|
|
|
KFPRI.ServerStartKickVote(RightClickPlayer, KFPRI);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
Super.SelectedRCItem(Index);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
defaultproperties
|
|
|
|
{
|
|
|
|
MaxPlayerCount=25
|
|
|
|
|
|
|
|
Components.Empty
|
|
|
|
|
|
|
|
Begin Object Class=KFGUI_List_CD Name=PlayerList
|
|
|
|
bDrawBackground=false
|
|
|
|
OnDrawItem=DrawPlayerEntry
|
|
|
|
OnClickedItem=ClickedPlayer
|
|
|
|
ID="PlayerList"
|
|
|
|
bClickable=true
|
|
|
|
OnMouseRest=ShowPlayerTooltip
|
|
|
|
End Object
|
|
|
|
Begin Object Class=KFGUI_Button_CD Name=B_ShowSpecs
|
|
|
|
ID="Spec"
|
|
|
|
XPosition=0.67
|
|
|
|
YPosition=0.965
|
|
|
|
XSize=0.09
|
|
|
|
YSize=0.03
|
|
|
|
OnClickLeft=ButtonClicked
|
|
|
|
OnClickRight=ButtonClicked
|
|
|
|
End Object
|
|
|
|
Components.Add(PlayerList)
|
|
|
|
Components.Add(B_ShowSpecs)
|
|
|
|
|
|
|
|
Begin Object Class=KFGUI_RightClickMenu_CD Name=PlayerContextMenu
|
|
|
|
OnSelectedItem=SelectedRCItem
|
|
|
|
OnBecameHidden=HidRightClickMenu
|
|
|
|
End Object
|
|
|
|
PlayerContext=PlayerContextMenu
|
|
|
|
}
|