From 50ad0d6a97c25cc4020544bf4fbb9749cbdec6d9 Mon Sep 17 00:00:00 2001 From: GenZmeY Date: Sun, 13 Jun 2021 11:36:10 +0300 Subject: [PATCH] add EdgeSize setting --- ScoreboardExt/Classes/GUIStyleBase.uc | 2 +- ScoreboardExt/Classes/KFScoreBoard.uc | 29 ++++++++++++------------ ScoreboardExt/Classes/ScoreboardStyle.uc | 3 +++ ScoreboardExt/Classes/Types.uc | 3 +++ 4 files changed, 22 insertions(+), 15 deletions(-) diff --git a/ScoreboardExt/Classes/GUIStyleBase.uc b/ScoreboardExt/Classes/GUIStyleBase.uc index 3c1c1d3..fc6f1fc 100644 --- a/ScoreboardExt/Classes/GUIStyleBase.uc +++ b/ScoreboardExt/Classes/GUIStyleBase.uc @@ -642,7 +642,7 @@ final function DrawRectBox(float X, float Y, float Width, float Height, int Edge Canvas.SetPos(X, Y); DrawWhiteBox(Width, Height); - default: + default: // 0 // ______ // / \ // | | diff --git a/ScoreboardExt/Classes/KFScoreBoard.uc b/ScoreboardExt/Classes/KFScoreBoard.uc index fb6ae1b..0c34e1a 100644 --- a/ScoreboardExt/Classes/KFScoreBoard.uc +++ b/ScoreboardExt/Classes/KFScoreBoard.uc @@ -110,7 +110,7 @@ function DrawMenu() local KFPlayerReplicationInfo KFPRI; local PlayerReplicationInfo PRI; 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; local float BorderSize; PC = GetPlayer(); @@ -174,7 +174,6 @@ function DrawMenu() Canvas.Font = Owner.CurrentStyle.PickFont(FontScalar); Canvas.TextSize("ABC", XL, YL, FontScalar, FontScalar); BorderSize = Owner.HUDOwner.ScaledBorderSize; - Edge = 8; // Server Info XPosCenter = Canvas.ClipX * 0.5; @@ -188,7 +187,7 @@ function DrawMenu() // Top Rect (Server name) SetDrawColor(Canvas, Settings.Style.ServerNameBoxColor); - Owner.CurrentStyle.DrawRectBox(BoxX, YPos, BoxW, BoxH, Edge, Settings.Style.ShapeServerNameBox); + Owner.CurrentStyle.DrawRectBox(BoxX, YPos, BoxW, BoxH, Settings.Style.EdgeSize, Settings.Style.ShapeServerNameBox); SetDrawColor(Canvas, Settings.Style.ServerNameTextColor); S = KFGRI.ServerName; @@ -200,20 +199,20 @@ function DrawMenu() BoxW = Width * 0.7; BoxH = YL * 2 + BorderSize * 2; SetDrawColor(Canvas, Settings.Style.GameInfoBoxColor); - Owner.CurrentStyle.DrawRectBox(BoxX, YPos, BoxW, BoxH, Edge, Settings.Style.ShapeGameInfoBox); + Owner.CurrentStyle.DrawRectBox(BoxX, YPos, BoxW, BoxH, Settings.Style.EdgeSize, Settings.Style.ShapeGameInfoBox); SetDrawColor(Canvas, Settings.Style.GameInfoTextColor); S = class'KFCommon_LocalizedStrings'.static.GetFriendlyMapName(PC.WorldInfo.GetMapName(true)); - DrawTextShadowHLeftVCenter(S, BoxX + Edge, YPos, FontScalar); + DrawTextShadowHLeftVCenter(S, BoxX + Settings.Style.EdgeSize, YPos, FontScalar); S = KFGRI.GameClass.default.GameName $ " - " $ class'KFCommon_LocalizedStrings'.Static.GetDifficultyString(KFGRI.GameDifficulty); - DrawTextShadowHLeftVCenter(S, BoxX + Edge, YPos + YL, FontScalar); + DrawTextShadowHLeftVCenter(S, BoxX + Settings.Style.EdgeSize, YPos + YL, FontScalar); // Mid Right Rect (Wave) BoxX = BoxX + BoxW; BoxW = Width - BoxW; SetDrawColor(Canvas, Settings.Style.WaveBoxColor); - Owner.CurrentStyle.DrawRectBox(BoxX, YPos, BoxW, BoxH, Edge, Settings.Style.ShapeWaveInfoBox); + Owner.CurrentStyle.DrawRectBox(BoxX, YPos, BoxW, BoxH, Settings.Style.EdgeSize, Settings.Style.ShapeWaveInfoBox); SetDrawColor(Canvas, Settings.Style.WaveTextColor); S = class'KFGFxHUD_ScoreboardMapInfoContainer'.default.WaveString; @@ -227,12 +226,12 @@ function DrawMenu() BoxW = Width; BoxH = YL + BorderSize; SetDrawColor(Canvas, Settings.Style.PlayerCountBoxColor); - Owner.CurrentStyle.DrawRectBox(BoxX, YPos, BoxW, BoxH, Edge, Settings.Style.ShapePlayersCountBox); + Owner.CurrentStyle.DrawRectBox(BoxX, YPos, BoxW, BoxH, Settings.Style.EdgeSize, Settings.Style.ShapePlayersCountBox); SetDrawColor(Canvas, Settings.Style.PlayerCountTextColor); S = Players$": " $ NumPlayer $ " / " $ KFGRI.MaxHumanCount $ " " $ Spectators $ ": " $ NumSpec; Canvas.TextSize(S, XL, YL, FontScalar, FontScalar); - DrawTextShadowHLeftVCenter(S, BoxX + Edge, YPos, FontScalar); + DrawTextShadowHLeftVCenter(S, BoxX + Settings.Style.EdgeSize, YPos, FontScalar); S = Owner.CurrentStyle.GetTimeString(KFGRI.ElapsedTime); DrawTextShadowHVCenter(S, XPos + Width * 0.7, YPos, Width * 0.3, FontScalar); @@ -256,13 +255,13 @@ function DrawMenu() YPos, Width + BorderSize * 4, BoxH, - Edge, + Settings.Style.EdgeSize, Settings.Style.ShapeHeaderBox); // Calc X offsets MinBoxW = Width * 0.07; // minimum width for column - RankXPos = Owner.HUDOwner.ScaledBorderSize * 8 + Edge; + RankXPos = Owner.HUDOwner.ScaledBorderSize * 8 + Settings.Style.EdgeSize; PlayerXPos = Width * 0.20; PerkXPos = Width * 0.40; @@ -442,7 +441,8 @@ function DrawPlayerEntry(Canvas C, int Index, float YOffset, float Height, float YOffset, BoxWidth, Height, - 8, Shape); + Settings.Style.EdgeSize, + Shape); XPos += BoxWidth; @@ -460,7 +460,7 @@ function DrawPlayerEntry(Canvas C, int Index, float YOffset, float Height, float Shape = Settings.Style.ShapePlayerBoxMidPlayer; BoxWidth = CashXPos + Owner.HUDOwner.ScaledBorderSize - BoxWidth; - Owner.CurrentStyle.DrawRectBox(XPos, YOffset, BoxWidth, Height, 8, Shape); + Owner.CurrentStyle.DrawRectBox(XPos, YOffset, BoxWidth, Height, Settings.Style.EdgeSize, Shape); XPos += BoxWidth; @@ -478,7 +478,8 @@ function DrawPlayerEntry(Canvas C, int Index, float YOffset, float Height, float YOffset, BoxWidth, Height, - 8, Shape); + Settings.Style.EdgeSize, + Shape); // Rank if (CurrentRank.ApplyColorToFields.Rank) diff --git a/ScoreboardExt/Classes/ScoreboardStyle.uc b/ScoreboardExt/Classes/ScoreboardStyle.uc index fee9f3a..654b8c6 100644 --- a/ScoreboardExt/Classes/ScoreboardStyle.uc +++ b/ScoreboardExt/Classes/ScoreboardStyle.uc @@ -5,6 +5,7 @@ class ScoreboardStyle extends Object `include(Build.uci) `include(Logger.uci) +var config int EdgeSize; var config int ShapeServerNameBox; var config int ShapeGameInfoBox; var config int ShapeWaveInfoBox; @@ -74,6 +75,7 @@ public static function SCEStyle Settings() `callstack_static("Settings"); + Settings.EdgeSize = default.EdgeSize; Settings.ShapeServerNameBox = default.ShapeServerNameBox; Settings.ShapeGameInfoBox = default.ShapeGameInfoBox; Settings.ShapeWaveInfoBox = default.ShapeWaveInfoBox; @@ -135,6 +137,7 @@ public static function WriteSettings(SCEStyle Settings) { `callstack_static("WriteSettings"); + default.EdgeSize = Settings.EdgeSize; default.ShapeServerNameBox = Settings.ShapeServerNameBox; default.ShapeGameInfoBox = Settings.ShapeGameInfoBox; default.ShapeWaveInfoBox = Settings.ShapeWaveInfoBox; diff --git a/ScoreboardExt/Classes/Types.uc b/ScoreboardExt/Classes/Types.uc index 330a975..2768056 100644 --- a/ScoreboardExt/Classes/Types.uc +++ b/ScoreboardExt/Classes/Types.uc @@ -153,6 +153,7 @@ struct SCESettingsLevel struct SCEStyle { + var int EdgeSize; var int ShapeServerNameBox; var int ShapeGameInfoBox; var int ShapeWaveInfoBox; @@ -223,6 +224,8 @@ struct SCEStyle StructDefaultProperties { + EdgeSize = 8 + ShapeServerNameBox = 2 ShapeGameInfoBox = 1 ShapeWaveInfoBox = 0