]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Replaced some AddMarkups with AddMarkupOrThrow (#30632)
authorbeck-thompson <107373427+beck-thompson@users.noreply.github.com>
Sun, 11 Aug 2024 03:06:33 +0000 (20:06 -0700)
committerGitHub <noreply@github.com>
Sun, 11 Aug 2024 03:06:33 +0000 (13:06 +1000)
* First commit

* Silly me

* bruh

Content.Client/Anomaly/Ui/AnomalyScannerMenu.xaml.cs
Content.Server/Anomaly/AnomalySystem.Scanner.cs
Content.Server/Body/Systems/BloodstreamSystem.cs
Content.Shared/Armor/SharedArmorSystem.cs
Content.Shared/Blocking/BlockingSystem.cs
Content.Shared/Chemistry/EntitySystems/SharedSolutionContainerSystem.cs
Content.Shared/Damage/Systems/DamageExamineSystem.cs

index 14726952d170067bed545241fed2a86028139d9e..c012edb89e249efe16801ad51f37a3ddb771b23f 100644 (file)
@@ -31,7 +31,7 @@ public sealed partial class AnomalyScannerMenu : FancyWindow
             msg.PushNewline();
             var time = NextPulseTime.Value - _timing.CurTime;
             var timestring = $"{time.Minutes:00}:{time.Seconds:00}";
-            msg.AddMarkup(Loc.GetString("anomaly-scanner-pulse-timer", ("time", timestring)));
+            msg.AddMarkupOrThrow(Loc.GetString("anomaly-scanner-pulse-timer", ("time", timestring)));
         }
 
         TextDisplay.SetMarkup(msg.ToMarkup());
index 65d79de60c6845d5faf9be74b7bd70b78df3aeca..9d81878cd8f2e2dedbe477b0d0eb55da333dbf90 100644 (file)
@@ -217,7 +217,7 @@ public sealed partial class AnomalySystem
         msg.PushNewline();
 
         if (secret != null && secret.Secret.Contains(AnomalySecretData.Behavior))
-            msg.AddMarkup(Loc.GetString("anomaly-behavior-unknown"));
+            msg.AddMarkupOrThrow(Loc.GetString("anomaly-behavior-unknown"));
         else
         {
             if (anomalyComp.CurrentBehavior != null)
index 9647634a9ebc396840106b543bf125ca9d2da622..67246825fe5ceb5b27391fa4dbcfdd2d6c6e8a78 100644 (file)
@@ -255,20 +255,20 @@ public sealed class BloodstreamSystem : EntitySystem
         if (ent.Comp.BleedAmount > ent.Comp.MaxBleedAmount / 2)
         {
             args.Message.PushNewline();
-            args.Message.AddMarkup(Loc.GetString("bloodstream-component-profusely-bleeding", ("target", ent.Owner)));
+            args.Message.AddMarkupOrThrow(Loc.GetString("bloodstream-component-profusely-bleeding", ("target", ent.Owner)));
         }
         // Shows bleeding message when bleeding, but less than profusely.
         else if (ent.Comp.BleedAmount > 0)
         {
             args.Message.PushNewline();
-            args.Message.AddMarkup(Loc.GetString("bloodstream-component-bleeding", ("target", ent.Owner)));
+            args.Message.AddMarkupOrThrow(Loc.GetString("bloodstream-component-bleeding", ("target", ent.Owner)));
         }
 
         // If the mob's blood level is below the damage threshhold, the pale message is added.
         if (GetBloodLevelPercentage(ent, ent) < ent.Comp.BloodlossThreshold)
         {
             args.Message.PushNewline();
-            args.Message.AddMarkup(Loc.GetString("bloodstream-component-looks-pale", ("target", ent.Owner)));
+            args.Message.AddMarkupOrThrow(Loc.GetString("bloodstream-component-looks-pale", ("target", ent.Owner)));
         }
     }
 
