From 32e7198360897cfba4f66d03242d77f6d26ac027 Mon Sep 17 00:00:00 2001 From: GenZmeY Date: Sun, 13 Jun 2021 08:38:44 +0300 Subject: [PATCH] dynamic column width --- ScoreboardExt/Classes/KFScoreBoard.uc | 31 +++++++++++++++++++++------ 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/ScoreboardExt/Classes/KFScoreBoard.uc b/ScoreboardExt/Classes/KFScoreBoard.uc index 50ba5cf..e3cb472 100644 --- a/ScoreboardExt/Classes/KFScoreBoard.uc +++ b/ScoreboardExt/Classes/KFScoreBoard.uc @@ -109,7 +109,7 @@ function DrawMenu() local PlayerController PC; local KFPlayerReplicationInfo KFPRI; local PlayerReplicationInfo PRI; - local float XPos, YPos, YL, XL, FontScalar, XPosCenter, BoxW, BoxX, BoxH; + local float XPos, YPos, YL, XL, FontScalar, XPosCenter, BoxW, BoxX, BoxH, MinBoxW; local int i, j, NumSpec, NumPlayer, NumAlivePlayer, Width, Edge; local float BorderSize; @@ -260,15 +260,32 @@ function DrawMenu() 2); // Calc X offsets + MinBoxW = Width * 0.07; // minimum width for column + RankXPos = Owner.HUDOwner.ScaledBorderSize * 8 + Edge; 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; - + + Canvas.TextSize(class'KFGFxHUD_ScoreboardWidget'.default.PingString$" ", XL, YL, FontScalar, FontScalar); + XL = XL < MinBoxW ? MinBoxW : XL; + PingXPos = Width - XL; + + Canvas.TextSize(State$" ", XL, YL, FontScalar, FontScalar); + XL = XL < MinBoxW ? MinBoxW : XL; + HealthXPos = PingXPos - XL; + + Canvas.TextSize(class'KFGFxHUD_ScoreboardWidget'.default.AssistsString$" ", XL, YL, FontScalar, FontScalar); + XL = XL < MinBoxW ? MinBoxW : XL; + AssistXPos = HealthXPos - XL; + + Canvas.TextSize(class'KFGFxHUD_ScoreboardWidget'.default.KillsString$" ", XL, YL, FontScalar, FontScalar); + XL = XL < MinBoxW ? MinBoxW : XL; + KillsXPos = AssistXPos - XL; + + Canvas.TextSize(class'KFGFxHUD_ScoreboardWidget'.default.DoshString$" ", XL, YL, FontScalar, FontScalar); + XL = XL < MinBoxW ? MinBoxW : XL; + CashXPos = KillsXPos - XL; + StatusWBox = PlayerXPos - RankXPos; PlayerWBox = PerkXPos - PlayerXPos; PerkWBox = CashXPos - PerkXPos;