add EdgeSize setting
This commit is contained in:
parent
7cae2bb925
commit
50ad0d6a97
@ -642,7 +642,7 @@ final function DrawRectBox(float X, float Y, float Width, float Height, int Edge
|
|||||||
Canvas.SetPos(X, Y);
|
Canvas.SetPos(X, Y);
|
||||||
DrawWhiteBox(Width, Height);
|
DrawWhiteBox(Width, Height);
|
||||||
|
|
||||||
default:
|
default: // 0
|
||||||
// ______
|
// ______
|
||||||
// / \
|
// / \
|
||||||
// | |
|
// | |
|
||||||
|
@ -110,7 +110,7 @@ function DrawMenu()
|
|||||||
local KFPlayerReplicationInfo KFPRI;
|
local KFPlayerReplicationInfo KFPRI;
|
||||||
local PlayerReplicationInfo PRI;
|
local PlayerReplicationInfo PRI;
|
||||||
local float XPos, YPos, YL, XL, FontScalar, XPosCenter, BoxW, BoxX, BoxH, MinBoxW;
|
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;
|
local float BorderSize;
|
||||||
|
|
||||||
PC = GetPlayer();
|
PC = GetPlayer();
|
||||||
@ -174,7 +174,6 @@ function DrawMenu()
|
|||||||
Canvas.Font = Owner.CurrentStyle.PickFont(FontScalar);
|
Canvas.Font = Owner.CurrentStyle.PickFont(FontScalar);
|
||||||
Canvas.TextSize("ABC", XL, YL, FontScalar, FontScalar);
|
Canvas.TextSize("ABC", XL, YL, FontScalar, FontScalar);
|
||||||
BorderSize = Owner.HUDOwner.ScaledBorderSize;
|
BorderSize = Owner.HUDOwner.ScaledBorderSize;
|
||||||
Edge = 8;
|
|
||||||
|
|
||||||
// Server Info
|
// Server Info
|
||||||
XPosCenter = Canvas.ClipX * 0.5;
|
XPosCenter = Canvas.ClipX * 0.5;
|
||||||
@ -188,7 +187,7 @@ function DrawMenu()
|
|||||||
|
|
||||||
// Top Rect (Server name)
|
// Top Rect (Server name)
|
||||||
SetDrawColor(Canvas, Settings.Style.ServerNameBoxColor);
|
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);
|
SetDrawColor(Canvas, Settings.Style.ServerNameTextColor);
|
||||||
S = KFGRI.ServerName;
|
S = KFGRI.ServerName;
|
||||||
@ -200,20 +199,20 @@ function DrawMenu()
|
|||||||
BoxW = Width * 0.7;
|
BoxW = Width * 0.7;
|
||||||
BoxH = YL * 2 + BorderSize * 2;
|
BoxH = YL * 2 + BorderSize * 2;
|
||||||
SetDrawColor(Canvas, Settings.Style.GameInfoBoxColor);
|
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);
|
SetDrawColor(Canvas, Settings.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 + Settings.Style.EdgeSize, YPos, FontScalar);
|
||||||
|
|
||||||
S = KFGRI.GameClass.default.GameName $ " - " $ class'KFCommon_LocalizedStrings'.Static.GetDifficultyString(KFGRI.GameDifficulty);
|
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)
|
// Mid Right Rect (Wave)
|
||||||
BoxX = BoxX + BoxW;
|
BoxX = BoxX + BoxW;
|
||||||
BoxW = Width - BoxW;
|
BoxW = Width - BoxW;
|
||||||
SetDrawColor(Canvas, Settings.Style.WaveBoxColor);
|
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);
|
SetDrawColor(Canvas, Settings.Style.WaveTextColor);
|
||||||
S = class'KFGFxHUD_ScoreboardMapInfoContainer'.default.WaveString;
|
S = class'KFGFxHUD_ScoreboardMapInfoContainer'.default.WaveString;
|
||||||
@ -227,12 +226,12 @@ function DrawMenu()
|
|||||||
BoxW = Width;
|
BoxW = Width;
|
||||||
BoxH = YL + BorderSize;
|
BoxH = YL + BorderSize;
|
||||||
SetDrawColor(Canvas, Settings.Style.PlayerCountBoxColor);
|
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);
|
SetDrawColor(Canvas, Settings.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 + Settings.Style.EdgeSize, YPos, FontScalar);
|
||||||
|
|
||||||
S = Owner.CurrentStyle.GetTimeString(KFGRI.ElapsedTime);
|
S = Owner.CurrentStyle.GetTimeString(KFGRI.ElapsedTime);
|
||||||
DrawTextShadowHVCenter(S, XPos + Width * 0.7, YPos, Width * 0.3, FontScalar);
|
DrawTextShadowHVCenter(S, XPos + Width * 0.7, YPos, Width * 0.3, FontScalar);
|
||||||
@ -256,13 +255,13 @@ function DrawMenu()
|
|||||||
YPos,
|
YPos,
|
||||||
Width + BorderSize * 4,
|
Width + BorderSize * 4,
|
||||||
BoxH,
|
BoxH,
|
||||||
Edge,
|
Settings.Style.EdgeSize,
|
||||||
Settings.Style.ShapeHeaderBox);
|
Settings.Style.ShapeHeaderBox);
|
||||||
|
|
||||||
// Calc X offsets
|
// Calc X offsets
|
||||||
MinBoxW = Width * 0.07; // minimum width for column
|
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;
|
PlayerXPos = Width * 0.20;
|
||||||
PerkXPos = Width * 0.40;
|
PerkXPos = Width * 0.40;
|
||||||
|
|
||||||
@ -442,7 +441,8 @@ function DrawPlayerEntry(Canvas C, int Index, float YOffset, float Height, float
|
|||||||
YOffset,
|
YOffset,
|
||||||
BoxWidth,
|
BoxWidth,
|
||||||
Height,
|
Height,
|
||||||
8, Shape);
|
Settings.Style.EdgeSize,
|
||||||
|
Shape);
|
||||||
|
|
||||||
XPos += BoxWidth;
|
XPos += BoxWidth;
|
||||||
|
|
||||||
@ -460,7 +460,7 @@ function DrawPlayerEntry(Canvas C, int Index, float YOffset, float Height, float
|
|||||||
Shape = Settings.Style.ShapePlayerBoxMidPlayer;
|
Shape = Settings.Style.ShapePlayerBoxMidPlayer;
|
||||||
|
|
||||||
BoxWidth = CashXPos + Owner.HUDOwner.ScaledBorderSize - BoxWidth;
|
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;
|
XPos += BoxWidth;
|
||||||
|
|
||||||
@ -478,7 +478,8 @@ function DrawPlayerEntry(Canvas C, int Index, float YOffset, float Height, float
|
|||||||
YOffset,
|
YOffset,
|
||||||
BoxWidth,
|
BoxWidth,
|
||||||
Height,
|
Height,
|
||||||
8, Shape);
|
Settings.Style.EdgeSize,
|
||||||
|
Shape);
|
||||||
|
|
||||||
// Rank
|
// Rank
|
||||||
if (CurrentRank.ApplyColorToFields.Rank)
|
if (CurrentRank.ApplyColorToFields.Rank)
|
||||||
|
@ -5,6 +5,7 @@ class ScoreboardStyle extends Object
|
|||||||
`include(Build.uci)
|
`include(Build.uci)
|
||||||
`include(Logger.uci)
|
`include(Logger.uci)
|
||||||
|
|
||||||
|
var config int EdgeSize;
|
||||||
var config int ShapeServerNameBox;
|
var config int ShapeServerNameBox;
|
||||||
var config int ShapeGameInfoBox;
|
var config int ShapeGameInfoBox;
|
||||||
var config int ShapeWaveInfoBox;
|
var config int ShapeWaveInfoBox;
|
||||||
@ -74,6 +75,7 @@ public static function SCEStyle Settings()
|
|||||||
|
|
||||||
`callstack_static("Settings");
|
`callstack_static("Settings");
|
||||||
|
|
||||||
|
Settings.EdgeSize = default.EdgeSize;
|
||||||
Settings.ShapeServerNameBox = default.ShapeServerNameBox;
|
Settings.ShapeServerNameBox = default.ShapeServerNameBox;
|
||||||
Settings.ShapeGameInfoBox = default.ShapeGameInfoBox;
|
Settings.ShapeGameInfoBox = default.ShapeGameInfoBox;
|
||||||
Settings.ShapeWaveInfoBox = default.ShapeWaveInfoBox;
|
Settings.ShapeWaveInfoBox = default.ShapeWaveInfoBox;
|
||||||
@ -135,6 +137,7 @@ public static function WriteSettings(SCEStyle Settings)
|
|||||||
{
|
{
|
||||||
`callstack_static("WriteSettings");
|
`callstack_static("WriteSettings");
|
||||||
|
|
||||||
|
default.EdgeSize = Settings.EdgeSize;
|
||||||
default.ShapeServerNameBox = Settings.ShapeServerNameBox;
|
default.ShapeServerNameBox = Settings.ShapeServerNameBox;
|
||||||
default.ShapeGameInfoBox = Settings.ShapeGameInfoBox;
|
default.ShapeGameInfoBox = Settings.ShapeGameInfoBox;
|
||||||
default.ShapeWaveInfoBox = Settings.ShapeWaveInfoBox;
|
default.ShapeWaveInfoBox = Settings.ShapeWaveInfoBox;
|
||||||
|
@ -153,6 +153,7 @@ struct SCESettingsLevel
|
|||||||
|
|
||||||
struct SCEStyle
|
struct SCEStyle
|
||||||
{
|
{
|
||||||
|
var int EdgeSize;
|
||||||
var int ShapeServerNameBox;
|
var int ShapeServerNameBox;
|
||||||
var int ShapeGameInfoBox;
|
var int ShapeGameInfoBox;
|
||||||
var int ShapeWaveInfoBox;
|
var int ShapeWaveInfoBox;
|
||||||
@ -223,6 +224,8 @@ struct SCEStyle
|
|||||||
|
|
||||||
StructDefaultProperties
|
StructDefaultProperties
|
||||||
{
|
{
|
||||||
|
EdgeSize = 8
|
||||||
|
|
||||||
ShapeServerNameBox = 2
|
ShapeServerNameBox = 2
|
||||||
ShapeGameInfoBox = 1
|
ShapeGameInfoBox = 1
|
||||||
ShapeWaveInfoBox = 0
|
ShapeWaveInfoBox = 0
|
||||||
|
Loading…
Reference in New Issue
Block a user