index 73cb6da2c2700bc0d2dc1d199c5895cbbc501949..010ee5e65b0e0657715abf735a5ba19fe6e2bf58 100644 (file)
@@ -53,15 +53,14 @@ public abstract class SharedArmorSystem : EntitySystem
     private FormattedMessage GetArmorExamine(DamageModifierSet armorModifiers)
     {
         var msg = new FormattedMessage();
-
-        msg.AddMarkup(Loc.GetString("armor-examine"));
+        msg.AddMarkupOrThrow(Loc.GetString("armor-examine"));
 
         foreach (var coefficientArmor in armorModifiers.Coefficients)
         {
             msg.PushNewline();
 
             var armorType = Loc.GetString("armor-damage-type-" + coefficientArmor.Key.ToLower());
-            msg.AddMarkup(Loc.GetString("armor-coefficient-value",
+            msg.AddMarkupOrThrow(Loc.GetString("armor-coefficient-value",
                 ("type", armorType),
                 ("value", MathF.Round((1f - coefficientArmor.Value) * 100, 1))
             ));
@@ -72,7 +71,7 @@ public abstract class SharedArmorSystem : EntitySystem
             msg.PushNewline();
 
             var armorType = Loc.GetString("armor-damage-type-" + flatArmor.Key.ToLower());
-            msg.AddMarkup(Loc.GetString("armor-reduction-value",
+            msg.AddMarkupOrThrow(Loc.GetString("armor-reduction-value",
                 ("type", armorType),
                 ("value", flatArmor.Value)
             ));
index 3e1ff4284c713feb834bbe88b7f10086e0106b33..594d1baf6c61049254a404575f57deb9053a135c 100644 (file)
@@ -320,8 +320,7 @@ public sealed partial class BlockingSystem : EntitySystem
         var modifier = component.IsBlocking ? component.ActiveBlockDamageModifier : component.PassiveBlockDamageModifer;
 
         var msg = new FormattedMessage();
-
-        msg.AddMarkup(Loc.GetString("blocking-fraction", ("value", MathF.Round(fraction * 100, 1))));
+        msg.AddMarkupOrThrow(Loc.GetString("blocking-fraction", ("value", MathF.Round(fraction * 100, 1))));
 
         AppendCoefficients(modifier, msg);
 
@@ -337,7 +336,7 @@ public sealed partial class BlockingSystem : EntitySystem
         foreach (var coefficient in modifiers.Coefficients)
         {
             msg.PushNewline();
-            msg.AddMarkup(Robust.Shared.Localization.Loc.GetString("blocking-coefficient-value",
+            msg.AddMarkupOrThrow(Robust.Shared.Localization.Loc.GetString("blocking-coefficient-value",
                 ("type", coefficient.Key),
                 ("value", MathF.Round(coefficient.Value * 100, 1))
             ));
@@ -346,7 +345,7 @@ public sealed partial class BlockingSystem : EntitySystem
         foreach (var flat in modifiers.FlatReduction)
         {
             msg.PushNewline();
-            msg.AddMarkup(Robust.Shared.Localization.Loc.GetString("blocking-reduction-value",
+            msg.AddMarkupOrThrow(Robust.Shared.Localization.Loc.GetString("blocking-reduction-value",
                 ("type", flat.Key),
                 ("value", flat.Value)
             ));
index ad9cd01fbf2be12775b18065416dfcd9fc8e0092..9e5e24b3e48f735b0f029f36eb1ddc61b0ea5549 100644 (file)
@@ -903,11 +903,11 @@ public abstract partial class SharedSolutionContainerSystem : EntitySystem
 
         if (solution.Volume == 0)
         {
-            msg.AddMarkup(Loc.GetString("scannable-solution-empty-container"));
+            msg.AddMarkupOrThrow(Loc.GetString("scannable-solution-empty-container"));
             return msg;
         }
 
-        msg.AddMarkup(Loc.GetString("scannable-solution-main-text"));
+        msg.AddMarkupOrThrow(Loc.GetString("scannable-solution-main-text"));
 
         var reagentPrototypes = solution.GetReagentPrototypes(PrototypeManager);
 
@@ -919,14 +919,14 @@ public abstract partial class SharedSolutionContainerSystem : EntitySystem
         foreach (var (proto, quantity) in sortedReagentPrototypes)
         {
             msg.PushNewline();
-            msg.AddMarkup(Loc.GetString("scannable-solution-chemical"
+            msg.AddMarkupOrThrow(Loc.GetString("scannable-solution-chemical"
                 , ("type", proto.LocalizedName)
                 , ("color", proto.SubstanceColor.ToHexNoAlpha())
                 , ("amount", quantity)));
         }
 
         msg.PushNewline();
-        msg.AddMarkup(Loc.GetString("scannable-solution-temperature", ("temperature", Math.Round(solution.Temperature))));
+        msg.AddMarkupOrThrow(Loc.GetString("scannable-solution-temperature", ("temperature", Math.Round(solution.Temperature))));
 
         return msg;
     }
index fd1f191334fd612ac4d44d9c583d294e9ddffaa2..53436a920aa56648e7649c80c55a5e19dd2c6544 100644 (file)
@@ -57,11 +57,11 @@ public sealed class DamageExamineSystem : EntitySystem
 
         if (string.IsNullOrEmpty(type))
         {
-            msg.AddMarkup(Loc.GetString("damage-examine"));
+            msg.AddMarkupOrThrow(Loc.GetString("damage-examine"));
         }
         else
         {
-            msg.AddMarkup(Loc.GetString("damage-examine-type", ("type", type)));
+            msg.AddMarkupOrThrow(Loc.GetString("damage-examine-type", ("type", type)));
         }
 
         foreach (var damage in damageSpecifier.DamageDict)
@@ -69,7 +69,7 @@ public sealed class DamageExamineSystem : EntitySystem
             if (damage.Value != FixedPoint2.Zero)
             {
                 msg.PushNewline();
-                msg.AddMarkup(Loc.GetString("damage-value", ("type", _prototype.Index<DamageTypePrototype>(damage.Key).LocalizedName), ("amount", damage.Value)));
+                msg.AddMarkupOrThrow(Loc.GetString("damage-value", ("type", _prototype.Index<DamageTypePrototype>(damage.Key).LocalizedName), ("amount", damage.Value)));
             }
         }