dynamic column width

This commit is contained in:
GenZmeY 2021-06-13 08:38:44 +03:00
parent ee661af052
commit 32e7198360

View File

@ -109,7 +109,7 @@ function DrawMenu()
local PlayerController PC; local PlayerController PC;
local KFPlayerReplicationInfo KFPRI; local KFPlayerReplicationInfo KFPRI;
local PlayerReplicationInfo PRI; 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 int i, j, NumSpec, NumPlayer, NumAlivePlayer, Width, Edge;
local float BorderSize; local float BorderSize;
@ -260,14 +260,31 @@ function DrawMenu()
2); 2);
// Calc X offsets // Calc X offsets
MinBoxW = Width * 0.07; // minimum width for column
RankXPos = Owner.HUDOwner.ScaledBorderSize * 8 + Edge; RankXPos = Owner.HUDOwner.ScaledBorderSize * 8 + Edge;
PlayerXPos = Width * 0.20; PlayerXPos = Width * 0.20;
PerkXPos = Width * 0.40; PerkXPos = Width * 0.40;
CashXPos = Width * 0.57;
KillsXPos = Width * 0.66; Canvas.TextSize(class'KFGFxHUD_ScoreboardWidget'.default.PingString$" ", XL, YL, FontScalar, FontScalar);
AssistXPos = Width * 0.75; XL = XL < MinBoxW ? MinBoxW : XL;
HealthXPos = Width * 0.84; PingXPos = Width - XL;
PingXPos = Width * 0.93;
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; StatusWBox = PlayerXPos - RankXPos;
PlayerWBox = PerkXPos - PlayerXPos; PlayerWBox = PerkXPos - PlayerXPos;