From af5f8bfdbcc95c97cc2a63c65475416892ea09ec Mon Sep 17 00:00:00 2001 From: Chomp Date: Wed, 25 Jun 2025 22:54:01 +0100 Subject: [PATCH] Cleaned up watermark, set text to Magenta when in debug --- .../SPTarkov.Server.Core/Utils/Watermark.cs | 32 ++++++++++++------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/Libraries/SPTarkov.Server.Core/Utils/Watermark.cs b/Libraries/SPTarkov.Server.Core/Utils/Watermark.cs index 9940e1d4..843ba107 100644 --- a/Libraries/SPTarkov.Server.Core/Utils/Watermark.cs +++ b/Libraries/SPTarkov.Server.Core/Utils/Watermark.cs @@ -11,13 +11,13 @@ namespace SPTarkov.Server.Core.Utils; [Injectable] public class WatermarkLocale { - protected List description; - protected List modding; - protected List warning; + protected readonly List Description; + protected readonly List Modding; + protected readonly List Warning; public WatermarkLocale(LocalisationService localisationService) { - description = + Description = [ localisationService.GetText("watermark-discord_url"), "", @@ -25,7 +25,7 @@ public class WatermarkLocale localisationService.GetText("watermark-paid_scammed"), localisationService.GetText("watermark-commercial_use_prohibited"), ]; - warning = + Warning = [ "", localisationService.GetText("watermark-testing_build"), @@ -36,7 +36,7 @@ public class WatermarkLocale "", localisationService.GetText("watermark-use_at_own_risk"), ]; - modding = + Modding = [ "", localisationService.GetText("watermark-modding_disabled"), @@ -48,17 +48,17 @@ public class WatermarkLocale public List GetDescription() { - return description; + return Description; } public List GetWarning() { - return warning; + return Warning; } public List GetModding() { - return modding; + return Modding; } } @@ -119,7 +119,15 @@ public class Watermark : IOnLoad } SetTitle(); - Draw(); + + if (ProgramStatics.DEBUG()) + { + Draw(LogTextColor.Magenta); + } + else + { + Draw(); + } return Task.CompletedTask; } @@ -170,7 +178,7 @@ public class Watermark : IOnLoad /// /// Draw watermark on screen /// - protected void Draw() + protected void Draw(LogTextColor color = LogTextColor.Yellow) { var result = new List(); @@ -207,7 +215,7 @@ public class Watermark : IOnLoad // Log watermark to screen foreach (var text in result) { - _logger.LogWithColor(text, LogTextColor.Yellow); + _logger.LogWithColor(text, color); } } }