From 2ab3198bbddca7189f6a62eb70e4abcb0cf7d5f0 Mon Sep 17 00:00:00 2001 From: GenZmeY Date: Wed, 9 Jun 2021 05:47:15 +0300 Subject: [PATCH] correct settings --- README.md | 1 + ScoreboardExt/Classes/DynamicLevelColor.uc | 56 +++++++++++++ ...{ThresholdsPing.uc => DynamicPingColor.uc} | 8 +- ScoreboardExt/Classes/DynamicStateColor.uc | 38 +++++++++ ScoreboardExt/Classes/KFScoreBoard.uc | 71 ++++++++++------ ScoreboardExt/Classes/ScoreboardExtMut.uc | 12 +-- ScoreboardExt/Classes/ScoreboardStyle.uc | 42 +++++----- ScoreboardExt/Classes/ThresholdsHP.uc | 35 -------- ScoreboardExt/Classes/ThresholdsLevel.uc | 53 ------------ ScoreboardExt/Classes/Types.uc | 82 +++++++++++-------- 10 files changed, 223 insertions(+), 175 deletions(-) create mode 100644 ScoreboardExt/Classes/DynamicLevelColor.uc rename ScoreboardExt/Classes/{ThresholdsPing.uc => DynamicPingColor.uc} (66%) create mode 100644 ScoreboardExt/Classes/DynamicStateColor.uc delete mode 100644 ScoreboardExt/Classes/ThresholdsHP.uc delete mode 100644 ScoreboardExt/Classes/ThresholdsLevel.uc diff --git a/README.md b/README.md index 0e87dc5..c4c377e 100644 --- a/README.md +++ b/README.md @@ -5,3 +5,4 @@ 2. Check fields char capacity (crop if text is large then cap) 3. Check steam group (?) 4. Rework replication +5. Localization \ No newline at end of file diff --git a/ScoreboardExt/Classes/DynamicLevelColor.uc b/ScoreboardExt/Classes/DynamicLevelColor.uc new file mode 100644 index 0000000..bae02e7 --- /dev/null +++ b/ScoreboardExt/Classes/DynamicLevelColor.uc @@ -0,0 +1,56 @@ +class DynamicLevelColor extends Object + dependson(Types) + config(ScoreboardExt); + +var config bool bEnabled; +var config int Normal_Low; +var config int Normal_High; +var config int Hard_Low; +var config int Hard_High; +var config int Suicide_Low; +var config int Suicide_High; +var config int HellOnEarth_Low; +var config int HellOnEarth_High; + +public static function SCESettingsLevel DefaultSettings() +{ + local SCESettingsLevel Settings; + return Settings; +} + +public static function SCESettingsLevel Settings() +{ + local SCESettingsLevel Settings; + + Settings.Dynamic = default.bEnabled; + Settings.Low[0] = default.Normal_Low; + Settings.High[0] = default.Normal_High; + Settings.Low[1] = default.Hard_Low; + Settings.High[1] = default.Hard_High; + Settings.Low[2] = default.Suicide_Low; + Settings.High[2] = default.Suicide_High; + Settings.Low[3] = default.HellOnEarth_Low; + Settings.High[3] = default.HellOnEarth_High; + + return Settings; +} + +public static function WriteSettings(SCESettingsLevel Settings) +{ + default.bEnabled = Settings.Dynamic; + default.Normal_Low = Settings.Low[0]; + default.Normal_High = Settings.High[0]; + default.Hard_Low = Settings.Low[1]; + default.Hard_High = Settings.High[1]; + default.Suicide_Low = Settings.Low[2]; + default.Suicide_High = Settings.High[2]; + default.HellOnEarth_Low = Settings.Low[3]; + default.HellOnEarth_High = Settings.High[3]; + + StaticSaveConfig(); +} + +DefaultProperties +{ + +} \ No newline at end of file diff --git a/ScoreboardExt/Classes/ThresholdsPing.uc b/ScoreboardExt/Classes/DynamicPingColor.uc similarity index 66% rename from ScoreboardExt/Classes/ThresholdsPing.uc rename to ScoreboardExt/Classes/DynamicPingColor.uc index 17203dd..7df188b 100644 --- a/ScoreboardExt/Classes/ThresholdsPing.uc +++ b/ScoreboardExt/Classes/DynamicPingColor.uc @@ -1,9 +1,11 @@ -class ThresholdsPing extends Object +class DynamicPingColor extends Object dependson(Types) config(ScoreboardExt); +var config bool bEnabled; var config int Low; var config int High; +var config bool bShowPingBars; public static function SCESettingsPing DefaultSettings() { @@ -15,16 +17,20 @@ public static function SCESettingsPing Settings() { local SCESettingsPing Settings; + Settings.Dynamic = default.bEnabled; Settings.Low = default.Low; Settings.High = default.High; + Settings.ShowPingBars = default.bShowPingBars; return Settings; } public static function WriteSettings(SCESettingsPing Settings) { + default.bEnabled = Settings.Dynamic; default.Low = Settings.Low; default.High = Settings.High; + default.bShowPingBars = Settings.ShowPingBars; StaticSaveConfig(); } diff --git a/ScoreboardExt/Classes/DynamicStateColor.uc b/ScoreboardExt/Classes/DynamicStateColor.uc new file mode 100644 index 0000000..93ace49 --- /dev/null +++ b/ScoreboardExt/Classes/DynamicStateColor.uc @@ -0,0 +1,38 @@ +class DynamicStateColor extends Object + dependson(Types) + config(ScoreboardExt); + +var config bool bEnabled; +var config int Low; +var config int High; + +public static function SCESettingsState DefaultSettings() +{ + local SCESettingsState Settings; + return Settings; +} + +public static function SCESettingsState Settings() +{ + local SCESettingsState Settings; + + Settings.Dynamic = default.bEnabled; + Settings.Low = default.Low; + Settings.High = default.High; + + return Settings; +} + +public static function WriteSettings(SCESettingsState Settings) +{ + default.bEnabled = Settings.Dynamic; + default.Low = Settings.Low; + default.High = Settings.High; + + StaticSaveConfig(); +} + +DefaultProperties +{ + +} \ No newline at end of file diff --git a/ScoreboardExt/Classes/KFScoreBoard.uc b/ScoreboardExt/Classes/KFScoreBoard.uc index 945844e..377e26b 100644 --- a/ScoreboardExt/Classes/KFScoreBoard.uc +++ b/ScoreboardExt/Classes/KFScoreBoard.uc @@ -192,7 +192,7 @@ function DrawMenu() S = class'KFCommon_LocalizedStrings'.static.GetFriendlyMapName(PC.WorldInfo.GetMapName(true)); DrawTextShadowHLeftVCenter(S, BoxX + Edge, 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); // Mid Right Rect (Wave) @@ -273,7 +273,7 @@ function DrawMenu() DrawTextShadowHVCenter(class'KFGFxHUD_ScoreboardWidget'.default.KillsString, XPos + KillsXPos, YPos, KillsWBox, FontScalar); DrawTextShadowHVCenter(class'KFGFxHUD_ScoreboardWidget'.default.AssistsString, XPos + AssistXPos, YPos, AssistWBox, FontScalar); DrawTextShadowHVCenter(class'KFGFxHUD_ScoreboardWidget'.default.DoshString, XPos + CashXPos, YPos, CashWBox, FontScalar); - DrawTextShadowHVCenter("HEALTH", XPos + HealthXPos, YPos, HealthWBox, FontScalar); + DrawTextShadowHVCenter("STATE", XPos + HealthXPos, YPos, HealthWBox, FontScalar); DrawTextShadowHVCenter(class'KFGFxHUD_ScoreboardWidget'.default.PingString, XPos + PingXPos, YPos, PingWBox, FontScalar); PlayersList.XPosition = ((Canvas.ClipX - Width) * 0.5) / InputPos[2]; @@ -376,30 +376,33 @@ function DrawPlayerEntry( Canvas C, int Index, float YOffset, float Height, floa // change rect color by HP if( !KFPRI.bReadyToPlay && KFGRI.bMatchHasBegun ) { - SetDrawColor(C, Settings.Style.LeftHPBoxColorNone); + SetDrawColor(C, Settings.Style.LeftStateBoxColor); } else if ( !KFGRI.bMatchHasBegun ) { - SetDrawColor(C, Settings.Style.LeftHPBoxColorNone); + SetDrawColor(C, Settings.Style.LeftStateBoxColor); } else if( bIsZED && KFTeamInfo_Zeds(GetPlayer().PlayerReplicationInfo.Team) == None ) { - SetDrawColor(C, Settings.Style.LeftHPBoxColorNone); + SetDrawColor(C, Settings.Style.LeftStateBoxColor); } else if (KFPRI.PlayerHealth <= 0 || KFPRI.PlayerHealthPercent <= 0) { - SetDrawColor(C, Settings.Style.LeftHPBoxColorDead); + SetDrawColor(C, Settings.Style.LeftStateBoxColorDead); } else { - if (ByteToFloat(KFPRI.PlayerHealthPercent) >= float(Settings.HP.High) / 100.0) - SetDrawColor(C, Settings.Style.LeftHPBoxColorHigh); - else if (ByteToFloat(KFPRI.PlayerHealthPercent) >= float(Settings.HP.Low) / 100.0) - SetDrawColor(C, Settings.Style.LeftHPBoxColorMid); + if (ByteToFloat(KFPRI.PlayerHealthPercent) >= float(Settings.State.High) / 100.0) + SetDrawColor(C, Settings.Style.LeftStateBoxColorHigh); + else if (ByteToFloat(KFPRI.PlayerHealthPercent) >= float(Settings.State.Low) / 100.0) + SetDrawColor(C, Settings.Style.LeftStateBoxColorMid); else - SetDrawColor(C, Settings.Style.LeftHPBoxColorLow); + SetDrawColor(C, Settings.Style.LeftStateBoxColorLow); } + if (!Settings.State.Dynamic) + SetDrawColor(C, Settings.Style.LeftStateBoxColor); + BoxWidth = Owner.HUDOwner.ScaledBorderSize * 8; Owner.CurrentStyle.DrawRectBox( XPos, @@ -478,13 +481,33 @@ function DrawPlayerEntry( Canvas C, int Index, float YOffset, float Height, floa C.SetPos(PerkIconPosX, PerkIconPosY); C.DrawTile(KFPRI.CurrentPerkClass.default.PerkIcon, PerkIconSize, PerkIconSize, 0, 0, 256, 256); } + + if (CurrentRank.ApplyColorToFields.Level) + SetDrawColor(C, CurrentRank.TextColor); + else if (!Settings.Level.Dynamic) + SetDrawColor(C, Settings.Style.LevelTextColor); + else + { + if (Level < Settings.Level.Low[KFGRI.GameDifficulty]) + SetDrawColor(C, Settings.Style.LevelTextColorLow); + else if (Level < Settings.Level.High[KFGRI.GameDifficulty]) + SetDrawColor(C, Settings.Style.LevelTextColorMid); + else + SetDrawColor(C, Settings.Style.LevelTextColorHigh); + } + S = String(Level); + DrawTextShadowHLeftVCenter(S, PerkXPos, TextYOffset, FontScalar); + if (Len(S) == 1) + Canvas.TextSize(S@" ", XL, YL, FontScalar, FontScalar); + else + Canvas.TextSize(S$" ", XL, YL, FontScalar, FontScalar); if (CurrentRank.ApplyColorToFields.Perk) SetDrawColor(C, CurrentRank.TextColor); else - SetDrawColor(C, Settings.Style.PerkTextColor); // TODO: LevelTextColor - S = Level@KFPRI.CurrentPerkClass.default.PerkName; - DrawTextShadowHLeftVCenter(S, PerkXPos, TextYOffset, FontScalar); + SetDrawColor(C, Settings.Style.PerkTextColor); + S = KFPRI.CurrentPerkClass.default.PerkName; + DrawTextShadowHLeftVCenter(S, PerkXPos+XL, TextYOffset, FontScalar); } else { @@ -516,9 +539,7 @@ function DrawPlayerEntry( Canvas C, int Index, float YOffset, float Height, floa SetDrawColor(C, CurrentRank.TextColor); else SetDrawColor(C, Settings.Style.PlayerNameTextColor); - if( Len(KFPRI.PlayerName) > 25 ) - S = Left(KFPRI.PlayerName, 25); - else S = KFPRI.PlayerName; + S = KFPRI.PlayerName; DrawTextShadowHLeftVCenter(S, PlayerXPos, TextYOffset, FontScalar); // Kill @@ -572,7 +593,7 @@ function DrawPlayerEntry( Canvas C, int Index, float YOffset, float Height, floa } else if( bIsZED && KFTeamInfo_Zeds(GetPlayer().PlayerReplicationInfo.Team) == None ) { - SetDrawColor(C, Settings.Style.StateTextColorNone); + SetDrawColor(C, Settings.Style.StateTextColor); S = "Unknown"; } else if (KFPRI.PlayerHealth <= 0 || KFPRI.PlayerHealthPercent <= 0) @@ -590,9 +611,9 @@ function DrawPlayerEntry( Canvas C, int Index, float YOffset, float Height, floa } else { - if (ByteToFloat(KFPRI.PlayerHealthPercent) >= float(Settings.HP.High) / 100.0) + if (ByteToFloat(KFPRI.PlayerHealthPercent) >= float(Settings.State.High) / 100.0) SetDrawColor(C, Settings.Style.StateTextColorHighHP); - else if (ByteToFloat(KFPRI.PlayerHealthPercent) >= float(Settings.HP.Low) / 100.0) + else if (ByteToFloat(KFPRI.PlayerHealthPercent) >= float(Settings.State.Low) / 100.0) SetDrawColor(C, Settings.Style.StateTextColorMidHP); else SetDrawColor(C, Settings.Style.StateTextColorLowHP); @@ -601,12 +622,14 @@ function DrawPlayerEntry( Canvas C, int Index, float YOffset, float Height, floa if (CurrentRank.ApplyColorToFields.Health) SetDrawColor(C, CurrentRank.TextColor); + else if (!Settings.State.Dynamic) + SetDrawColor(C, Settings.Style.StateTextColor); DrawTextShadowHVCenter(S, HealthXPos, TextYOffset, HealthWBox, FontScalar); // Ping if (KFPRI.bBot) { - SetDrawColor(C, Settings.Style.PingTextColorNone); + SetDrawColor(C, Settings.Style.PingTextColor); S = "-"; } else @@ -626,10 +649,10 @@ function DrawPlayerEntry( Canvas C, int Index, float YOffset, float Height, floa } C.TextSize(MaxPing, XL, YL, FontScalar, FontScalar); - DrawTextShadowHVCenter(S, PingXPos, TextYOffset, PingWBox/2, FontScalar); + DrawTextShadowHVCenter(S, PingXPos, TextYOffset, Settings.Ping.ShowPingBars ? PingWBox/2 : PingWBox, FontScalar); C.SetDrawColor(250,250,250,255); - - DrawPingBars(C, YOffset + (Height/2) - ((Height*0.5)/2), Width - (Height*0.5) - (Owner.HUDOwner.ScaledBorderSize*2), Height*0.5, Height*0.5, float(Ping)); + if (Settings.Ping.ShowPingBars) + DrawPingBars(C, YOffset + (Height/2) - ((Height*0.5)/2), Width - (Height*0.5) - (Owner.HUDOwner.ScaledBorderSize*2), Height*0.5, Height*0.5, float(Ping)); } final function DrawPingBars( Canvas C, float YOffset, float XOffset, float W, float H, float Ping ) diff --git a/ScoreboardExt/Classes/ScoreboardExtMut.uc b/ScoreboardExt/Classes/ScoreboardExtMut.uc index 57b8921..dba8f8c 100644 --- a/ScoreboardExt/Classes/ScoreboardExtMut.uc +++ b/ScoreboardExt/Classes/ScoreboardExtMut.uc @@ -31,9 +31,9 @@ function PostBeginPlay() Settings.Style = class'ScoreboardStyle'.static.Settings(); Settings.Admin = class'SystemAdminRank'.static.Settings(); Settings.Player = class'SystemPlayerRank'.static.Settings(); - Settings.HP = class'ThresholdsHP'.static.Settings(); - Settings.Ping = class'ThresholdsPing'.static.Settings(); - Settings.Level = class'ThresholdsLevel'.static.Settings(); + Settings.State = class'DynamicStateColor'.static.Settings(); + Settings.Ping = class'DynamicPingColor'.static.Settings(); + Settings.Level = class'DynamicLevelColor'.static.Settings(); } function NotifyLogin(Controller C) @@ -63,9 +63,9 @@ private function InitConfig() class'SystemAdminRank'.static.WriteSettings(class'SystemAdminRank'.static.DefaultSettings()); class'SystemPlayerRank'.static.WriteSettings(class'SystemPlayerRank'.static.DefaultSettings()); class'ScoreboardStyle'.static.WriteSettings(class'ScoreboardStyle'.static.DefaultSettings()); - class'ThresholdsHP'.static.WriteSettings(class'ThresholdsHP'.static.DefaultSettings()); - class'ThresholdsPing'.static.WriteSettings(class'ThresholdsPing'.static.DefaultSettings()); - class'ThresholdsLevel'.static.WriteSettings(class'ThresholdsLevel'.static.DefaultSettings()); + class'DynamicStateColor'.static.WriteSettings(class'DynamicStateColor'.static.DefaultSettings()); + class'DynamicPingColor'.static.WriteSettings(class'DynamicPingColor'.static.DefaultSettings()); + class'DynamicLevelColor'.static.WriteSettings(class'DynamicLevelColor'.static.DefaultSettings()); // Example rank for player(s) ExampleRank.ID = 0; diff --git a/ScoreboardExt/Classes/ScoreboardStyle.uc b/ScoreboardExt/Classes/ScoreboardStyle.uc index b0fb759..8e1f5f2 100644 --- a/ScoreboardExt/Classes/ScoreboardStyle.uc +++ b/ScoreboardExt/Classes/ScoreboardStyle.uc @@ -12,11 +12,11 @@ var config ColorRGBA PlayerCountBoxColor; var config ColorRGBA PlayerCountTextColor; var config ColorRGBA ListHeaderBoxColor; var config ColorRGBA ListHeaderTextColor; -var config ColorRGBA LeftHPBoxColorNone; -var config ColorRGBA LeftHPBoxColorDead; -var config ColorRGBA LeftHPBoxColorLow; -var config ColorRGBA LeftHPBoxColorMid; -var config ColorRGBA LeftHPBoxColorHigh; +var config ColorRGBA LeftStateBoxColor; +var config ColorRGBA LeftStateBoxColorDead; +var config ColorRGBA LeftStateBoxColorLow; +var config ColorRGBA LeftStateBoxColorMid; +var config ColorRGBA LeftStateBoxColorHigh; var config ColorRGBA PlayerOwnerBoxColor; var config ColorRGBA PlayerBoxColor; var config ColorRGBA StatsBoxColor; @@ -31,13 +31,13 @@ var config ColorRGBA DoshTextColor; var config ColorRGBA StateTextColorLobby; var config ColorRGBA StateTextColorReady; var config ColorRGBA StateTextColorNotReady; -var config ColorRGBA StateTextColorNone; +var config ColorRGBA StateTextColor; var config ColorRGBA StateTextColorSpectator; var config ColorRGBA StateTextColorDead; var config ColorRGBA StateTextColorLowHP; var config ColorRGBA StateTextColorMidHP; var config ColorRGBA StateTextColorHighHP; -var config ColorRGBA PingTextColorNone; +var config ColorRGBA PingTextColor; var config ColorRGBA PingTextColorLow; var config ColorRGBA PingTextColorMid; var config ColorRGBA PingTextColorHigh; @@ -62,11 +62,11 @@ public static function SCEStyle Settings() Settings.PlayerCountTextColor = default.PlayerCountTextColor; Settings.ListHeaderBoxColor = default.ListHeaderBoxColor; Settings.ListHeaderTextColor = default.ListHeaderTextColor; - Settings.LeftHPBoxColorNone = default.LeftHPBoxColorNone; - Settings.LeftHPBoxColorDead = default.LeftHPBoxColorDead; - Settings.LeftHPBoxColorLow = default.LeftHPBoxColorLow; - Settings.LeftHPBoxColorMid = default.LeftHPBoxColorMid; - Settings.LeftHPBoxColorHigh = default.LeftHPBoxColorHigh; + Settings.LeftStateBoxColor = default.LeftStateBoxColor; + Settings.LeftStateBoxColorDead = default.LeftStateBoxColorDead; + Settings.LeftStateBoxColorLow = default.LeftStateBoxColorLow; + Settings.LeftStateBoxColorMid = default.LeftStateBoxColorMid; + Settings.LeftStateBoxColorHigh = default.LeftStateBoxColorHigh; Settings.PlayerOwnerBoxColor = default.PlayerOwnerBoxColor; Settings.PlayerBoxColor = default.PlayerBoxColor; Settings.StatsBoxColor = default.StatsBoxColor; @@ -81,13 +81,13 @@ public static function SCEStyle Settings() Settings.StateTextColorLobby = default.StateTextColorLobby; Settings.StateTextColorReady = default.StateTextColorReady; Settings.StateTextColorNotReady = default.StateTextColorNotReady; - Settings.StateTextColorNone = default.StateTextColorNone; + Settings.StateTextColor = default.StateTextColor; Settings.StateTextColorSpectator = default.StateTextColorSpectator; Settings.StateTextColorDead = default.StateTextColorDead; Settings.StateTextColorLowHP = default.StateTextColorLowHP; Settings.StateTextColorMidHP = default.StateTextColorMidHP; Settings.StateTextColorHighHP = default.StateTextColorHighHP; - Settings.PingTextColorNone = default.PingTextColorNone; + Settings.PingTextColor = default.PingTextColor; Settings.PingTextColorLow = default.PingTextColorLow; Settings.PingTextColorMid = default.PingTextColorMid; Settings.PingTextColorHigh = default.PingTextColorHigh; @@ -107,11 +107,11 @@ public static function WriteSettings(SCEStyle Settings) default.PlayerCountTextColor = Settings.PlayerCountTextColor; default.ListHeaderBoxColor = Settings.ListHeaderBoxColor; default.ListHeaderTextColor = Settings.ListHeaderTextColor; - default.LeftHPBoxColorNone = Settings.LeftHPBoxColorNone; - default.LeftHPBoxColorDead = Settings.LeftHPBoxColorDead; - default.LeftHPBoxColorLow = Settings.LeftHPBoxColorLow; - default.LeftHPBoxColorMid = Settings.LeftHPBoxColorMid; - default.LeftHPBoxColorHigh = Settings.LeftHPBoxColorHigh; + default.LeftStateBoxColor = Settings.LeftStateBoxColor; + default.LeftStateBoxColorDead = Settings.LeftStateBoxColorDead; + default.LeftStateBoxColorLow = Settings.LeftStateBoxColorLow; + default.LeftStateBoxColorMid = Settings.LeftStateBoxColorMid; + default.LeftStateBoxColorHigh = Settings.LeftStateBoxColorHigh; default.PlayerOwnerBoxColor = Settings.PlayerOwnerBoxColor; default.PlayerBoxColor = Settings.PlayerBoxColor; default.StatsBoxColor = Settings.StatsBoxColor; @@ -126,13 +126,13 @@ public static function WriteSettings(SCEStyle Settings) default.StateTextColorLobby = Settings.StateTextColorLobby; default.StateTextColorReady = Settings.StateTextColorReady; default.StateTextColorNotReady = Settings.StateTextColorNotReady; - default.StateTextColorNone = Settings.StateTextColorNone; + default.StateTextColor = Settings.StateTextColor; default.StateTextColorSpectator = Settings.StateTextColorSpectator; default.StateTextColorDead = Settings.StateTextColorDead; default.StateTextColorLowHP = Settings.StateTextColorLowHP; default.StateTextColorMidHP = Settings.StateTextColorMidHP; default.StateTextColorHighHP = Settings.StateTextColorHighHP; - default.PingTextColorNone = Settings.PingTextColorNone; + default.PingTextColor = Settings.PingTextColor; default.PingTextColorLow = Settings.PingTextColorLow; default.PingTextColorMid = Settings.PingTextColorMid; default.PingTextColorHigh = Settings.PingTextColorHigh; diff --git a/ScoreboardExt/Classes/ThresholdsHP.uc b/ScoreboardExt/Classes/ThresholdsHP.uc deleted file mode 100644 index 359f5fd..0000000 --- a/ScoreboardExt/Classes/ThresholdsHP.uc +++ /dev/null @@ -1,35 +0,0 @@ -class ThresholdsHP extends Object - dependson(Types) - config(ScoreboardExt); - -var config int Low; -var config int High; - -public static function SCESettingsHP DefaultSettings() -{ - local SCESettingsHP Settings; - return Settings; -} - -public static function SCESettingsHP Settings() -{ - local SCESettingsHP Settings; - - Settings.Low = default.Low; - Settings.High = default.High; - - return Settings; -} - -public static function WriteSettings(SCESettingsHP Settings) -{ - default.Low = Settings.Low; - default.High = Settings.High; - - StaticSaveConfig(); -} - -DefaultProperties -{ - -} \ No newline at end of file diff --git a/ScoreboardExt/Classes/ThresholdsLevel.uc b/ScoreboardExt/Classes/ThresholdsLevel.uc deleted file mode 100644 index 9db900f..0000000 --- a/ScoreboardExt/Classes/ThresholdsLevel.uc +++ /dev/null @@ -1,53 +0,0 @@ -class ThresholdsLevel extends Object - dependson(Types) - config(ScoreboardExt); - -var config int Normal_Low; -var config int Normal_High; -var config int Hard_Low; -var config int Hard_High; -var config int Suicide_Low; -var config int Suicide_High; -var config int HellOnEarth_Low; -var config int HellOnEarth_High; - -public static function SCESettingsLevel DefaultSettings() -{ - local SCESettingsLevel Settings; - return Settings; -} - -public static function SCESettingsLevel Settings() -{ - local SCESettingsLevel Settings; - - Settings.Normal_Low = default.Normal_Low; - Settings.Normal_High = default.Normal_High; - Settings.Hard_Low = default.Hard_Low; - Settings.Hard_High = default.Hard_High; - Settings.Suicide_Low = default.Suicide_Low; - Settings.Suicide_High = default.Suicide_High; - Settings.HellOnEarth_Low = default.HellOnEarth_Low; - Settings.HellOnEarth_High = default.HellOnEarth_High; - - return Settings; -} - -public static function WriteSettings(SCESettingsLevel Settings) -{ - default.Normal_Low = Settings.Normal_Low; - default.Normal_High = Settings.Normal_High; - default.Hard_Low = Settings.Hard_Low; - default.Hard_High = Settings.Hard_High; - default.Suicide_Low = Settings.Suicide_Low; - default.Suicide_High = Settings.Suicide_High; - default.HellOnEarth_Low = Settings.HellOnEarth_Low; - default.HellOnEarth_High = Settings.HellOnEarth_High; - - StaticSaveConfig(); -} - -DefaultProperties -{ - -} \ No newline at end of file diff --git a/ScoreboardExt/Classes/Types.uc b/ScoreboardExt/Classes/Types.uc index a51c30a..39c9441 100644 --- a/ScoreboardExt/Classes/Types.uc +++ b/ScoreboardExt/Classes/Types.uc @@ -17,6 +17,7 @@ struct Fields { var bool Rank; var bool Player; + var bool Level; var bool Perk; var bool Dosh; var bool Kills; @@ -28,6 +29,7 @@ struct Fields { Rank = true; Player = true; + Level = false; Perk = false; Dosh = false; Kills = false; @@ -74,7 +76,7 @@ struct SCESettingsAdmin { Rank="Admin" TextColor=(R=250,G=0,B=0,A=255) - ApplyColorToFields=(Rank=True,Player=True,Perk=False,Dosh=False,Kills=False,Assists=False,Health=False,Ping=False) + ApplyColorToFields=(Rank=True,Player=True,Level=False,Perk=False,Dosh=False,Kills=False,Assists=False,Health=False,Ping=False) } }; @@ -88,17 +90,19 @@ struct SCESettingsPlayer { Rank="Player" TextColor=(R=250,G=250,B=250,A=255) - ApplyColorToFields=(Rank=True,Player=True,Perk=False,Dosh=False,Kills=False,Assists=False,Health=False,Ping=False) + ApplyColorToFields=(Rank=True,Player=True,Level=False,Perk=False,Dosh=False,Kills=False,Assists=False,Health=False,Ping=False) } }; -struct SCESettingsHP +struct SCESettingsState { + var bool Dynamic; var int Low; var int High; StructDefaultProperties { + Dynamic=True Low=40 High=80 } @@ -106,37 +110,37 @@ struct SCESettingsHP struct SCESettingsPing { + var bool Dynamic; var int Low; var int High; + var bool ShowPingBars; StructDefaultProperties { + Dynamic=True Low=60 - High=120; + High=120 + ShowPingBars=True } }; struct SCESettingsLevel { - var int Normal_Low; - var int Normal_High; - var int Hard_Low; - var int Hard_High; - var int Suicide_Low; - var int Suicide_High; - var int HellOnEarth_Low; - var int HellOnEarth_High; + var bool Dynamic; + var int Low[4]; + var int High[4]; StructDefaultProperties { - Normal_Low=0; - Normal_High=0; - Hard_Low=5; - Hard_High=15; - Suicide_Low=15; - Suicide_High=20; - HellOnEarth_Low=20; - HellOnEarth_High=25; + Dynamic=True + Low[0]=0 + High[0]=0 + Low[1]=5 + High[1]=15 + Low[2]=15 + High[2]=20 + Low[3]=20 + High[3]=25 } }; @@ -157,11 +161,11 @@ struct SCEStyle var ColorRGBA ListHeaderBoxColor; var ColorRGBA ListHeaderTextColor; - var ColorRGBA LeftHPBoxColorNone; - var ColorRGBA LeftHPBoxColorDead; - var ColorRGBA LeftHPBoxColorLow; - var ColorRGBA LeftHPBoxColorMid; - var ColorRGBA LeftHPBoxColorHigh; + var ColorRGBA LeftStateBoxColor; + var ColorRGBA LeftStateBoxColorDead; + var ColorRGBA LeftStateBoxColorLow; + var ColorRGBA LeftStateBoxColorMid; + var ColorRGBA LeftStateBoxColorHigh; var ColorRGBA PlayerOwnerBoxColor; var ColorRGBA PlayerBoxColor; @@ -175,18 +179,22 @@ struct SCEStyle var ColorRGBA KillsTextColor; var ColorRGBA AssistsTextColor; var ColorRGBA DoshTextColor; + var ColorRGBA StateTextColor; + var ColorRGBA PingTextColor; + var ColorRGBA LevelTextColorLow; + var ColorRGBA LevelTextColorMid; + var ColorRGBA LevelTextColorHigh; + var ColorRGBA StateTextColorLobby; var ColorRGBA StateTextColorReady; var ColorRGBA StateTextColorNotReady; - var ColorRGBA StateTextColorNone; var ColorRGBA StateTextColorSpectator; var ColorRGBA StateTextColorDead; var ColorRGBA StateTextColorLowHP; var ColorRGBA StateTextColorMidHP; var ColorRGBA StateTextColorHighHP; - var ColorRGBA PingTextColorNone; var ColorRGBA PingTextColorLow; var ColorRGBA PingTextColorMid; var ColorRGBA PingTextColorHigh; @@ -208,11 +216,11 @@ struct SCEStyle ListHeaderBoxColor=(R=10,G=10,B=10,A=200) ListHeaderTextColor=(R=250,G=250,B=250,A=255) - LeftHPBoxColorNone=(R=150,G=150,B=150,A=150) - LeftHPBoxColorDead=(R=200,G=0,B=0,A=150) - LeftHPBoxColorLow=(R=200,G=50,B=50,A=150) - LeftHPBoxColorMid=(R=200,G=200,B=0,A=150) - LeftHPBoxColorHigh=(R=0,G=200,B=0,A=150) + LeftStateBoxColor=(R=150,G=150,B=150,A=150) + LeftStateBoxColorDead=(R=200,G=0,B=0,A=150) + LeftStateBoxColorLow=(R=200,G=50,B=50,A=150) + LeftStateBoxColorMid=(R=200,G=200,B=0,A=150) + LeftStateBoxColorHigh=(R=0,G=200,B=0,A=150) PlayerOwnerBoxColor=(R=100,G=10,B=10,A=150) PlayerBoxColor=(R=30,G=30,B=30,A=150) @@ -226,18 +234,22 @@ struct SCEStyle KillsTextColor=(R=250,G=250,B=250,A=255) AssistsTextColor=(R=250,G=250,B=250,A=255) DoshTextColor=(R=250,G=250,B=100,A=255) + StateTextColor=(R=150,G=150,B=150,A=150) + PingTextColor=(R=250,G=250,B=250,A=255) + + LevelTextColorLow=(R=250,G=100,B=100,A=255) + LevelTextColorMid=(R=250,G=250,B=0,A=255) + LevelTextColorHigh=(R=0,G=250,B=0,A=255) StateTextColorLobby=(R=150,G=150,B=150,A=150) StateTextColorReady=(R=150,G=150,B=150,A=150) StateTextColorNotReady=(R=150,G=150,B=150,A=150) - StateTextColorNone=(R=150,G=150,B=150,A=150) StateTextColorSpectator=(R=150,G=150,B=150,A=150) StateTextColorDead=(R=250,G=0,B=0,A=255) StateTextColorLowHP=(R=250,G=100,B=100,A=255) StateTextColorMidHP=(R=250,G=250,B=0,A=255) StateTextColorHighHP=(R=0,G=250,B=0,A=255) - PingTextColorNone=(R=250,G=250,B=250,A=255) PingTextColorLow=(R=0,G=250,B=0,A=255) PingTextColorMid=(R=250,G=250,B=0,A=255) PingTextColorHigh=(R=250,G=0,B=0,A=255) @@ -249,7 +261,7 @@ struct SCESettings var SCEStyle Style; var SCESettingsAdmin Admin; var SCESettingsPlayer Player; - var SCESettingsHP HP; + var SCESettingsState State; var SCESettingsPing Ping; var SCESettingsLevel Level; };