Fix NanoTask and bounty print formatting (#42030)

Markup text was erroneously being appended via AddText().
This commit is contained in:
Pieter-Jan Briers
2025-12-24 02:56:31 +01:00
committed by GitHub
parent 92ee561f4b
commit 9511285508
2 changed files with 5 additions and 5 deletions

View File

@@ -119,9 +119,9 @@ public sealed partial class CargoSystem
label.Id = bounty.Id;
label.AssociatedStationId = stationId;
var msg = new FormattedMessage();
msg.AddText(Loc.GetString("bounty-manifest-header", ("id", bounty.Id)));
msg.AddMarkupOrThrow(Loc.GetString("bounty-manifest-header", ("id", bounty.Id)));
msg.PushNewline();
msg.AddText(Loc.GetString("bounty-manifest-list-start"));
msg.AddMarkupOrThrow(Loc.GetString("bounty-manifest-list-start"));
msg.PushNewline();
foreach (var entry in prototype.Entries)
{

View File

@@ -77,11 +77,11 @@ public sealed class NanoTaskCartridgeSystem : SharedNanoTaskCartridgeSystem
printed.Task = item;
var msg = new FormattedMessage();
msg.AddText(Loc.GetString("nano-task-printed-description", ("description", item.Description)));
msg.AddMarkupOrThrow(Loc.GetString("nano-task-printed-description", ("description", FormattedMessage.EscapeText(item.Description))));
msg.PushNewline();
msg.AddText(Loc.GetString("nano-task-printed-requester", ("requester", item.TaskIsFor)));
msg.AddMarkupOrThrow(Loc.GetString("nano-task-printed-requester", ("requester", FormattedMessage.EscapeText(item.TaskIsFor))));
msg.PushNewline();
msg.AddText(item.Priority switch {
msg.AddMarkupOrThrow(item.Priority switch {
NanoTaskPriority.High => Loc.GetString("nano-task-printed-high-priority"),
NanoTaskPriority.Medium => Loc.GetString("nano-task-printed-medium-priority"),
NanoTaskPriority.Low => Loc.GetString("nano-task-printed-low-priority"),