Replaced some AddMarkups with AddMarkupOrThrow (#30632)
* First commit * Silly me * bruh
This commit is contained in:
@@ -31,7 +31,7 @@ public sealed partial class AnomalyScannerMenu : FancyWindow
|
|||||||
msg.PushNewline();
|
msg.PushNewline();
|
||||||
var time = NextPulseTime.Value - _timing.CurTime;
|
var time = NextPulseTime.Value - _timing.CurTime;
|
||||||
var timestring = $"{time.Minutes:00}:{time.Seconds:00}";
|
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());
|
TextDisplay.SetMarkup(msg.ToMarkup());
|
||||||
|
|||||||
@@ -217,7 +217,7 @@ public sealed partial class AnomalySystem
|
|||||||
msg.PushNewline();
|
msg.PushNewline();
|
||||||
|
|
||||||
if (secret != null && secret.Secret.Contains(AnomalySecretData.Behavior))
|
if (secret != null && secret.Secret.Contains(AnomalySecretData.Behavior))
|
||||||
msg.AddMarkup(Loc.GetString("anomaly-behavior-unknown"));
|
msg.AddMarkupOrThrow(Loc.GetString("anomaly-behavior-unknown"));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (anomalyComp.CurrentBehavior != null)
|
if (anomalyComp.CurrentBehavior != null)
|
||||||
|
|||||||
@@ -255,20 +255,20 @@ public sealed class BloodstreamSystem : EntitySystem
|
|||||||
if (ent.Comp.BleedAmount > ent.Comp.MaxBleedAmount / 2)
|
if (ent.Comp.BleedAmount > ent.Comp.MaxBleedAmount / 2)
|
||||||
{
|
{
|
||||||
args.Message.PushNewline();
|
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.
|
// Shows bleeding message when bleeding, but less than profusely.
|
||||||
else if (ent.Comp.BleedAmount > 0)
|
else if (ent.Comp.BleedAmount > 0)
|
||||||
{
|
{
|
||||||
args.Message.PushNewline();
|
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 the mob's blood level is below the damage threshhold, the pale message is added.
|
||||||
if (GetBloodLevelPercentage(ent, ent) < ent.Comp.BloodlossThreshold)
|
if (GetBloodLevelPercentage(ent, ent) < ent.Comp.BloodlossThreshold)
|
||||||
{
|
{
|
||||||
args.Message.PushNewline();
|
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)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -53,15 +53,14 @@ public abstract class SharedArmorSystem : EntitySystem
|
|||||||
private FormattedMessage GetArmorExamine(DamageModifierSet armorModifiers)
|
private FormattedMessage GetArmorExamine(DamageModifierSet armorModifiers)
|
||||||
{
|
{
|
||||||
var msg = new FormattedMessage();
|
var msg = new FormattedMessage();
|
||||||
|
msg.AddMarkupOrThrow(Loc.GetString("armor-examine"));
|
||||||
msg.AddMarkup(Loc.GetString("armor-examine"));
|
|
||||||
|
|
||||||
foreach (var coefficientArmor in armorModifiers.Coefficients)
|
foreach (var coefficientArmor in armorModifiers.Coefficients)
|
||||||
{
|
{
|
||||||
msg.PushNewline();
|
msg.PushNewline();
|
||||||
|
|
||||||
var armorType = Loc.GetString("armor-damage-type-" + coefficientArmor.Key.ToLower());
|
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),
|
("type", armorType),
|
||||||
("value", MathF.Round((1f - coefficientArmor.Value) * 100, 1))
|
("value", MathF.Round((1f - coefficientArmor.Value) * 100, 1))
|
||||||
));
|
));
|
||||||
@@ -72,7 +71,7 @@ public abstract class SharedArmorSystem : EntitySystem
|
|||||||
msg.PushNewline();
|
msg.PushNewline();
|
||||||
|
|
||||||
var armorType = Loc.GetString("armor-damage-type-" + flatArmor.Key.ToLower());
|
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),
|
("type", armorType),
|
||||||
("value", flatArmor.Value)
|
("value", flatArmor.Value)
|
||||||
));
|
));
|
||||||
|
|||||||
@@ -320,8 +320,7 @@ public sealed partial class BlockingSystem : EntitySystem
|
|||||||
var modifier = component.IsBlocking ? component.ActiveBlockDamageModifier : component.PassiveBlockDamageModifer;
|
var modifier = component.IsBlocking ? component.ActiveBlockDamageModifier : component.PassiveBlockDamageModifer;
|
||||||
|
|
||||||
var msg = new FormattedMessage();
|
var msg = new FormattedMessage();
|
||||||
|
msg.AddMarkupOrThrow(Loc.GetString("blocking-fraction", ("value", MathF.Round(fraction * 100, 1))));
|
||||||
msg.AddMarkup(Loc.GetString("blocking-fraction", ("value", MathF.Round(fraction * 100, 1))));
|
|
||||||
|
|
||||||
AppendCoefficients(modifier, msg);
|
AppendCoefficients(modifier, msg);
|
||||||
|
|
||||||
@@ -337,7 +336,7 @@ public sealed partial class BlockingSystem : EntitySystem
|
|||||||
foreach (var coefficient in modifiers.Coefficients)
|
foreach (var coefficient in modifiers.Coefficients)
|
||||||
{
|
{
|
||||||
msg.PushNewline();
|
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),
|
("type", coefficient.Key),
|
||||||
("value", MathF.Round(coefficient.Value * 100, 1))
|
("value", MathF.Round(coefficient.Value * 100, 1))
|
||||||
));
|
));
|
||||||
@@ -346,7 +345,7 @@ public sealed partial class BlockingSystem : EntitySystem
|
|||||||
foreach (var flat in modifiers.FlatReduction)
|
foreach (var flat in modifiers.FlatReduction)
|
||||||
{
|
{
|
||||||
msg.PushNewline();
|
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),
|
("type", flat.Key),
|
||||||
("value", flat.Value)
|
("value", flat.Value)
|
||||||
));
|
));
|
||||||
|
|||||||
@@ -903,11 +903,11 @@ public abstract partial class SharedSolutionContainerSystem : EntitySystem
|
|||||||
|
|
||||||
if (solution.Volume == 0)
|
if (solution.Volume == 0)
|
||||||
{
|
{
|
||||||
msg.AddMarkup(Loc.GetString("scannable-solution-empty-container"));
|
msg.AddMarkupOrThrow(Loc.GetString("scannable-solution-empty-container"));
|
||||||
return msg;
|
return msg;
|
||||||
}
|
}
|
||||||
|
|
||||||
msg.AddMarkup(Loc.GetString("scannable-solution-main-text"));
|
msg.AddMarkupOrThrow(Loc.GetString("scannable-solution-main-text"));
|
||||||
|
|
||||||
var reagentPrototypes = solution.GetReagentPrototypes(PrototypeManager);
|
var reagentPrototypes = solution.GetReagentPrototypes(PrototypeManager);
|
||||||
|
|
||||||
@@ -919,14 +919,14 @@ public abstract partial class SharedSolutionContainerSystem : EntitySystem
|
|||||||
foreach (var (proto, quantity) in sortedReagentPrototypes)
|
foreach (var (proto, quantity) in sortedReagentPrototypes)
|
||||||
{
|
{
|
||||||
msg.PushNewline();
|
msg.PushNewline();
|
||||||
msg.AddMarkup(Loc.GetString("scannable-solution-chemical"
|
msg.AddMarkupOrThrow(Loc.GetString("scannable-solution-chemical"
|
||||||
, ("type", proto.LocalizedName)
|
, ("type", proto.LocalizedName)
|
||||||
, ("color", proto.SubstanceColor.ToHexNoAlpha())
|
, ("color", proto.SubstanceColor.ToHexNoAlpha())
|
||||||
, ("amount", quantity)));
|
, ("amount", quantity)));
|
||||||
}
|
}
|
||||||
|
|
||||||
msg.PushNewline();
|
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;
|
return msg;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,11 +57,11 @@ public sealed class DamageExamineSystem : EntitySystem
|
|||||||
|
|
||||||
if (string.IsNullOrEmpty(type))
|
if (string.IsNullOrEmpty(type))
|
||||||
{
|
{
|
||||||
msg.AddMarkup(Loc.GetString("damage-examine"));
|
msg.AddMarkupOrThrow(Loc.GetString("damage-examine"));
|
||||||
}
|
}
|
||||||
else
|
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)
|
foreach (var damage in damageSpecifier.DamageDict)
|
||||||
@@ -69,7 +69,7 @@ public sealed class DamageExamineSystem : EntitySystem
|
|||||||
if (damage.Value != FixedPoint2.Zero)
|
if (damage.Value != FixedPoint2.Zero)
|
||||||
{
|
{
|
||||||
msg.PushNewline();
|
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)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user