From f393d90eb6a05ba21b56780a13762d42084865d3 Mon Sep 17 00:00:00 2001 From: Simon <63975668+Simyon264@users.noreply.github.com> Date: Mon, 15 Jul 2024 20:58:02 +0200 Subject: [PATCH] Fix some Markup related obsolete warnings in Research and Anomaly related systems --- .../UI/DiskConsoleBoundUserInterface.cs | 1 - .../UI/ResearchClientBoundUserInterface.cs | 1 - .../UI/ResearchConsoleBoundUserInterface.cs | 1 - .../Research/UI/ResearchConsoleMenu.xaml.cs | 4 +- .../Research/UI/TechnologyCardControl.xaml.cs | 2 +- .../Anomaly/AnomalySystem.Scanner.cs | 40 +++++++++---------- 6 files changed, 23 insertions(+), 26 deletions(-) diff --git a/Content.Client/Research/UI/DiskConsoleBoundUserInterface.cs b/Content.Client/Research/UI/DiskConsoleBoundUserInterface.cs index da008ca04c93..c14a8c5bd05c 100644 --- a/Content.Client/Research/UI/DiskConsoleBoundUserInterface.cs +++ b/Content.Client/Research/UI/DiskConsoleBoundUserInterface.cs @@ -1,6 +1,5 @@ using Content.Shared.Research; using Content.Shared.Research.Components; -using Robust.Client.GameObjects; namespace Content.Client.Research.UI { diff --git a/Content.Client/Research/UI/ResearchClientBoundUserInterface.cs b/Content.Client/Research/UI/ResearchClientBoundUserInterface.cs index 07dd35a0056c..a0a2b58e8892 100644 --- a/Content.Client/Research/UI/ResearchClientBoundUserInterface.cs +++ b/Content.Client/Research/UI/ResearchClientBoundUserInterface.cs @@ -1,5 +1,4 @@ using Content.Shared.Research.Components; -using Robust.Client.GameObjects; namespace Content.Client.Research.UI { diff --git a/Content.Client/Research/UI/ResearchConsoleBoundUserInterface.cs b/Content.Client/Research/UI/ResearchConsoleBoundUserInterface.cs index f29e66baaeb4..2a9782045b86 100644 --- a/Content.Client/Research/UI/ResearchConsoleBoundUserInterface.cs +++ b/Content.Client/Research/UI/ResearchConsoleBoundUserInterface.cs @@ -1,6 +1,5 @@ using Content.Shared.Research.Components; using JetBrains.Annotations; -using Robust.Client.GameObjects; namespace Content.Client.Research.UI; diff --git a/Content.Client/Research/UI/ResearchConsoleMenu.xaml.cs b/Content.Client/Research/UI/ResearchConsoleMenu.xaml.cs index b364b8331247..77ebe6740c54 100644 --- a/Content.Client/Research/UI/ResearchConsoleMenu.xaml.cs +++ b/Content.Client/Research/UI/ResearchConsoleMenu.xaml.cs @@ -81,7 +81,7 @@ public void UpdatePanels(ResearchConsoleBoundInterfaceState state) public void UpdateInformationPanel(ResearchConsoleBoundInterfaceState state) { var amountMsg = new FormattedMessage(); - amountMsg.AddMarkup(Loc.GetString("research-console-menu-research-points-text", + amountMsg.AddMarkupOrThrow(Loc.GetString("research-console-menu-research-points-text", ("points", state.Points))); ResearchAmountLabel.SetMessage(amountMsg); @@ -98,7 +98,7 @@ public void UpdateInformationPanel(ResearchConsoleBoundInterfaceState state) } var msg = new FormattedMessage(); - msg.AddMarkup(Loc.GetString("research-console-menu-main-discipline", + msg.AddMarkupOrThrow(Loc.GetString("research-console-menu-main-discipline", ("name", disciplineText), ("color", disciplineColor))); MainDisciplineLabel.SetMessage(msg); diff --git a/Content.Client/Research/UI/TechnologyCardControl.xaml.cs b/Content.Client/Research/UI/TechnologyCardControl.xaml.cs index f547457203e4..292ed0ebe0bf 100644 --- a/Content.Client/Research/UI/TechnologyCardControl.xaml.cs +++ b/Content.Client/Research/UI/TechnologyCardControl.xaml.cs @@ -23,7 +23,7 @@ public TechnologyCardControl(TechnologyPrototype technology, IPrototypeManager p DisciplineTexture.Texture = spriteSys.Frame0(discipline.Icon); TechnologyNameLabel.Text = Loc.GetString(technology.Name); var message = new FormattedMessage(); - message.AddMarkup(Loc.GetString("research-console-tier-discipline-info", + message.AddMarkupOrThrow(Loc.GetString("research-console-tier-discipline-info", ("tier", technology.Tier), ("color", discipline.Color), ("discipline", Loc.GetString(discipline.Name)))); TierLabel.SetMessage(message); UnlocksLabel.SetMessage(description); diff --git a/Content.Server/Anomaly/AnomalySystem.Scanner.cs b/Content.Server/Anomaly/AnomalySystem.Scanner.cs index 39c0d08b55e1..65d79de60c68 100644 --- a/Content.Server/Anomaly/AnomalySystem.Scanner.cs +++ b/Content.Server/Anomaly/AnomalySystem.Scanner.cs @@ -141,7 +141,7 @@ public FormattedMessage GetScannerMessage(AnomalyScannerComponent component) var msg = new FormattedMessage(); if (component.ScannedAnomaly is not { } anomaly || !TryComp(anomaly, out var anomalyComp)) { - msg.AddMarkup(Loc.GetString("anomaly-scanner-no-anomaly")); + msg.AddMarkupOrThrow(Loc.GetString("anomaly-scanner-no-anomaly")); return msg; } @@ -149,14 +149,14 @@ public FormattedMessage GetScannerMessage(AnomalyScannerComponent component) //Severity if (secret != null && secret.Secret.Contains(AnomalySecretData.Severity)) - msg.AddMarkup(Loc.GetString("anomaly-scanner-severity-percentage-unknown")); + msg.AddMarkupOrThrow(Loc.GetString("anomaly-scanner-severity-percentage-unknown")); else - msg.AddMarkup(Loc.GetString("anomaly-scanner-severity-percentage", ("percent", anomalyComp.Severity.ToString("P")))); + msg.AddMarkupOrThrow(Loc.GetString("anomaly-scanner-severity-percentage", ("percent", anomalyComp.Severity.ToString("P")))); msg.PushNewline(); //Stability if (secret != null && secret.Secret.Contains(AnomalySecretData.Stability)) - msg.AddMarkup(Loc.GetString("anomaly-scanner-stability-unknown")); + msg.AddMarkupOrThrow(Loc.GetString("anomaly-scanner-stability-unknown")); else { string stateLoc; @@ -166,54 +166,54 @@ public FormattedMessage GetScannerMessage(AnomalyScannerComponent component) stateLoc = Loc.GetString("anomaly-scanner-stability-high"); else stateLoc = Loc.GetString("anomaly-scanner-stability-medium"); - msg.AddMarkup(stateLoc); + msg.AddMarkupOrThrow(stateLoc); } msg.PushNewline(); //Point output if (secret != null && secret.Secret.Contains(AnomalySecretData.OutputPoint)) - msg.AddMarkup(Loc.GetString("anomaly-scanner-point-output-unknown")); + msg.AddMarkupOrThrow(Loc.GetString("anomaly-scanner-point-output-unknown")); else - msg.AddMarkup(Loc.GetString("anomaly-scanner-point-output", ("point", GetAnomalyPointValue(anomaly, anomalyComp)))); + msg.AddMarkupOrThrow(Loc.GetString("anomaly-scanner-point-output", ("point", GetAnomalyPointValue(anomaly, anomalyComp)))); msg.PushNewline(); msg.PushNewline(); //Particles title - msg.AddMarkup(Loc.GetString("anomaly-scanner-particle-readout")); + msg.AddMarkupOrThrow(Loc.GetString("anomaly-scanner-particle-readout")); msg.PushNewline(); //Danger if (secret != null && secret.Secret.Contains(AnomalySecretData.ParticleDanger)) - msg.AddMarkup(Loc.GetString("anomaly-scanner-particle-danger-unknown")); + msg.AddMarkupOrThrow(Loc.GetString("anomaly-scanner-particle-danger-unknown")); else - msg.AddMarkup(Loc.GetString("anomaly-scanner-particle-danger", ("type", GetParticleLocale(anomalyComp.SeverityParticleType)))); + msg.AddMarkupOrThrow(Loc.GetString("anomaly-scanner-particle-danger", ("type", GetParticleLocale(anomalyComp.SeverityParticleType)))); msg.PushNewline(); //Unstable if (secret != null && secret.Secret.Contains(AnomalySecretData.ParticleUnstable)) - msg.AddMarkup(Loc.GetString("anomaly-scanner-particle-unstable-unknown")); + msg.AddMarkupOrThrow(Loc.GetString("anomaly-scanner-particle-unstable-unknown")); else - msg.AddMarkup(Loc.GetString("anomaly-scanner-particle-unstable", ("type", GetParticleLocale(anomalyComp.DestabilizingParticleType)))); + msg.AddMarkupOrThrow(Loc.GetString("anomaly-scanner-particle-unstable", ("type", GetParticleLocale(anomalyComp.DestabilizingParticleType)))); msg.PushNewline(); //Containment if (secret != null && secret.Secret.Contains(AnomalySecretData.ParticleContainment)) - msg.AddMarkup(Loc.GetString("anomaly-scanner-particle-containment-unknown")); + msg.AddMarkupOrThrow(Loc.GetString("anomaly-scanner-particle-containment-unknown")); else - msg.AddMarkup(Loc.GetString("anomaly-scanner-particle-containment", ("type", GetParticleLocale(anomalyComp.WeakeningParticleType)))); + msg.AddMarkupOrThrow(Loc.GetString("anomaly-scanner-particle-containment", ("type", GetParticleLocale(anomalyComp.WeakeningParticleType)))); msg.PushNewline(); //Transformation if (secret != null && secret.Secret.Contains(AnomalySecretData.ParticleTransformation)) - msg.AddMarkup(Loc.GetString("anomaly-scanner-particle-transformation-unknown")); + msg.AddMarkupOrThrow(Loc.GetString("anomaly-scanner-particle-transformation-unknown")); else - msg.AddMarkup(Loc.GetString("anomaly-scanner-particle-transformation", ("type", GetParticleLocale(anomalyComp.TransformationParticleType)))); + msg.AddMarkupOrThrow(Loc.GetString("anomaly-scanner-particle-transformation", ("type", GetParticleLocale(anomalyComp.TransformationParticleType)))); //Behavior msg.PushNewline(); msg.PushNewline(); - msg.AddMarkup(Loc.GetString("anomaly-behavior-title")); + msg.AddMarkupOrThrow(Loc.GetString("anomaly-behavior-title")); msg.PushNewline(); if (secret != null && secret.Secret.Contains(AnomalySecretData.Behavior)) @@ -224,14 +224,14 @@ public FormattedMessage GetScannerMessage(AnomalyScannerComponent component) { var behavior = _prototype.Index(anomalyComp.CurrentBehavior.Value); - msg.AddMarkup("- " + Loc.GetString(behavior.Description)); + msg.AddMarkupOrThrow("- " + Loc.GetString(behavior.Description)); msg.PushNewline(); var mod = Math.Floor((behavior.EarnPointModifier) * 100); - msg.AddMarkup("- " + Loc.GetString("anomaly-behavior-point", ("mod", mod))); + msg.AddMarkupOrThrow("- " + Loc.GetString("anomaly-behavior-point", ("mod", mod))); } else { - msg.AddMarkup(Loc.GetString("anomaly-behavior-balanced")); + msg.AddMarkupOrThrow(Loc.GetString("anomaly-behavior-balanced")); } }