Everything: Rich text redux (#5625)
* lord save me * UI/ChatBox: Use the new `defStyle` param for `RenderMarkup` The previous iteration didn't work because `AddMessage` can't inherit its color from the PushColor (since we're not doing actual tag stacks anymore). * rebase touchup
This commit is contained in:
@@ -4,6 +4,7 @@ using Robust.Client.UserInterface.Controls;
|
|||||||
using Robust.Shared.IoC;
|
using Robust.Shared.IoC;
|
||||||
using Robust.Shared.Timing;
|
using Robust.Shared.Timing;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
using Robust.Shared.Utility.Markup;
|
||||||
using static Robust.Client.UserInterface.Controls.BoxContainer;
|
using static Robust.Client.UserInterface.Controls.BoxContainer;
|
||||||
|
|
||||||
namespace Content.Client.Actions.UI
|
namespace Content.Client.Actions.UI
|
||||||
@@ -68,7 +69,7 @@ namespace Content.Client.Actions.UI
|
|||||||
MaxWidth = TooltipTextMaxWidth,
|
MaxWidth = TooltipTextMaxWidth,
|
||||||
StyleClasses = {StyleNano.StyleClassTooltipActionRequirements}
|
StyleClasses = {StyleNano.StyleClassTooltipActionRequirements}
|
||||||
};
|
};
|
||||||
requiresLabel.SetMessage(FormattedMessage.FromMarkup("[color=#635c5c]" +
|
requiresLabel.SetMessage(Basic.RenderMarkup("[color=#635c5c]" +
|
||||||
requires +
|
requires +
|
||||||
"[/color]"));
|
"[/color]"));
|
||||||
vbox.AddChild(requiresLabel);
|
vbox.AddChild(requiresLabel);
|
||||||
@@ -88,7 +89,7 @@ namespace Content.Client.Actions.UI
|
|||||||
if (timeLeft > TimeSpan.Zero)
|
if (timeLeft > TimeSpan.Zero)
|
||||||
{
|
{
|
||||||
var duration = Cooldown.Value.End - Cooldown.Value.Start;
|
var duration = Cooldown.Value.End - Cooldown.Value.Start;
|
||||||
_cooldownLabel.SetMessage(FormattedMessage.FromMarkup(
|
_cooldownLabel.SetMessage(Basic.RenderMarkup(
|
||||||
$"[color=#a10505]{duration.Seconds} sec cooldown ({timeLeft.Seconds + 1} sec remaining)[/color]"));
|
$"[color=#a10505]{duration.Seconds} sec cooldown ({timeLeft.Seconds + 1} sec remaining)[/color]"));
|
||||||
_cooldownLabel.Visible = true;
|
_cooldownLabel.Visible = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ using Robust.Shared.Localization;
|
|||||||
using Robust.Shared.Maths;
|
using Robust.Shared.Maths;
|
||||||
using Robust.Shared.Timing;
|
using Robust.Shared.Timing;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
using Robust.Shared.Utility.Markup;
|
||||||
using static Robust.Client.UserInterface.Controls.BoxContainer;
|
using static Robust.Client.UserInterface.Controls.BoxContainer;
|
||||||
|
|
||||||
namespace Content.Client.Actions.UI
|
namespace Content.Client.Actions.UI
|
||||||
@@ -478,10 +479,10 @@ namespace Content.Client.Actions.UI
|
|||||||
|
|
||||||
private FormattedMessage SlotNumberLabel()
|
private FormattedMessage SlotNumberLabel()
|
||||||
{
|
{
|
||||||
if (SlotNumber > 10) return FormattedMessage.FromMarkup("");
|
if (SlotNumber > 10) return FormattedMessage.Empty;
|
||||||
var number = Loc.GetString(SlotNumber == 10 ? "0" : SlotNumber.ToString());
|
var number = Loc.GetString(SlotNumber == 10 ? "0" : SlotNumber.ToString());
|
||||||
var color = (ActionEnabled || !HasAssignment) ? EnabledColor : DisabledColor;
|
var color = (ActionEnabled || !HasAssignment) ? EnabledColor : DisabledColor;
|
||||||
return FormattedMessage.FromMarkup("[color=" + color + "]" + number + "[/color]");
|
return Basic.RenderMarkup("[color=" + color + "]" + number + "[/color]");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateIcons()
|
private void UpdateIcons()
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ using Robust.Shared.Maths;
|
|||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
using Robust.Shared.Network;
|
using Robust.Shared.Network;
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
|
using Robust.Shared.Utility.Markup;
|
||||||
using YamlDotNet.RepresentationModel;
|
using YamlDotNet.RepresentationModel;
|
||||||
|
|
||||||
namespace Content.Client.Administration.UI
|
namespace Content.Client.Administration.UI
|
||||||
@@ -58,9 +59,7 @@ namespace Content.Client.Administration.UI
|
|||||||
|
|
||||||
public void ReceiveLine(string text)
|
public void ReceiveLine(string text)
|
||||||
{
|
{
|
||||||
var formatted = new FormattedMessage(1);
|
TextOutput.AddMessage(Basic.RenderMarkup(text));
|
||||||
formatted.AddMarkup(text);
|
|
||||||
TextOutput.AddMessage(formatted);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ using Robust.Shared.IoC;
|
|||||||
using Robust.Shared.Localization;
|
using Robust.Shared.Localization;
|
||||||
using Robust.Shared.Maths;
|
using Robust.Shared.Maths;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
using Robust.Shared.Utility.Markup;
|
||||||
using static Content.Client.Changelog.ChangelogManager;
|
using static Content.Client.Changelog.ChangelogManager;
|
||||||
using static Robust.Client.UserInterface.Controls.BoxContainer;
|
using static Robust.Client.UserInterface.Controls.BoxContainer;
|
||||||
|
|
||||||
@@ -146,13 +147,13 @@ namespace Content.Client.Changelog
|
|||||||
Margin = new Thickness(6, 0, 0, 0),
|
Margin = new Thickness(6, 0, 0, 0),
|
||||||
};
|
};
|
||||||
authorLabel.SetMessage(
|
authorLabel.SetMessage(
|
||||||
FormattedMessage.FromMarkup(Loc.GetString("changelog-author-changed", ("author", author))));
|
Basic.RenderMarkup(Loc.GetString("changelog-author-changed", ("author", author))));
|
||||||
ChangelogBody.AddChild(authorLabel);
|
ChangelogBody.AddChild(authorLabel);
|
||||||
|
|
||||||
foreach (var change in groupedEntry.SelectMany(c => c.Changes))
|
foreach (var change in groupedEntry.SelectMany(c => c.Changes))
|
||||||
{
|
{
|
||||||
var text = new RichTextLabel();
|
var text = new RichTextLabel();
|
||||||
text.SetMessage(FormattedMessage.FromMarkup(change.Message));
|
text.SetMessage(Basic.RenderMarkup(change.Message));
|
||||||
ChangelogBody.AddChild(new BoxContainer
|
ChangelogBody.AddChild(new BoxContainer
|
||||||
{
|
{
|
||||||
Orientation = LayoutOrientation.Horizontal,
|
Orientation = LayoutOrientation.Horizontal,
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ using Robust.Shared.Log;
|
|||||||
using Robust.Shared.Network;
|
using Robust.Shared.Network;
|
||||||
using Robust.Shared.Timing;
|
using Robust.Shared.Timing;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
using Robust.Shared.Utility.Markup;
|
||||||
|
|
||||||
namespace Content.Client.Chat.Managers
|
namespace Content.Client.Chat.Managers
|
||||||
{
|
{
|
||||||
@@ -420,7 +421,7 @@ namespace Content.Client.Chat.Managers
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var messages = SplitMessage(FormattedMessage.RemoveMarkup(msg.Message));
|
var messages = SplitMessage(Basic.RenderMarkup(msg.Message).ToString());
|
||||||
|
|
||||||
foreach (var message in messages)
|
foreach (var message in messages)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ using Robust.Shared.Localization;
|
|||||||
using Robust.Shared.Log;
|
using Robust.Shared.Log;
|
||||||
using Robust.Shared.Maths;
|
using Robust.Shared.Maths;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
using Robust.Shared.Utility.Markup;
|
||||||
|
|
||||||
namespace Content.Client.Chat.UI
|
namespace Content.Client.Chat.UI
|
||||||
{
|
{
|
||||||
@@ -395,7 +396,7 @@ namespace Content.Client.Chat.UI
|
|||||||
|
|
||||||
private void WriteChatMessage(StoredChatMessage message)
|
private void WriteChatMessage(StoredChatMessage message)
|
||||||
{
|
{
|
||||||
var messageText = FormattedMessage.EscapeText(message.Message);
|
var messageText = Basic.EscapeText(message.Message);
|
||||||
if (!string.IsNullOrEmpty(message.MessageWrap))
|
if (!string.IsNullOrEmpty(message.MessageWrap))
|
||||||
{
|
{
|
||||||
messageText = string.Format(message.MessageWrap, messageText);
|
messageText = string.Format(message.MessageWrap, messageText);
|
||||||
@@ -502,11 +503,7 @@ namespace Content.Client.Chat.UI
|
|||||||
{
|
{
|
||||||
DebugTools.Assert(!Disposed);
|
DebugTools.Assert(!Disposed);
|
||||||
|
|
||||||
var formatted = new FormattedMessage(3);
|
Contents.AddMessage(Basic.RenderMarkup(message, new Section{Color=color.ToArgb()}));
|
||||||
formatted.PushColor(color);
|
|
||||||
formatted.AddMarkup(message);
|
|
||||||
formatted.Pop();
|
|
||||||
Contents.AddMessage(formatted);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Input_OnTextEntered(LineEdit.LineEditEventArgs args)
|
private void Input_OnTextEntered(LineEdit.LineEditEventArgs args)
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ using Robust.Client.UserInterface.XAML;
|
|||||||
using Robust.Shared.IoC;
|
using Robust.Shared.IoC;
|
||||||
using Robust.Shared.Maths;
|
using Robust.Shared.Maths;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
using Robust.Shared.Utility.Markup;
|
||||||
|
|
||||||
namespace Content.Client.ContextMenu.UI
|
namespace Content.Client.ContextMenu.UI
|
||||||
{
|
{
|
||||||
@@ -45,7 +46,14 @@ namespace Content.Client.ContextMenu.UI
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Convenience property to set label text.
|
/// Convenience property to set label text.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Text { set => Label.SetMessage(FormattedMessage.FromMarkupPermissive(value.Trim())); }
|
public string Text {
|
||||||
|
set
|
||||||
|
{
|
||||||
|
var b = new Basic();
|
||||||
|
b.AddMarkupPermissive(value.Trim());
|
||||||
|
Label.SetMessage(b.Render());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public ContextMenuElement(string? text = null)
|
public ContextMenuElement(string? text = null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ using Robust.Shared.IoC;
|
|||||||
using Robust.Shared.Localization;
|
using Robust.Shared.Localization;
|
||||||
using Robust.Shared.Maths;
|
using Robust.Shared.Maths;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
using Robust.Shared.Utility.Markup;
|
||||||
using YamlDotNet.RepresentationModel;
|
using YamlDotNet.RepresentationModel;
|
||||||
using static Robust.Client.UserInterface.Controls.BoxContainer;
|
using static Robust.Client.UserInterface.Controls.BoxContainer;
|
||||||
|
|
||||||
@@ -143,7 +144,7 @@ namespace Content.Client.Credits
|
|||||||
var text = _resourceManager.ContentFileReadAllText($"/Credits/{path}");
|
var text = _resourceManager.ContentFileReadAllText($"/Credits/{path}");
|
||||||
if (markup)
|
if (markup)
|
||||||
{
|
{
|
||||||
label.SetMessage(FormattedMessage.FromMarkup(text.Trim()));
|
label.SetMessage(Basic.RenderMarkup(text.Trim()));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -181,9 +181,9 @@ namespace Content.Client.Examine
|
|||||||
message = response.Message;
|
message = response.Message;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var msg in message.Tags.OfType<FormattedMessage.TagText>())
|
foreach (var msg in message.Sections)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrWhiteSpace(msg.Text)) continue;
|
if (string.IsNullOrWhiteSpace(msg.Content)) continue;
|
||||||
|
|
||||||
var richLabel = new RichTextLabel();
|
var richLabel = new RichTextLabel();
|
||||||
richLabel.SetMessage(message);
|
richLabel.SetMessage(message);
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ using Robust.Client.UserInterface.XAML;
|
|||||||
using Robust.Shared.Localization;
|
using Robust.Shared.Localization;
|
||||||
using Robust.Shared.Timing;
|
using Robust.Shared.Timing;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
using Robust.Shared.Utility.Markup;
|
||||||
|
|
||||||
namespace Content.Client.Ghost.Roles.UI
|
namespace Content.Client.Ghost.Roles.UI
|
||||||
{
|
{
|
||||||
@@ -17,7 +18,9 @@ namespace Content.Client.Ghost.Roles.UI
|
|||||||
public GhostRoleRulesWindow(string rules, Action<BaseButton.ButtonEventArgs> requestAction)
|
public GhostRoleRulesWindow(string rules, Action<BaseButton.ButtonEventArgs> requestAction)
|
||||||
{
|
{
|
||||||
RobustXamlLoader.Load(this);
|
RobustXamlLoader.Load(this);
|
||||||
Title.SetMessage(FormattedMessage.FromMarkupPermissive(rules + "\n" + Loc.GetString("ghost-roles-window-rules-footer")));
|
var b = new Basic();
|
||||||
|
b.AddMarkupPermissive(rules + "\n" + Loc.GetString("ghost-roles-window-rules-footer"));
|
||||||
|
Title.SetMessage(b.Render());
|
||||||
RequestButton.OnPressed += requestAction;
|
RequestButton.OnPressed += requestAction;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ using Robust.Shared.Log;
|
|||||||
using Robust.Shared.Maths;
|
using Robust.Shared.Maths;
|
||||||
using Robust.Shared.Prototypes;
|
using Robust.Shared.Prototypes;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
using Robust.Shared.Utility.Markup;
|
||||||
using static Robust.Client.Input.Keyboard.Key;
|
using static Robust.Client.Input.Keyboard.Key;
|
||||||
using static Robust.Client.UserInterface.Controls.BoxContainer;
|
using static Robust.Client.UserInterface.Controls.BoxContainer;
|
||||||
using Control = Robust.Client.UserInterface.Control;
|
using Control = Robust.Client.UserInterface.Control;
|
||||||
@@ -727,7 +728,7 @@ namespace Content.Client.HUD
|
|||||||
|
|
||||||
private string? DefaultShortKeyName(BoundKeyFunction keyFunction)
|
private string? DefaultShortKeyName(BoundKeyFunction keyFunction)
|
||||||
{
|
{
|
||||||
var name = FormattedMessage.EscapeText(_inputManager.GetKeyFunctionButtonString(keyFunction));
|
var name = Basic.EscapeText(_inputManager.GetKeyFunctionButtonString(keyFunction));
|
||||||
return name.Length > 3 ? null : name;
|
return name.Length > 3 ? null : name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ using Robust.Shared.IoC;
|
|||||||
using Robust.Shared.Localization;
|
using Robust.Shared.Localization;
|
||||||
using Robust.Shared.Maths;
|
using Robust.Shared.Maths;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
using Robust.Shared.Utility.Markup;
|
||||||
using static Robust.Client.UserInterface.Controls.BoxContainer;
|
using static Robust.Client.UserInterface.Controls.BoxContainer;
|
||||||
|
|
||||||
namespace Content.Client.Info
|
namespace Content.Client.Info
|
||||||
@@ -80,7 +81,7 @@ namespace Content.Client.Info
|
|||||||
var text = _resourceManager.ContentFileReadAllText($"/Server Info/{path}");
|
var text = _resourceManager.ContentFileReadAllText($"/Server Info/{path}");
|
||||||
if (markup)
|
if (markup)
|
||||||
{
|
{
|
||||||
label.SetMessage(FormattedMessage.FromMarkup(text.Trim()));
|
label.SetMessage(Basic.RenderMarkup(text.Trim()));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -122,7 +123,7 @@ namespace Content.Client.Info
|
|||||||
var text = _resourceManager.ContentFileReadAllText($"/Server Info/{path}");
|
var text = _resourceManager.ContentFileReadAllText($"/Server Info/{path}");
|
||||||
if (markup)
|
if (markup)
|
||||||
{
|
{
|
||||||
label.SetMessage(FormattedMessage.FromMarkup(text.Trim()));
|
label.SetMessage(Basic.RenderMarkup(text.Trim()));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ using Robust.Client.UserInterface.Controls;
|
|||||||
using Robust.Shared.IoC;
|
using Robust.Shared.IoC;
|
||||||
using Robust.Shared.Localization;
|
using Robust.Shared.Localization;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
using Robust.Shared.Utility.Markup;
|
||||||
|
|
||||||
namespace Content.Client.Info
|
namespace Content.Client.Info
|
||||||
{
|
{
|
||||||
@@ -62,7 +63,7 @@ namespace Content.Client.Info
|
|||||||
|
|
||||||
public void SetInfoBlob(string markup)
|
public void SetInfoBlob(string markup)
|
||||||
{
|
{
|
||||||
_richTextLabel.SetMessage(FormattedMessage.FromMarkup(markup));
|
_richTextLabel.SetMessage(Basic.RenderMarkup(markup));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
using Robust.Client.UserInterface.Controls;
|
using Robust.Client.UserInterface.Controls;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
using Robust.Shared.Utility.Markup;
|
||||||
|
|
||||||
namespace Content.Client.Message
|
namespace Content.Client.Message
|
||||||
{
|
{
|
||||||
@@ -7,7 +8,7 @@ namespace Content.Client.Message
|
|||||||
{
|
{
|
||||||
public static void SetMarkup(this RichTextLabel label, string markup)
|
public static void SetMarkup(this RichTextLabel label, string markup)
|
||||||
{
|
{
|
||||||
label.SetMessage(FormattedMessage.FromMarkup(markup));
|
label.SetMessage(Basic.RenderMarkup(markup));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using Robust.Client.UserInterface.Controls;
|
|||||||
using Robust.Client.UserInterface.CustomControls;
|
using Robust.Client.UserInterface.CustomControls;
|
||||||
using Robust.Client.UserInterface.XAML;
|
using Robust.Client.UserInterface.XAML;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
using Robust.Shared.Utility.Markup;
|
||||||
|
|
||||||
namespace Content.Client.Paper.UI
|
namespace Content.Client.Paper.UI
|
||||||
{
|
{
|
||||||
@@ -21,9 +22,9 @@ namespace Content.Client.Paper.UI
|
|||||||
{
|
{
|
||||||
Input.Visible = true;
|
Input.Visible = true;
|
||||||
}
|
}
|
||||||
var msg = new FormattedMessage();
|
var msg = new Basic();
|
||||||
msg.AddMarkupPermissive(state.Text);
|
msg.AddMarkupPermissive(state.Text);
|
||||||
Label.SetMessage(msg);
|
Label.SetMessage(msg.Render());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using Robust.Client.ResourceManagement;
|
|||||||
using Robust.Client.UserInterface;
|
using Robust.Client.UserInterface;
|
||||||
using Robust.Client.UserInterface.Controls;
|
using Robust.Client.UserInterface.Controls;
|
||||||
using Robust.Client.UserInterface.CustomControls;
|
using Robust.Client.UserInterface.CustomControls;
|
||||||
|
using Robust.Shared.Utility;
|
||||||
using Robust.Shared.Maths;
|
using Robust.Shared.Maths;
|
||||||
|
|
||||||
namespace Content.Client.Stylesheets
|
namespace Content.Client.Stylesheets
|
||||||
@@ -39,28 +40,57 @@ namespace Content.Client.Stylesheets
|
|||||||
|
|
||||||
protected StyleBoxTexture BaseAngleRect { get; }
|
protected StyleBoxTexture BaseAngleRect { get; }
|
||||||
|
|
||||||
|
protected IFontLibrary FontLib { get; }
|
||||||
|
|
||||||
protected StyleBase(IResourceCache resCache)
|
protected StyleBase(IResourceCache resCache)
|
||||||
{
|
{
|
||||||
var notoSans12 = resCache.GetFont
|
FontLib = new FontLibrary(
|
||||||
|
new FontClass(Id: "notosans", Style: (FontStyle) default, Size: (FontSize) 12)
|
||||||
|
) as IFontLibrary;
|
||||||
|
|
||||||
|
FontLib.AddFont("notosans",
|
||||||
|
new FontVariant
|
||||||
(
|
(
|
||||||
|
FontStyle.Normal,
|
||||||
new []
|
new []
|
||||||
{
|
{
|
||||||
"/Fonts/NotoSans/NotoSans-Regular.ttf",
|
resCache.GetResource<FontResource>("/Fonts/NotoSans/NotoSans-Regular.ttf"),
|
||||||
"/Fonts/NotoSans/NotoSansSymbols-Regular.ttf",
|
resCache.GetResource<FontResource>("/Fonts/NotoSans/NotoSansSymbols-Regular.ttf"),
|
||||||
"/Fonts/NotoSans/NotoSansSymbols2-Regular.ttf"
|
resCache.GetResource<FontResource>("/Fonts/NotoSans/NotoSansSymbols2-Regular.ttf")
|
||||||
},
|
}
|
||||||
12
|
),
|
||||||
);
|
new FontVariant
|
||||||
var notoSans12Italic = resCache.GetFont
|
|
||||||
(
|
(
|
||||||
|
FontStyle.Italic,
|
||||||
new []
|
new []
|
||||||
{
|
{
|
||||||
"/Fonts/NotoSans/NotoSans-Italic.ttf",
|
resCache.GetResource<FontResource>("/Fonts/NotoSans/NotoSans-Italic.ttf"),
|
||||||
"/Fonts/NotoSans/NotoSansSymbols-Regular.ttf",
|
resCache.GetResource<FontResource>("/Fonts/NotoSans/NotoSansSymbols-Regular.ttf"),
|
||||||
"/Fonts/NotoSans/NotoSansSymbols2-Regular.ttf"
|
resCache.GetResource<FontResource>("/Fonts/NotoSans/NotoSansSymbols2-Regular.ttf")
|
||||||
},
|
}
|
||||||
12
|
),
|
||||||
|
new FontVariant
|
||||||
|
(
|
||||||
|
FontStyle.Bold,
|
||||||
|
new []
|
||||||
|
{
|
||||||
|
resCache.GetResource<FontResource>("/Fonts/NotoSans/NotoSans-Bold.ttf"),
|
||||||
|
resCache.GetResource<FontResource>("/Fonts/NotoSans/NotoSansSymbols-Bold.ttf"),
|
||||||
|
resCache.GetResource<FontResource>("/Fonts/NotoSans/NotoSansSymbols2-Regular.ttf")
|
||||||
|
}
|
||||||
|
),
|
||||||
|
new FontVariant
|
||||||
|
(
|
||||||
|
FontStyle.Bold | FontStyle.Italic,
|
||||||
|
new []
|
||||||
|
{
|
||||||
|
resCache.GetResource<FontResource>("/Fonts/NotoSans/NotoSans-BoldItalic.ttf"),
|
||||||
|
resCache.GetResource<FontResource>("/Fonts/NotoSans/NotoSansSymbols-Bold.ttf"),
|
||||||
|
resCache.GetResource<FontResource>("/Fonts/NotoSans/NotoSansSymbols2-Regular.ttf")
|
||||||
|
}
|
||||||
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
var textureCloseButton = resCache.GetTexture("/Textures/Interface/Nano/cross.svg.png");
|
var textureCloseButton = resCache.GetTexture("/Textures/Interface/Nano/cross.svg.png");
|
||||||
|
|
||||||
// Button styles.
|
// Button styles.
|
||||||
@@ -151,7 +181,8 @@ namespace Content.Client.Stylesheets
|
|||||||
new SelectorElement(null, null, null, null),
|
new SelectorElement(null, null, null, null),
|
||||||
new[]
|
new[]
|
||||||
{
|
{
|
||||||
new StyleProperty("font", notoSans12),
|
new StyleProperty("font-library", FontLib),
|
||||||
|
new StyleProperty("font", new FontClass("notosans", (FontStyle) default, (FontSize) 12)),
|
||||||
}),
|
}),
|
||||||
|
|
||||||
// Default font.
|
// Default font.
|
||||||
@@ -159,7 +190,7 @@ namespace Content.Client.Stylesheets
|
|||||||
new SelectorElement(null, new[] {StyleClassItalic}, null, null),
|
new SelectorElement(null, new[] {StyleClassItalic}, null, null),
|
||||||
new[]
|
new[]
|
||||||
{
|
{
|
||||||
new StyleProperty("font", notoSans12Italic),
|
new StyleProperty("font", new FontClass("notosans", FontStyle.Italic, (FontSize) 12)),
|
||||||
}),
|
}),
|
||||||
|
|
||||||
// Window close button base texture.
|
// Window close button base texture.
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ using Robust.Client.UserInterface;
|
|||||||
using Robust.Client.UserInterface.Controls;
|
using Robust.Client.UserInterface.Controls;
|
||||||
using Robust.Client.UserInterface.CustomControls;
|
using Robust.Client.UserInterface.CustomControls;
|
||||||
using Robust.Shared.Maths;
|
using Robust.Shared.Maths;
|
||||||
|
using Robust.Shared.Utility;
|
||||||
using static Robust.Client.UserInterface.StylesheetHelpers;
|
using static Robust.Client.UserInterface.StylesheetHelpers;
|
||||||
|
|
||||||
namespace Content.Client.Stylesheets
|
namespace Content.Client.Stylesheets
|
||||||
@@ -109,19 +110,49 @@ namespace Content.Client.Stylesheets
|
|||||||
|
|
||||||
public StyleNano(IResourceCache resCache) : base(resCache)
|
public StyleNano(IResourceCache resCache) : base(resCache)
|
||||||
{
|
{
|
||||||
var notoSans10 = resCache.notoStack(size: 10);
|
FontLib.AddFont("notosansdisplay",
|
||||||
var notoSansItalic10 = resCache.notoStack(variation: "Italic", size: 10);
|
new FontVariant
|
||||||
var notoSans12 = resCache.notoStack(size: 12);
|
(
|
||||||
var notoSansItalic12 = resCache.notoStack(variation: "Italic", size: 12);
|
FontStyle.Normal,
|
||||||
var notoSansBold12 = resCache.notoStack(variation: "Bold", size: 12);
|
new []
|
||||||
var notoSansBoldItalic12 = resCache.notoStack(variation: "BoldItalic", size: 12);
|
{
|
||||||
var notoSansDisplayBold14 = resCache.notoStack(variation: "Bold", display: true, size: 14);
|
resCache.GetResource<FontResource>("/Fonts/NotoSansDisplay/NotoSansDisplay-Regular.ttf"),
|
||||||
var notoSansDisplayBold16 = resCache.notoStack(variation: "Bold", display: true, size: 16);
|
resCache.GetResource<FontResource>("/Fonts/NotoSans/NotoSansSymbols-Regular.ttf"),
|
||||||
var notoSans15 = resCache.notoStack(variation: "Regular", size: 15);
|
resCache.GetResource<FontResource>("/Fonts/NotoSans/NotoSansSymbols2-Regular.ttf")
|
||||||
var notoSans16 = resCache.notoStack(variation: "Regular", size: 16);
|
}
|
||||||
var notoSansBold16 = resCache.notoStack(variation: "Bold", size: 16);
|
),
|
||||||
var notoSansBold18 = resCache.notoStack(variation: "Bold", size: 18);
|
new FontVariant
|
||||||
var notoSansBold20 = resCache.notoStack(variation: "Bold", size: 20);
|
(
|
||||||
|
FontStyle.Bold,
|
||||||
|
new []
|
||||||
|
{
|
||||||
|
resCache.GetResource<FontResource>("/Fonts/NotoSansDisplay/NotoSansDisplay-Bold.ttf"),
|
||||||
|
resCache.GetResource<FontResource>("/Fonts/NotoSans/NotoSansSymbols-Regular.ttf"),
|
||||||
|
resCache.GetResource<FontResource>("/Fonts/NotoSans/NotoSansSymbols2-Regular.ttf")
|
||||||
|
}
|
||||||
|
),
|
||||||
|
new FontVariant
|
||||||
|
(
|
||||||
|
FontStyle.Italic,
|
||||||
|
new []
|
||||||
|
{
|
||||||
|
resCache.GetResource<FontResource>("/Fonts/NotoSansDisplay/NotoSansDisplay-Italic.ttf"),
|
||||||
|
resCache.GetResource<FontResource>("/Fonts/NotoSans/NotoSansSymbols-Regular.ttf"),
|
||||||
|
resCache.GetResource<FontResource>("/Fonts/NotoSans/NotoSansSymbols2-Regular.ttf")
|
||||||
|
}
|
||||||
|
),
|
||||||
|
new FontVariant
|
||||||
|
(
|
||||||
|
FontStyle.Bold | FontStyle.Italic,
|
||||||
|
new []
|
||||||
|
{
|
||||||
|
resCache.GetResource<FontResource>("/Fonts/NotoSansDisplay/NotoSansDisplay-BoldItalic.ttf"),
|
||||||
|
resCache.GetResource<FontResource>("/Fonts/NotoSans/NotoSansSymbols-Bold.ttf"),
|
||||||
|
resCache.GetResource<FontResource>("/Fonts/NotoSans/NotoSansSymbols2-Regular.ttf")
|
||||||
|
}
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
var windowHeaderTex = resCache.GetTexture("/Textures/Interface/Nano/window_header.png");
|
var windowHeaderTex = resCache.GetTexture("/Textures/Interface/Nano/window_header.png");
|
||||||
var windowHeader = new StyleBoxTexture
|
var windowHeader = new StyleBoxTexture
|
||||||
{
|
{
|
||||||
@@ -428,7 +459,16 @@ namespace Content.Client.Stylesheets
|
|||||||
var sliderFillRed = new StyleBoxTexture(sliderFillBox) {Modulate = Color.Red};
|
var sliderFillRed = new StyleBoxTexture(sliderFillBox) {Modulate = Color.Red};
|
||||||
var sliderFillBlue = new StyleBoxTexture(sliderFillBox) {Modulate = Color.Blue};
|
var sliderFillBlue = new StyleBoxTexture(sliderFillBox) {Modulate = Color.Blue};
|
||||||
|
|
||||||
var boxFont13 = resCache.GetFont("/Fonts/Boxfont-round/Boxfont Round.ttf", 13);
|
FontLib.AddFont("box",
|
||||||
|
new FontVariant
|
||||||
|
(
|
||||||
|
(FontStyle) default,
|
||||||
|
new []
|
||||||
|
{
|
||||||
|
resCache.GetResource<FontResource>("/Fonts/Boxfont-round/Boxfont Round.ttf")
|
||||||
|
}
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
var insetBack = new StyleBoxTexture
|
var insetBack = new StyleBoxTexture
|
||||||
{
|
{
|
||||||
@@ -445,7 +485,7 @@ namespace Content.Client.Stylesheets
|
|||||||
new[]
|
new[]
|
||||||
{
|
{
|
||||||
new StyleProperty(Label.StylePropertyFontColor, NanoGold),
|
new StyleProperty(Label.StylePropertyFontColor, NanoGold),
|
||||||
new StyleProperty(Label.StylePropertyFont, notoSansDisplayBold14),
|
new StyleProperty(Label.StylePropertyFont, new FontClass("notosansdisplay", FontStyle.Bold, (FontSize) 14)),
|
||||||
}),
|
}),
|
||||||
// Alert (white) window title.
|
// Alert (white) window title.
|
||||||
new StyleRule(
|
new StyleRule(
|
||||||
@@ -453,7 +493,7 @@ namespace Content.Client.Stylesheets
|
|||||||
new[]
|
new[]
|
||||||
{
|
{
|
||||||
new StyleProperty(Label.StylePropertyFontColor, Color.White),
|
new StyleProperty(Label.StylePropertyFontColor, Color.White),
|
||||||
new StyleProperty(Label.StylePropertyFont, notoSansDisplayBold14),
|
new StyleProperty(Label.StylePropertyFont, new FontClass("notosansdisplay", FontStyle.Bold, (FontSize) 14)),
|
||||||
}),
|
}),
|
||||||
// Window background.
|
// Window background.
|
||||||
new StyleRule(
|
new StyleRule(
|
||||||
@@ -603,16 +643,16 @@ namespace Content.Client.Stylesheets
|
|||||||
|
|
||||||
// Context Menu Labels
|
// Context Menu Labels
|
||||||
Element<RichTextLabel>().Class(VerbMenuElement.StyleClassVerbInteractionText)
|
Element<RichTextLabel>().Class(VerbMenuElement.StyleClassVerbInteractionText)
|
||||||
.Prop(Label.StylePropertyFont, notoSansBoldItalic12),
|
.Prop(Label.StylePropertyFont, new FontClass("notosans", FontStyle.Bold | FontStyle.Italic, (FontSize) 12)),
|
||||||
|
|
||||||
Element<RichTextLabel>().Class(VerbMenuElement.StyleClassVerbActivationText)
|
Element<RichTextLabel>().Class(VerbMenuElement.StyleClassVerbActivationText)
|
||||||
.Prop(Label.StylePropertyFont, notoSansBold12),
|
.Prop(Label.StylePropertyFont, new FontClass("notosans", FontStyle.Bold, (FontSize) 12)),
|
||||||
|
|
||||||
Element<RichTextLabel>().Class(VerbMenuElement.StyleClassVerbAlternativeText)
|
Element<RichTextLabel>().Class(VerbMenuElement.StyleClassVerbAlternativeText)
|
||||||
.Prop(Label.StylePropertyFont, notoSansItalic12),
|
.Prop(Label.StylePropertyFont, new FontClass("notosans", FontStyle.Italic, (FontSize) 12)),
|
||||||
|
|
||||||
Element<RichTextLabel>().Class(VerbMenuElement.StyleClassVerbOtherText)
|
Element<RichTextLabel>().Class(VerbMenuElement.StyleClassVerbOtherText)
|
||||||
.Prop(Label.StylePropertyFont, notoSans12),
|
.Prop(Label.StylePropertyFont, new FontClass("notosans", (FontStyle) default, (FontSize) 12)),
|
||||||
|
|
||||||
// Thin buttons (No padding nor vertical margin)
|
// Thin buttons (No padding nor vertical margin)
|
||||||
Element<EntityContainerButton>().Class(StyleClassStorageButton)
|
Element<EntityContainerButton>().Class(StyleClassStorageButton)
|
||||||
@@ -677,7 +717,7 @@ namespace Content.Client.Stylesheets
|
|||||||
new SelectorElement(typeof(Label), null, null, null)),
|
new SelectorElement(typeof(Label), null, null, null)),
|
||||||
new[]
|
new[]
|
||||||
{
|
{
|
||||||
new StyleProperty("font", notoSansBold16),
|
new StyleProperty("font", new FontClass("notosans", FontStyle.Bold, (FontSize) 16)),
|
||||||
}),
|
}),
|
||||||
|
|
||||||
// Main menu: also make those buttons slightly more separated.
|
// Main menu: also make those buttons slightly more separated.
|
||||||
@@ -783,52 +823,52 @@ namespace Content.Client.Stylesheets
|
|||||||
new SelectorElement(typeof(RichTextLabel), null, null, null)),
|
new SelectorElement(typeof(RichTextLabel), null, null, null)),
|
||||||
new[]
|
new[]
|
||||||
{
|
{
|
||||||
new StyleProperty("font", notoSansItalic12),
|
new StyleProperty("font", new FontClass("notosans", FontStyle.Italic, (FontSize) 12)),
|
||||||
}),
|
}),
|
||||||
|
|
||||||
// alert tooltip
|
// alert tooltip
|
||||||
new StyleRule(new SelectorElement(typeof(RichTextLabel), new[] {StyleClassTooltipAlertTitle}, null, null), new[]
|
new StyleRule(new SelectorElement(typeof(RichTextLabel), new[] {StyleClassTooltipAlertTitle}, null, null), new[]
|
||||||
{
|
{
|
||||||
new StyleProperty("font", notoSansBold18)
|
new StyleProperty("font", new FontClass("notosans", FontStyle.Bold, (FontSize) 18))
|
||||||
}),
|
}),
|
||||||
new StyleRule(new SelectorElement(typeof(RichTextLabel), new[] {StyleClassTooltipAlertDescription}, null, null), new[]
|
new StyleRule(new SelectorElement(typeof(RichTextLabel), new[] {StyleClassTooltipAlertDescription}, null, null), new[]
|
||||||
{
|
{
|
||||||
new StyleProperty("font", notoSans16)
|
new StyleProperty("font", new FontClass("notosans", (FontStyle) default, (FontSize) 16))
|
||||||
}),
|
}),
|
||||||
new StyleRule(new SelectorElement(typeof(RichTextLabel), new[] {StyleClassTooltipAlertCooldown}, null, null), new[]
|
new StyleRule(new SelectorElement(typeof(RichTextLabel), new[] {StyleClassTooltipAlertCooldown}, null, null), new[]
|
||||||
{
|
{
|
||||||
new StyleProperty("font", notoSans16)
|
new StyleProperty("font", new FontClass("notosans", (FontStyle) default, (FontSize) 16))
|
||||||
}),
|
}),
|
||||||
|
|
||||||
// action tooltip
|
// action tooltip
|
||||||
new StyleRule(new SelectorElement(typeof(RichTextLabel), new[] {StyleClassTooltipActionTitle}, null, null), new[]
|
new StyleRule(new SelectorElement(typeof(RichTextLabel), new[] {StyleClassTooltipActionTitle}, null, null), new[]
|
||||||
{
|
{
|
||||||
new StyleProperty("font", notoSansBold16)
|
new StyleProperty("font", new FontClass("notosans", FontStyle.Bold, (FontSize) 16))
|
||||||
}),
|
}),
|
||||||
new StyleRule(new SelectorElement(typeof(RichTextLabel), new[] {StyleClassTooltipActionDescription}, null, null), new[]
|
new StyleRule(new SelectorElement(typeof(RichTextLabel), new[] {StyleClassTooltipActionDescription}, null, null), new[]
|
||||||
{
|
{
|
||||||
new StyleProperty("font", notoSans15)
|
new StyleProperty("font", new FontClass("notosans", (FontStyle) default, (FontSize) 15))
|
||||||
}),
|
}),
|
||||||
new StyleRule(new SelectorElement(typeof(RichTextLabel), new[] {StyleClassTooltipActionCooldown}, null, null), new[]
|
new StyleRule(new SelectorElement(typeof(RichTextLabel), new[] {StyleClassTooltipActionCooldown}, null, null), new[]
|
||||||
{
|
{
|
||||||
new StyleProperty("font", notoSans15)
|
new StyleProperty("font", new FontClass("notosans", (FontStyle) default, (FontSize) 15))
|
||||||
}),
|
}),
|
||||||
new StyleRule(new SelectorElement(typeof(RichTextLabel), new[] {StyleClassTooltipActionRequirements}, null, null), new[]
|
new StyleRule(new SelectorElement(typeof(RichTextLabel), new[] {StyleClassTooltipActionRequirements}, null, null), new[]
|
||||||
{
|
{
|
||||||
new StyleProperty("font", notoSans15)
|
new StyleProperty("font", new FontClass("notosans", (FontStyle) default, (FontSize) 15))
|
||||||
}),
|
}),
|
||||||
|
|
||||||
// small number for the entity counter in the entity menu
|
// small number for the entity counter in the entity menu
|
||||||
new StyleRule(new SelectorElement(typeof(Label), new[] {EntityMenuElement.StyleClassEntityMenuCountText}, null, null), new[]
|
new StyleRule(new SelectorElement(typeof(Label), new[] {EntityMenuElement.StyleClassEntityMenuCountText}, null, null), new[]
|
||||||
{
|
{
|
||||||
new StyleProperty("font", notoSans10),
|
new StyleProperty("font", new FontClass("notosans", (FontStyle) default, (FontSize) 10)),
|
||||||
new StyleProperty(Label.StylePropertyAlignMode, Label.AlignMode.Right),
|
new StyleProperty(Label.StylePropertyAlignMode, Label.AlignMode.Right),
|
||||||
}),
|
}),
|
||||||
|
|
||||||
// hotbar slot
|
// hotbar slot
|
||||||
new StyleRule(new SelectorElement(typeof(RichTextLabel), new[] {StyleClassHotbarSlotNumber}, null, null), new[]
|
new StyleRule(new SelectorElement(typeof(RichTextLabel), new[] {StyleClassHotbarSlotNumber}, null, null), new[]
|
||||||
{
|
{
|
||||||
new StyleProperty("font", notoSansDisplayBold16)
|
new StyleProperty("font", new FontClass("notosansdisplay", FontStyle.Bold, (FontSize) 16))
|
||||||
}),
|
}),
|
||||||
|
|
||||||
// Entity tooltip
|
// Entity tooltip
|
||||||
@@ -885,14 +925,14 @@ namespace Content.Client.Stylesheets
|
|||||||
new StyleRule(
|
new StyleRule(
|
||||||
new SelectorElement(typeof(Label), new[] {Placeholder.StyleClassPlaceholderText}, null, null), new[]
|
new SelectorElement(typeof(Label), new[] {Placeholder.StyleClassPlaceholderText}, null, null), new[]
|
||||||
{
|
{
|
||||||
new StyleProperty(Label.StylePropertyFont, notoSans16),
|
new StyleProperty(Label.StylePropertyFont, new FontClass("notosans", (FontStyle) default, (FontSize) 16)),
|
||||||
new StyleProperty(Label.StylePropertyFontColor, new Color(103, 103, 103, 128)),
|
new StyleProperty(Label.StylePropertyFontColor, new Color(103, 103, 103, 128)),
|
||||||
}),
|
}),
|
||||||
|
|
||||||
// Big Label
|
// Big Label
|
||||||
new StyleRule(new SelectorElement(typeof(Label), new[] {StyleClassLabelHeading}, null, null), new[]
|
new StyleRule(new SelectorElement(typeof(Label), new[] {StyleClassLabelHeading}, null, null), new[]
|
||||||
{
|
{
|
||||||
new StyleProperty(Label.StylePropertyFont, notoSansBold16),
|
new StyleProperty(Label.StylePropertyFont, new FontClass("notosans", FontStyle.Bold, (FontSize) 16)),
|
||||||
new StyleProperty(Label.StylePropertyFontColor, NanoGold),
|
new StyleProperty(Label.StylePropertyFontColor, NanoGold),
|
||||||
}),
|
}),
|
||||||
|
|
||||||
@@ -900,28 +940,28 @@ namespace Content.Client.Stylesheets
|
|||||||
new StyleRule(new SelectorElement(typeof(Label), new[] {StyleClassLabelHeadingBigger}, null, null),
|
new StyleRule(new SelectorElement(typeof(Label), new[] {StyleClassLabelHeadingBigger}, null, null),
|
||||||
new[]
|
new[]
|
||||||
{
|
{
|
||||||
new StyleProperty(Label.StylePropertyFont, notoSansBold20),
|
new StyleProperty(Label.StylePropertyFont, new FontClass("notosans", FontStyle.Bold, (FontSize) 20)),
|
||||||
new StyleProperty(Label.StylePropertyFontColor, NanoGold),
|
new StyleProperty(Label.StylePropertyFontColor, NanoGold),
|
||||||
}),
|
}),
|
||||||
|
|
||||||
// Small Label
|
// Small Label
|
||||||
new StyleRule(new SelectorElement(typeof(Label), new[] {StyleClassLabelSubText}, null, null), new[]
|
new StyleRule(new SelectorElement(typeof(Label), new[] {StyleClassLabelSubText}, null, null), new[]
|
||||||
{
|
{
|
||||||
new StyleProperty(Label.StylePropertyFont, notoSans10),
|
new StyleProperty(Label.StylePropertyFont, new FontClass("notosans", (FontStyle) default, (FontSize) 10)),
|
||||||
new StyleProperty(Label.StylePropertyFontColor, Color.DarkGray),
|
new StyleProperty(Label.StylePropertyFontColor, Color.DarkGray),
|
||||||
}),
|
}),
|
||||||
|
|
||||||
// Label Key
|
// Label Key
|
||||||
new StyleRule(new SelectorElement(typeof(Label), new[] {StyleClassLabelKeyText}, null, null), new[]
|
new StyleRule(new SelectorElement(typeof(Label), new[] {StyleClassLabelKeyText}, null, null), new[]
|
||||||
{
|
{
|
||||||
new StyleProperty(Label.StylePropertyFont, notoSansBold12),
|
new StyleProperty(Label.StylePropertyFont, new FontClass("notosans", FontStyle.Bold, (FontSize) 12)),
|
||||||
new StyleProperty(Label.StylePropertyFontColor, NanoGold)
|
new StyleProperty(Label.StylePropertyFontColor, NanoGold)
|
||||||
}),
|
}),
|
||||||
|
|
||||||
new StyleRule(new SelectorElement(typeof(Label), new[] {StyleClassLabelSecondaryColor}, null, null),
|
new StyleRule(new SelectorElement(typeof(Label), new[] {StyleClassLabelSecondaryColor}, null, null),
|
||||||
new[]
|
new[]
|
||||||
{
|
{
|
||||||
new StyleProperty(Label.StylePropertyFont, notoSans12),
|
new StyleProperty(Label.StylePropertyFont, new FontClass("notosans", (FontStyle) default, (FontSize) 12)),
|
||||||
new StyleProperty(Label.StylePropertyFontColor, Color.DarkGray),
|
new StyleProperty(Label.StylePropertyFontColor, Color.DarkGray),
|
||||||
}),
|
}),
|
||||||
|
|
||||||
@@ -931,14 +971,14 @@ namespace Content.Client.Stylesheets
|
|||||||
new SelectorElement(typeof(Label), null, null, null)),
|
new SelectorElement(typeof(Label), null, null, null)),
|
||||||
new[]
|
new[]
|
||||||
{
|
{
|
||||||
new StyleProperty("font", notoSans16)
|
new StyleProperty("font", new FontClass("notosans", (FontStyle) default, (FontSize) 16))
|
||||||
}),
|
}),
|
||||||
|
|
||||||
// Popup messages
|
// Popup messages
|
||||||
new StyleRule(new SelectorElement(typeof(Label), new[] {StyleClassPopupMessage}, null, null),
|
new StyleRule(new SelectorElement(typeof(Label), new[] {StyleClassPopupMessage}, null, null),
|
||||||
new[]
|
new[]
|
||||||
{
|
{
|
||||||
new StyleProperty("font", notoSansItalic10),
|
new StyleProperty("font", new FontClass("notosans", FontStyle.Italic, (FontSize) 10)),
|
||||||
new StyleProperty("font-color", Color.LightGray),
|
new StyleProperty("font-color", Color.LightGray),
|
||||||
}),
|
}),
|
||||||
|
|
||||||
@@ -1029,7 +1069,7 @@ namespace Content.Client.Stylesheets
|
|||||||
new SelectorElement(typeof(Label), new[] {GameHud.TopButton.StyleClassLabelTopButton}, null, null),
|
new SelectorElement(typeof(Label), new[] {GameHud.TopButton.StyleClassLabelTopButton}, null, null),
|
||||||
new[]
|
new[]
|
||||||
{
|
{
|
||||||
new StyleProperty(Label.StylePropertyFont, notoSansDisplayBold14),
|
new StyleProperty(Label.StylePropertyFont, new FontClass("notosansdisplay", FontStyle.Bold, (FontSize) 14)),
|
||||||
}),
|
}),
|
||||||
|
|
||||||
// Targeting doll
|
// Targeting doll
|
||||||
@@ -1079,13 +1119,13 @@ namespace Content.Client.Stylesheets
|
|||||||
SelectorElement.Class(StyleClassLabelBig),
|
SelectorElement.Class(StyleClassLabelBig),
|
||||||
new[]
|
new[]
|
||||||
{
|
{
|
||||||
new StyleProperty("font", notoSans16),
|
new StyleProperty("font", new FontClass("notosans", (FontStyle) default, (FontSize) 16)),
|
||||||
}),
|
}),
|
||||||
|
|
||||||
// StyleClassItemStatus
|
// StyleClassItemStatus
|
||||||
new StyleRule(SelectorElement.Class(StyleClassItemStatus), new[]
|
new StyleRule(SelectorElement.Class(StyleClassItemStatus), new[]
|
||||||
{
|
{
|
||||||
new StyleProperty("font", notoSans10),
|
new StyleProperty("font", new FontClass("notosans", (FontStyle) default, (FontSize) 10)),
|
||||||
}),
|
}),
|
||||||
|
|
||||||
// Slider
|
// Slider
|
||||||
@@ -1190,7 +1230,7 @@ namespace Content.Client.Stylesheets
|
|||||||
}),
|
}),
|
||||||
|
|
||||||
Element<Label>().Class("FancyWindowTitle")
|
Element<Label>().Class("FancyWindowTitle")
|
||||||
.Prop("font", boxFont13)
|
.Prop("font", new FontClass("boxfont", (FontStyle) default, (FontSize) 13))
|
||||||
.Prop("font-color", NanoGold),
|
.Prop("font-color", NanoGold),
|
||||||
|
|
||||||
Element<PanelContainer>().Class("WindowHeadingBackground")
|
Element<PanelContainer>().Class("WindowHeadingBackground")
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ using Robust.Client.ResourceManagement;
|
|||||||
using Robust.Client.UserInterface;
|
using Robust.Client.UserInterface;
|
||||||
using Robust.Client.UserInterface.Controls;
|
using Robust.Client.UserInterface.Controls;
|
||||||
using Robust.Shared.Maths;
|
using Robust.Shared.Maths;
|
||||||
|
using Robust.Shared.Utility;
|
||||||
using static Robust.Client.UserInterface.StylesheetHelpers;
|
using static Robust.Client.UserInterface.StylesheetHelpers;
|
||||||
|
|
||||||
namespace Content.Client.Stylesheets
|
namespace Content.Client.Stylesheets
|
||||||
@@ -27,27 +28,6 @@ namespace Content.Client.Stylesheets
|
|||||||
|
|
||||||
public StyleSpace(IResourceCache resCache) : base(resCache)
|
public StyleSpace(IResourceCache resCache) : base(resCache)
|
||||||
{
|
{
|
||||||
var notoSans10 = resCache.GetFont
|
|
||||||
(
|
|
||||||
new []
|
|
||||||
{
|
|
||||||
"/Fonts/NotoSans/NotoSans-Regular.ttf",
|
|
||||||
"/Fonts/NotoSans/NotoSansSymbols-Regular.ttf",
|
|
||||||
"/Fonts/NotoSans/NotoSansSymbols2-Regular.ttf"
|
|
||||||
},
|
|
||||||
10
|
|
||||||
);
|
|
||||||
var notoSansBold16 = resCache.GetFont
|
|
||||||
(
|
|
||||||
new []
|
|
||||||
{
|
|
||||||
"/Fonts/NotoSans/NotoSans-Bold.ttf",
|
|
||||||
"/Fonts/NotoSans/NotoSansSymbols-Regular.ttf",
|
|
||||||
"/Fonts/NotoSans/NotoSansSymbols2-Regular.ttf"
|
|
||||||
},
|
|
||||||
16
|
|
||||||
);
|
|
||||||
|
|
||||||
var progressBarBackground = new StyleBoxFlat
|
var progressBarBackground = new StyleBoxFlat
|
||||||
{
|
{
|
||||||
BackgroundColor = new Color(0.25f, 0.25f, 0.25f)
|
BackgroundColor = new Color(0.25f, 0.25f, 0.25f)
|
||||||
@@ -65,11 +45,11 @@ namespace Content.Client.Stylesheets
|
|||||||
Stylesheet = new Stylesheet(BaseRules.Concat(new StyleRule[]
|
Stylesheet = new Stylesheet(BaseRules.Concat(new StyleRule[]
|
||||||
{
|
{
|
||||||
Element<Label>().Class(StyleClassLabelHeading)
|
Element<Label>().Class(StyleClassLabelHeading)
|
||||||
.Prop(Label.StylePropertyFont, notoSansBold16)
|
.Prop(Label.StylePropertyFont, new FontClass("notosans", FontStyle.Bold, (FontSize) 16))
|
||||||
.Prop(Label.StylePropertyFontColor, SpaceRed),
|
.Prop(Label.StylePropertyFontColor, SpaceRed),
|
||||||
|
|
||||||
Element<Label>().Class(StyleClassLabelSubText)
|
Element<Label>().Class(StyleClassLabelSubText)
|
||||||
.Prop(Label.StylePropertyFont, notoSans10)
|
.Prop(Label.StylePropertyFont, new FontClass("notosans", FontStyle.Normal, (FontSize) 10))
|
||||||
.Prop(Label.StylePropertyFontColor, Color.DarkGray),
|
.Prop(Label.StylePropertyFontColor, Color.DarkGray),
|
||||||
|
|
||||||
Element<PanelContainer>().Class(ClassHighDivider)
|
Element<PanelContainer>().Class(ClassHighDivider)
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ using Robust.Shared.Localization;
|
|||||||
using Robust.Server.Player;
|
using Robust.Server.Player;
|
||||||
using Robust.Shared.IoC;
|
using Robust.Shared.IoC;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
using Robust.Shared.Utility.Markup;
|
||||||
|
|
||||||
namespace Content.Server.Administration
|
namespace Content.Server.Administration
|
||||||
{
|
{
|
||||||
@@ -39,7 +40,7 @@ namespace Content.Server.Administration
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var escapedText = FormattedMessage.EscapeText(message.Text);
|
var escapedText = Basic.EscapeText(message.Text);
|
||||||
|
|
||||||
var bwoinkText = senderAdmin
|
var bwoinkText = senderAdmin
|
||||||
? $"[color=red]{senderSession.Name}[/color]: {escapedText}"
|
? $"[color=red]{senderSession.Name}[/color]: {escapedText}"
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ using Robust.Shared.Localization;
|
|||||||
using Robust.Shared.Player;
|
using Robust.Shared.Player;
|
||||||
using Robust.Shared.Serialization.Manager.Attributes;
|
using Robust.Shared.Serialization.Manager.Attributes;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
using Robust.Shared.Utility.Markup;
|
||||||
using Robust.Shared.ViewVariables;
|
using Robust.Shared.ViewVariables;
|
||||||
|
|
||||||
namespace Content.Server.Atmos.Components
|
namespace Content.Server.Atmos.Components
|
||||||
@@ -108,7 +109,7 @@ namespace Content.Server.Atmos.Components
|
|||||||
UpdateUserInterface(true);
|
UpdateUserInterface(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Examine(FormattedMessage message, bool inDetailsRange)
|
public void Examine(FormattedMessage.Builder message, bool inDetailsRange)
|
||||||
{
|
{
|
||||||
message.AddMarkup(Loc.GetString("comp-gas-tank-examine", ("pressure", Math.Round(Air?.Pressure ?? 0))));
|
message.AddMarkup(Loc.GetString("comp-gas-tank-examine", ("pressure", Math.Round(Air?.Pressure ?? 0))));
|
||||||
if (IsConnected)
|
if (IsConnected)
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ using Robust.Shared.Random;
|
|||||||
using Robust.Shared.Serialization.Manager.Attributes;
|
using Robust.Shared.Serialization.Manager.Attributes;
|
||||||
using Robust.Shared.Timing;
|
using Robust.Shared.Timing;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
using Robust.Shared.Utility.Markup;
|
||||||
using Robust.Shared.ViewVariables;
|
using Robust.Shared.ViewVariables;
|
||||||
|
|
||||||
namespace Content.Server.Botany.Components
|
namespace Content.Server.Botany.Components
|
||||||
@@ -843,7 +844,7 @@ namespace Content.Server.Botany.Components
|
|||||||
DoHarvest(eventArgs.User);
|
DoHarvest(eventArgs.User);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Examine(FormattedMessage message, bool inDetailsRange)
|
public void Examine(FormattedMessage.Builder message, bool inDetailsRange)
|
||||||
{
|
{
|
||||||
if (!inDetailsRange)
|
if (!inDetailsRange)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ using Robust.Shared.Localization;
|
|||||||
using Robust.Shared.Prototypes;
|
using Robust.Shared.Prototypes;
|
||||||
using Robust.Shared.Serialization.Manager.Attributes;
|
using Robust.Shared.Serialization.Manager.Attributes;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
using Robust.Shared.Utility.Markup;
|
||||||
using Robust.Shared.ViewVariables;
|
using Robust.Shared.ViewVariables;
|
||||||
|
|
||||||
namespace Content.Server.Botany.Components
|
namespace Content.Server.Botany.Components
|
||||||
@@ -26,7 +27,7 @@ namespace Content.Server.Botany.Components
|
|||||||
set => _seedName = value?.ID;
|
set => _seedName = value?.ID;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Examine(FormattedMessage message, bool inDetailsRange)
|
public void Examine(FormattedMessage.Builder message, bool inDetailsRange)
|
||||||
{
|
{
|
||||||
if (!inDetailsRange)
|
if (!inDetailsRange)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ using Robust.Shared.Log;
|
|||||||
using Robust.Shared.Network;
|
using Robust.Shared.Network;
|
||||||
using Robust.Shared.Player;
|
using Robust.Shared.Player;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
using Robust.Shared.Utility.Markup;
|
||||||
using static Content.Server.Chat.Managers.IChatManager;
|
using static Content.Server.Chat.Managers.IChatManager;
|
||||||
|
|
||||||
namespace Content.Server.Chat.Managers
|
namespace Content.Server.Chat.Managers
|
||||||
@@ -192,7 +193,7 @@ namespace Content.Server.Chat.Managers
|
|||||||
var listeners = EntitySystem.Get<ListeningSystem>();
|
var listeners = EntitySystem.Get<ListeningSystem>();
|
||||||
listeners.PingListeners(source, message);
|
listeners.PingListeners(source, message);
|
||||||
|
|
||||||
message = FormattedMessage.EscapeText(message);
|
message = Basic.EscapeText(message);
|
||||||
|
|
||||||
var msg = _netManager.CreateNetMessage<MsgChatMessage>();
|
var msg = _netManager.CreateNetMessage<MsgChatMessage>();
|
||||||
msg.Channel = ChatChannel.Local;
|
msg.Channel = ChatChannel.Local;
|
||||||
@@ -223,7 +224,7 @@ namespace Content.Server.Chat.Managers
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
action = FormattedMessage.EscapeText(action);
|
action = Basic.EscapeText(action);
|
||||||
|
|
||||||
var clients = Filter.Empty()
|
var clients = Filter.Empty()
|
||||||
.AddInRange(_entManager.GetComponent<TransformComponent>(source).MapPosition, VoiceRange)
|
.AddInRange(_entManager.GetComponent<TransformComponent>(source).MapPosition, VoiceRange)
|
||||||
@@ -260,7 +261,7 @@ namespace Content.Server.Chat.Managers
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
message = FormattedMessage.EscapeText(message);
|
message = Basic.EscapeText(message);
|
||||||
|
|
||||||
var msg = _netManager.CreateNetMessage<MsgChatMessage>();
|
var msg = _netManager.CreateNetMessage<MsgChatMessage>();
|
||||||
msg.Channel = ChatChannel.OOC;
|
msg.Channel = ChatChannel.OOC;
|
||||||
@@ -292,7 +293,7 @@ namespace Content.Server.Chat.Managers
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
message = FormattedMessage.EscapeText(message);
|
message = Basic.EscapeText(message);
|
||||||
|
|
||||||
var clients = GetDeadChatClients();
|
var clients = GetDeadChatClients();
|
||||||
|
|
||||||
@@ -319,7 +320,7 @@ namespace Content.Server.Chat.Managers
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
message = FormattedMessage.EscapeText(message);
|
message = Basic.EscapeText(message);
|
||||||
|
|
||||||
var clients = GetDeadChatClients();
|
var clients = GetDeadChatClients();
|
||||||
|
|
||||||
@@ -350,7 +351,7 @@ namespace Content.Server.Chat.Managers
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
message = FormattedMessage.EscapeText(message);
|
message = Basic.EscapeText(message);
|
||||||
|
|
||||||
var clients = _adminManager.ActiveAdmins.Select(p => p.ConnectedClient);
|
var clients = _adminManager.ActiveAdmins.Select(p => p.ConnectedClient);
|
||||||
|
|
||||||
@@ -368,7 +369,7 @@ namespace Content.Server.Chat.Managers
|
|||||||
{
|
{
|
||||||
var clients = _adminManager.ActiveAdmins.Select(p => p.ConnectedClient);
|
var clients = _adminManager.ActiveAdmins.Select(p => p.ConnectedClient);
|
||||||
|
|
||||||
message = FormattedMessage.EscapeText(message);
|
message = Basic.EscapeText(message);
|
||||||
|
|
||||||
var msg = _netManager.CreateNetMessage<MsgChatMessage>();
|
var msg = _netManager.CreateNetMessage<MsgChatMessage>();
|
||||||
|
|
||||||
@@ -382,7 +383,7 @@ namespace Content.Server.Chat.Managers
|
|||||||
|
|
||||||
public void SendHookOOC(string sender, string message)
|
public void SendHookOOC(string sender, string message)
|
||||||
{
|
{
|
||||||
message = FormattedMessage.EscapeText(message);
|
message = Basic.EscapeText(message);
|
||||||
|
|
||||||
var msg = _netManager.CreateNetMessage<MsgChatMessage>();
|
var msg = _netManager.CreateNetMessage<MsgChatMessage>();
|
||||||
msg.Channel = ChatChannel.OOC;
|
msg.Channel = ChatChannel.OOC;
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ using Robust.Shared.Localization;
|
|||||||
using Robust.Shared.Prototypes;
|
using Robust.Shared.Prototypes;
|
||||||
using Robust.Shared.Serialization.Manager.Attributes;
|
using Robust.Shared.Serialization.Manager.Attributes;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
using Robust.Shared.Utility.Markup;
|
||||||
using Robust.Shared.ViewVariables;
|
using Robust.Shared.ViewVariables;
|
||||||
|
|
||||||
namespace Content.Server.Construction.Components
|
namespace Content.Server.Construction.Components
|
||||||
@@ -53,7 +54,7 @@ namespace Content.Server.Construction.Components
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Examine(FormattedMessage message, bool inDetailsRange)
|
public void Examine(FormattedMessage.Builder message, bool inDetailsRange)
|
||||||
{
|
{
|
||||||
message.AddMarkup(Loc.GetString("machine-board-component-on-examine-label") + "\n");
|
message.AddMarkup(Loc.GetString("machine-board-component-on-examine-label") + "\n");
|
||||||
foreach (var (part, amount) in Requirements)
|
foreach (var (part, amount) in Requirements)
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using Robust.Shared.GameObjects;
|
|||||||
using Robust.Shared.Localization;
|
using Robust.Shared.Localization;
|
||||||
using Robust.Shared.Serialization.Manager.Attributes;
|
using Robust.Shared.Serialization.Manager.Attributes;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
using Robust.Shared.Utility.Markup;
|
||||||
using Robust.Shared.ViewVariables;
|
using Robust.Shared.ViewVariables;
|
||||||
|
|
||||||
namespace Content.Server.Construction.Components
|
namespace Content.Server.Construction.Components
|
||||||
@@ -38,7 +39,7 @@ namespace Content.Server.Construction.Components
|
|||||||
[DataField("rating")]
|
[DataField("rating")]
|
||||||
public int Rating { get; private set; } = 1;
|
public int Rating { get; private set; } = 1;
|
||||||
|
|
||||||
public void Examine(FormattedMessage message, bool inDetailsRange)
|
public void Examine(FormattedMessage.Builder message, bool inDetailsRange)
|
||||||
{
|
{
|
||||||
message.AddMarkup(Loc.GetString("machine-part-component-on-examine-rating-text", ("rating", Rating)) + "\n");
|
message.AddMarkup(Loc.GetString("machine-part-component-on-examine-rating-text", ("rating", Rating)) + "\n");
|
||||||
message.AddMarkup(Loc.GetString("machine-part-component-on-examine-type-text", ("type", PartType)) + "\n");
|
message.AddMarkup(Loc.GetString("machine-part-component-on-examine-type-text", ("type", PartType)) + "\n");
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ using Robust.Shared.IoC;
|
|||||||
using Robust.Shared.Localization;
|
using Robust.Shared.Localization;
|
||||||
using Robust.Shared.Serialization.Manager.Attributes;
|
using Robust.Shared.Serialization.Manager.Attributes;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
using Robust.Shared.Utility.Markup;
|
||||||
|
|
||||||
namespace Content.Server.Construction.Conditions
|
namespace Content.Server.Construction.Conditions
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -5,17 +5,18 @@ using Robust.Shared.GameObjects;
|
|||||||
using Robust.Shared.IoC;
|
using Robust.Shared.IoC;
|
||||||
using Robust.Shared.Localization;
|
using Robust.Shared.Localization;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
using Robust.Shared.Utility.Markup;
|
||||||
|
|
||||||
namespace Content.Server.Examine
|
namespace Content.Server.Examine
|
||||||
{
|
{
|
||||||
[UsedImplicitly]
|
[UsedImplicitly]
|
||||||
public class ExamineSystem : ExamineSystemShared
|
public class ExamineSystem : ExamineSystemShared
|
||||||
{
|
{
|
||||||
private static readonly FormattedMessage _entityNotFoundMessage;
|
private static readonly FormattedMessage.Builder _entityNotFoundMessage;
|
||||||
|
|
||||||
static ExamineSystem()
|
static ExamineSystem()
|
||||||
{
|
{
|
||||||
_entityNotFoundMessage = new FormattedMessage();
|
_entityNotFoundMessage = new FormattedMessage.Builder();
|
||||||
_entityNotFoundMessage.AddText(Loc.GetString("examine-system-entity-does-not-exist"));
|
_entityNotFoundMessage.AddText(Loc.GetString("examine-system-entity-does-not-exist"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -39,7 +40,7 @@ namespace Content.Server.Examine
|
|||||||
|| !CanExamine(playerEnt, request.EntityUid))
|
|| !CanExamine(playerEnt, request.EntityUid))
|
||||||
{
|
{
|
||||||
RaiseNetworkEvent(new ExamineSystemMessages.ExamineInfoResponseMessage(
|
RaiseNetworkEvent(new ExamineSystemMessages.ExamineInfoResponseMessage(
|
||||||
request.EntityUid, _entityNotFoundMessage), channel);
|
request.EntityUid, _entityNotFoundMessage.Build()), channel);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ namespace Content.Server.Headset
|
|||||||
RadioRequested = false;
|
RadioRequested = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Examine(FormattedMessage message, bool inDetailsRange)
|
public void Examine(FormattedMessage.Builder message, bool inDetailsRange)
|
||||||
{
|
{
|
||||||
message.AddText(Loc.GetString("examine-radio-frequency", ("frequency", BroadcastFrequency)));
|
message.AddText(Loc.GetString("examine-radio-frequency", ("frequency", BroadcastFrequency)));
|
||||||
message.AddText("\n");
|
message.AddText("\n");
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ using Robust.Shared.GameObjects;
|
|||||||
using Robust.Shared.IoC;
|
using Robust.Shared.IoC;
|
||||||
using Robust.Shared.Localization;
|
using Robust.Shared.Localization;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
using Robust.Shared.Utility.Markup;
|
||||||
|
|
||||||
namespace Content.Server.Labels
|
namespace Content.Server.Labels
|
||||||
{
|
{
|
||||||
@@ -55,9 +56,7 @@ namespace Content.Server.Labels
|
|||||||
if (label.CurrentLabel == null)
|
if (label.CurrentLabel == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var message = new FormattedMessage();
|
args.Message.AddText(Loc.GetString("hand-labeler-has-label", ("label", label.CurrentLabel)));
|
||||||
message.AddText(Loc.GetString("hand-labeler-has-label", ("label", label.CurrentLabel)));
|
|
||||||
args.PushMessage(message);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnExamined(EntityUid uid, PaperLabelComponent comp, ExaminedEvent args)
|
private void OnExamined(EntityUid uid, PaperLabelComponent comp, ExaminedEvent args)
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ using Robust.Shared.IoC;
|
|||||||
using Robust.Shared.Localization;
|
using Robust.Shared.Localization;
|
||||||
using Robust.Shared.Serialization.Manager.Attributes;
|
using Robust.Shared.Serialization.Manager.Attributes;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
using Robust.Shared.Utility.Markup;
|
||||||
using Robust.Shared.ViewVariables;
|
using Robust.Shared.ViewVariables;
|
||||||
|
|
||||||
namespace Content.Server.Light.Components
|
namespace Content.Server.Light.Components
|
||||||
@@ -148,9 +149,9 @@ namespace Content.Server.Light.Components
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void IExamine.Examine(FormattedMessage message, bool inDetailsRange)
|
void IExamine.Examine(FormattedMessage.Builder message, bool inDetailsRange)
|
||||||
{
|
{
|
||||||
message.AddMarkup(Loc.GetString("emergency-light-component-on-examine",("batteryStateText", Loc.GetString(BatteryStateText[State]))));
|
message.AddMessage(Basic.BuildMarkup(Loc.GetString("emergency-light-component-on-examine",("batteryStateText", Loc.GetString(BatteryStateText[State])))));
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum EmergencyLightState
|
public enum EmergencyLightState
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ using Robust.Shared.Maths;
|
|||||||
using Robust.Shared.Player;
|
using Robust.Shared.Player;
|
||||||
using Robust.Shared.Serialization.Manager.Attributes;
|
using Robust.Shared.Serialization.Manager.Attributes;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
using Robust.Shared.Utility.Markup;
|
||||||
using Robust.Shared.ViewVariables;
|
using Robust.Shared.ViewVariables;
|
||||||
|
|
||||||
namespace Content.Server.Light.Components
|
namespace Content.Server.Light.Components
|
||||||
@@ -83,7 +84,7 @@ namespace Content.Server.Light.Components
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void IExamine.Examine(FormattedMessage message, bool inDetailsRange)
|
void IExamine.Examine(FormattedMessage.Builder message, bool inDetailsRange)
|
||||||
{
|
{
|
||||||
if (Activated)
|
if (Activated)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ using Robust.Shared.Map;
|
|||||||
using Robust.Shared.Serialization.Manager.Attributes;
|
using Robust.Shared.Serialization.Manager.Attributes;
|
||||||
using Robust.Shared.Timing;
|
using Robust.Shared.Timing;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
using Robust.Shared.Utility.Markup;
|
||||||
using Robust.Shared.ViewVariables;
|
using Robust.Shared.ViewVariables;
|
||||||
|
|
||||||
namespace Content.Server.Mind.Components
|
namespace Content.Server.Mind.Components
|
||||||
@@ -125,7 +126,7 @@ namespace Content.Server.Mind.Components
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Examine(FormattedMessage message, bool inDetailsRange)
|
public void Examine(FormattedMessage.Builder message, bool inDetailsRange)
|
||||||
{
|
{
|
||||||
if (!ShowExamineInfo || !inDetailsRange)
|
if (!ShowExamineInfo || !inDetailsRange)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ using Robust.Shared.Localization;
|
|||||||
using Robust.Shared.Player;
|
using Robust.Shared.Player;
|
||||||
using Robust.Shared.Serialization.Manager.Attributes;
|
using Robust.Shared.Serialization.Manager.Attributes;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
using Robust.Shared.Utility.Markup;
|
||||||
using Robust.Shared.ViewVariables;
|
using Robust.Shared.ViewVariables;
|
||||||
|
|
||||||
namespace Content.Server.Morgue.Components
|
namespace Content.Server.Morgue.Components
|
||||||
@@ -48,7 +49,7 @@ namespace Content.Server.Morgue.Components
|
|||||||
|
|
||||||
private CancellationTokenSource? _cremateCancelToken;
|
private CancellationTokenSource? _cremateCancelToken;
|
||||||
|
|
||||||
void IExamine.Examine(FormattedMessage message, bool inDetailsRange)
|
void IExamine.Examine(FormattedMessage.Builder message, bool inDetailsRange)
|
||||||
{
|
{
|
||||||
if (Appearance == null) return;
|
if (Appearance == null) return;
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ using Robust.Shared.Maths;
|
|||||||
using Robust.Shared.Player;
|
using Robust.Shared.Player;
|
||||||
using Robust.Shared.Serialization.Manager.Attributes;
|
using Robust.Shared.Serialization.Manager.Attributes;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
using Robust.Shared.Utility.Markup;
|
||||||
using Robust.Shared.ViewVariables;
|
using Robust.Shared.ViewVariables;
|
||||||
|
|
||||||
namespace Content.Server.Morgue.Components
|
namespace Content.Server.Morgue.Components
|
||||||
@@ -172,7 +173,7 @@ namespace Content.Server.Morgue.Components
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void IExamine.Examine(FormattedMessage message, bool inDetailsRange)
|
void IExamine.Examine(FormattedMessage.Builder message, bool inDetailsRange)
|
||||||
{
|
{
|
||||||
if (Appearance == null) return;
|
if (Appearance == null) return;
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ using Robust.Shared.GameObjects;
|
|||||||
using Robust.Shared.Localization;
|
using Robust.Shared.Localization;
|
||||||
using Robust.Shared.Serialization.Manager.Attributes;
|
using Robust.Shared.Serialization.Manager.Attributes;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
using Robust.Shared.Utility.Markup;
|
||||||
using Robust.Shared.ViewVariables;
|
using Robust.Shared.ViewVariables;
|
||||||
|
|
||||||
namespace Content.Server.NodeContainer
|
namespace Content.Server.NodeContainer
|
||||||
@@ -43,28 +44,20 @@ namespace Content.Server.NodeContainer
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Examine(FormattedMessage message, bool inDetailsRange)
|
public void Examine(FormattedMessage.Builder message, bool inDetailsRange)
|
||||||
{
|
{
|
||||||
if (!_examinable || !inDetailsRange) return;
|
if (!_examinable || !inDetailsRange) return;
|
||||||
|
|
||||||
foreach (var node in Nodes.Values)
|
foreach (var node in Nodes.Values)
|
||||||
{
|
{
|
||||||
if (node == null) continue;
|
if (node == null) continue;
|
||||||
switch (node.NodeGroupID)
|
message.AddMarkup(node.NodeGroupID switch
|
||||||
{
|
{
|
||||||
case NodeGroupID.HVPower:
|
NodeGroupID.HVPower => Loc.GetString("node-container-component-on-examine-details-hvpower") + "\n",
|
||||||
message.AddMarkup(
|
NodeGroupID.MVPower => Loc.GetString("node-container-component-on-examine-details-mvpower") + "\n",
|
||||||
Loc.GetString("node-container-component-on-examine-details-hvpower") + "\n");
|
NodeGroupID.Apc => Loc.GetString("node-container-component-on-examine-details-apc") + "\n",
|
||||||
break;
|
_ => ""
|
||||||
case NodeGroupID.MVPower:
|
});
|
||||||
message.AddMarkup(
|
|
||||||
Loc.GetString("node-container-component-on-examine-details-mvpower") + "\n");
|
|
||||||
break;
|
|
||||||
case NodeGroupID.Apc:
|
|
||||||
message.AddMarkup(
|
|
||||||
Loc.GetString("node-container-component-on-examine-details-apc") + "\n");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ using Robust.Shared.Localization;
|
|||||||
using Robust.Shared.Player;
|
using Robust.Shared.Player;
|
||||||
using Robust.Shared.Random;
|
using Robust.Shared.Random;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
using Robust.Shared.Utility.Markup;
|
||||||
|
|
||||||
namespace Content.Server.Nutrition.EntitySystems
|
namespace Content.Server.Nutrition.EntitySystems
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ using Robust.Shared.IoC;
|
|||||||
using Robust.Shared.Localization;
|
using Robust.Shared.Localization;
|
||||||
using Robust.Shared.Serialization.Manager.Attributes;
|
using Robust.Shared.Serialization.Manager.Attributes;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
using Robust.Shared.Utility.Markup;
|
||||||
using Robust.Shared.ViewVariables;
|
using Robust.Shared.ViewVariables;
|
||||||
|
|
||||||
namespace Content.Server.Paper
|
namespace Content.Server.Paper
|
||||||
@@ -60,7 +61,7 @@ namespace Content.Server.Paper
|
|||||||
UserInterface?.SetState(new PaperBoundUserInterfaceState(Content, _mode));
|
UserInterface?.SetState(new PaperBoundUserInterfaceState(Content, _mode));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Examine(FormattedMessage message, bool inDetailsRange)
|
public void Examine(FormattedMessage.Builder message, bool inDetailsRange)
|
||||||
{
|
{
|
||||||
if (!inDetailsRange)
|
if (!inDetailsRange)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ using Robust.Shared.Maths;
|
|||||||
using Robust.Shared.Physics;
|
using Robust.Shared.Physics;
|
||||||
using Robust.Shared.Serialization.Manager.Attributes;
|
using Robust.Shared.Serialization.Manager.Attributes;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
using Robust.Shared.Utility.Markup;
|
||||||
using Robust.Shared.ViewVariables;
|
using Robust.Shared.ViewVariables;
|
||||||
|
|
||||||
namespace Content.Server.Power.Components
|
namespace Content.Server.Power.Components
|
||||||
@@ -98,7 +99,7 @@ namespace Content.Server.Power.Components
|
|||||||
///<summary>
|
///<summary>
|
||||||
///Adds some markup to the examine text of whatever object is using this component to tell you if it's powered or not, even if it doesn't have an icon state to do this for you.
|
///Adds some markup to the examine text of whatever object is using this component to tell you if it's powered or not, even if it doesn't have an icon state to do this for you.
|
||||||
///</summary>
|
///</summary>
|
||||||
public void Examine(FormattedMessage message, bool inDetailsRange)
|
public void Examine(FormattedMessage.Builder message, bool inDetailsRange)
|
||||||
{
|
{
|
||||||
message.AddMarkup(Loc.GetString("power-receiver-component-on-examine-main",
|
message.AddMarkup(Loc.GetString("power-receiver-component-on-examine-main",
|
||||||
("stateText", Loc.GetString( Powered ? "power-receiver-component-on-examine-powered" :
|
("stateText", Loc.GetString( Powered ? "power-receiver-component-on-examine-powered" :
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ using Robust.Shared.GameObjects;
|
|||||||
using Robust.Shared.Localization;
|
using Robust.Shared.Localization;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
using Robust.Shared.ViewVariables;
|
using Robust.Shared.ViewVariables;
|
||||||
|
using Robust.Shared.Utility.Markup;
|
||||||
|
|
||||||
namespace Content.Server.Power.Components
|
namespace Content.Server.Power.Components
|
||||||
{
|
{
|
||||||
@@ -16,7 +17,7 @@ namespace Content.Server.Power.Components
|
|||||||
[ViewVariables]
|
[ViewVariables]
|
||||||
[ComponentDependency] private BatteryComponent? _battery = default!;
|
[ComponentDependency] private BatteryComponent? _battery = default!;
|
||||||
|
|
||||||
void IExamine.Examine(FormattedMessage message, bool inDetailsRange)
|
void IExamine.Examine(FormattedMessage.Builder message, bool inDetailsRange)
|
||||||
{
|
{
|
||||||
if (_battery == null)
|
if (_battery == null)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ using Robust.Shared.IoC;
|
|||||||
using Robust.Shared.Localization;
|
using Robust.Shared.Localization;
|
||||||
using Robust.Shared.Serialization.Manager.Attributes;
|
using Robust.Shared.Serialization.Manager.Attributes;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
using Robust.Shared.Utility.Markup;
|
||||||
using Robust.Shared.ViewVariables;
|
using Robust.Shared.ViewVariables;
|
||||||
|
|
||||||
namespace Content.Server.PowerCell.Components
|
namespace Content.Server.PowerCell.Components
|
||||||
@@ -90,7 +91,7 @@ namespace Content.Server.PowerCell.Components
|
|||||||
return (byte) ContentHelpers.RoundToNearestLevels(fraction, 1, SharedPowerCell.PowerCellVisualsLevels);
|
return (byte) ContentHelpers.RoundToNearestLevels(fraction, 1, SharedPowerCell.PowerCellVisualsLevels);
|
||||||
}
|
}
|
||||||
|
|
||||||
void IExamine.Examine(FormattedMessage message, bool inDetailsRange)
|
void IExamine.Examine(FormattedMessage.Builder message, bool inDetailsRange)
|
||||||
{
|
{
|
||||||
if (inDetailsRange)
|
if (inDetailsRange)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ using Robust.Shared.Localization;
|
|||||||
using Robust.Shared.Player;
|
using Robust.Shared.Player;
|
||||||
using Robust.Shared.Serialization.Manager.Attributes;
|
using Robust.Shared.Serialization.Manager.Attributes;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
using Robust.Shared.Utility.Markup;
|
||||||
using Robust.Shared.ViewVariables;
|
using Robust.Shared.ViewVariables;
|
||||||
|
|
||||||
namespace Content.Server.PowerCell.Components
|
namespace Content.Server.PowerCell.Components
|
||||||
@@ -107,7 +108,7 @@ namespace Content.Server.PowerCell.Components
|
|||||||
_cellContainer = ContainerHelpers.EnsureContainer<ContainerSlot>(Owner, "cellslot_cell_container", out _);
|
_cellContainer = ContainerHelpers.EnsureContainer<ContainerSlot>(Owner, "cellslot_cell_container", out _);
|
||||||
}
|
}
|
||||||
|
|
||||||
void IExamine.Examine(FormattedMessage message, bool inDetailsRange)
|
void IExamine.Examine(FormattedMessage.Builder message, bool inDetailsRange)
|
||||||
{
|
{
|
||||||
if (!inDetailsRange) return;
|
if (!inDetailsRange) return;
|
||||||
string sizeLetter = SlotSize switch
|
string sizeLetter = SlotSize switch
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ using Robust.Shared.IoC;
|
|||||||
using Robust.Shared.Localization;
|
using Robust.Shared.Localization;
|
||||||
using Robust.Shared.Serialization.Manager.Attributes;
|
using Robust.Shared.Serialization.Manager.Attributes;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
using Robust.Shared.Utility.Markup;
|
||||||
using Robust.Shared.ViewVariables;
|
using Robust.Shared.ViewVariables;
|
||||||
|
|
||||||
namespace Content.Server.Radio.Components
|
namespace Content.Server.Radio.Components
|
||||||
@@ -108,7 +109,7 @@ namespace Content.Server.Radio.Components
|
|||||||
Use(eventArgs.User);
|
Use(eventArgs.User);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Examine(FormattedMessage message, bool inDetailsRange)
|
public void Examine(FormattedMessage.Builder message, bool inDetailsRange)
|
||||||
{
|
{
|
||||||
message.AddText(Loc.GetString("handheld-radio-component-on-examine",("frequency", BroadcastFrequency)));
|
message.AddText(Loc.GetString("handheld-radio-component-on-examine",("frequency", BroadcastFrequency)));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ using Robust.Shared.IoC;
|
|||||||
using Robust.Shared.Localization;
|
using Robust.Shared.Localization;
|
||||||
using Robust.Shared.Players;
|
using Robust.Shared.Players;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
using Robust.Shared.Utility.Markup;
|
||||||
using Robust.Shared.ViewVariables;
|
using Robust.Shared.ViewVariables;
|
||||||
|
|
||||||
namespace Content.Server.Suspicion
|
namespace Content.Server.Suspicion
|
||||||
@@ -125,7 +126,7 @@ namespace Content.Server.Suspicion
|
|||||||
Dirty();
|
Dirty();
|
||||||
}
|
}
|
||||||
|
|
||||||
void IExamine.Examine(FormattedMessage message, bool inDetailsRange)
|
void IExamine.Examine(FormattedMessage.Builder message, bool inDetailsRange)
|
||||||
{
|
{
|
||||||
if (!IsDead())
|
if (!IsDead())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ using Robust.Shared.Random;
|
|||||||
using Robust.Shared.Serialization.Manager.Attributes;
|
using Robust.Shared.Serialization.Manager.Attributes;
|
||||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
using Robust.Shared.Utility.Markup;
|
||||||
using Robust.Shared.ViewVariables;
|
using Robust.Shared.ViewVariables;
|
||||||
|
|
||||||
namespace Content.Server.Toilet
|
namespace Content.Server.Toilet
|
||||||
@@ -123,7 +124,7 @@ namespace Content.Server.Toilet
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Examine(FormattedMessage message, bool inDetailsRange)
|
public void Examine(FormattedMessage.Builder message, bool inDetailsRange)
|
||||||
{
|
{
|
||||||
if (inDetailsRange && LidOpen)
|
if (inDetailsRange && LidOpen)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ using Robust.Shared.GameObjects;
|
|||||||
using Robust.Shared.Localization;
|
using Robust.Shared.Localization;
|
||||||
using Robust.Shared.Serialization.Manager.Attributes;
|
using Robust.Shared.Serialization.Manager.Attributes;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
using Robust.Shared.Utility.Markup;
|
||||||
using Robust.Shared.ViewVariables;
|
using Robust.Shared.ViewVariables;
|
||||||
|
|
||||||
namespace Content.Server.Warps
|
namespace Content.Server.Warps
|
||||||
@@ -16,7 +17,7 @@ namespace Content.Server.Warps
|
|||||||
|
|
||||||
[ViewVariables(VVAccess.ReadWrite)] [DataField("location")] public string? Location { get; set; }
|
[ViewVariables(VVAccess.ReadWrite)] [DataField("location")] public string? Location { get; set; }
|
||||||
|
|
||||||
public void Examine(FormattedMessage message, bool inDetailsRange)
|
public void Examine(FormattedMessage.Builder message, bool inDetailsRange)
|
||||||
{
|
{
|
||||||
var loc = Location == null ? "<null>" : $"'{Location}'";
|
var loc = Location == null ? "<null>" : $"'{Location}'";
|
||||||
message.AddText(Loc.GetString("warp-point-component-on-examine-success", ("location", loc)));
|
message.AddText(Loc.GetString("warp-point-component-on-examine-success", ("location", loc)));
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ using Robust.Shared.IoC;
|
|||||||
using Robust.Shared.Localization;
|
using Robust.Shared.Localization;
|
||||||
using Robust.Shared.Serialization.Manager.Attributes;
|
using Robust.Shared.Serialization.Manager.Attributes;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
using Robust.Shared.Utility.Markup;
|
||||||
|
|
||||||
namespace Content.Server.Weapon.Ranged.Ammunition.Components
|
namespace Content.Server.Weapon.Ranged.Ammunition.Components
|
||||||
{
|
{
|
||||||
@@ -214,7 +215,7 @@ namespace Content.Server.Weapon.Ranged.Ammunition.Components
|
|||||||
return TryUse(eventArgs.User);
|
return TryUse(eventArgs.User);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Examine(FormattedMessage message, bool inDetailsRange)
|
public void Examine(FormattedMessage.Builder message, bool inDetailsRange)
|
||||||
{
|
{
|
||||||
message.AddMarkup("\n" + Loc.GetString("ammo-box-component-on-examine-caliber-description", ("caliber", _caliber)));
|
message.AddMarkup("\n" + Loc.GetString("ammo-box-component-on-examine-caliber-description", ("caliber", _caliber)));
|
||||||
message.AddMarkup("\n" + Loc.GetString("ammo-box-component-on-examine-remaining-ammo-description", ("ammoLeft",AmmoLeft),("capacity", _capacity)));
|
message.AddMarkup("\n" + Loc.GetString("ammo-box-component-on-examine-remaining-ammo-description", ("ammoLeft",AmmoLeft),("capacity", _capacity)));
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ using Robust.Shared.Serialization;
|
|||||||
using Robust.Shared.Serialization.Manager.Attributes;
|
using Robust.Shared.Serialization.Manager.Attributes;
|
||||||
using Robust.Shared.Timing;
|
using Robust.Shared.Timing;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
using Robust.Shared.Utility.Markup;
|
||||||
|
|
||||||
namespace Content.Server.Weapon.Ranged.Ammunition.Components
|
namespace Content.Server.Weapon.Ranged.Ammunition.Components
|
||||||
{
|
{
|
||||||
@@ -156,7 +157,7 @@ namespace Content.Server.Weapon.Ranged.Ammunition.Components
|
|||||||
EntitySystem.Get<EffectSystem>().CreateParticle(message);
|
EntitySystem.Get<EffectSystem>().CreateParticle(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Examine(FormattedMessage message, bool inDetailsRange)
|
public void Examine(FormattedMessage.Builder message, bool inDetailsRange)
|
||||||
{
|
{
|
||||||
var text = Loc.GetString("ammo-component-on-examine",("caliber", Caliber));
|
var text = Loc.GetString("ammo-component-on-examine",("caliber", Caliber));
|
||||||
message.AddMarkup(text);
|
message.AddMarkup(text);
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ using Robust.Shared.IoC;
|
|||||||
using Robust.Shared.Localization;
|
using Robust.Shared.Localization;
|
||||||
using Robust.Shared.Serialization.Manager.Attributes;
|
using Robust.Shared.Serialization.Manager.Attributes;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
using Robust.Shared.Utility.Markup;
|
||||||
|
|
||||||
namespace Content.Server.Weapon.Ranged.Ammunition.Components
|
namespace Content.Server.Weapon.Ranged.Ammunition.Components
|
||||||
{
|
{
|
||||||
@@ -168,7 +169,7 @@ namespace Content.Server.Weapon.Ranged.Ammunition.Components
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Examine(FormattedMessage message, bool inDetailsRange)
|
public void Examine(FormattedMessage.Builder message, bool inDetailsRange)
|
||||||
{
|
{
|
||||||
var text = Loc.GetString("ranged-magazine-component-on-examine", ("magazineType", MagazineType),("caliber", Caliber));
|
var text = Loc.GetString("ranged-magazine-component-on-examine", ("magazineType", MagazineType),("caliber", Caliber));
|
||||||
message.AddMarkup(text);
|
message.AddMarkup(text);
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ using Robust.Shared.Map;
|
|||||||
using Robust.Shared.Player;
|
using Robust.Shared.Player;
|
||||||
using Robust.Shared.Serialization.Manager.Attributes;
|
using Robust.Shared.Serialization.Manager.Attributes;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
using Robust.Shared.Utility.Markup;
|
||||||
using Robust.Shared.ViewVariables;
|
using Robust.Shared.ViewVariables;
|
||||||
|
|
||||||
namespace Content.Server.Weapon.Ranged.Barrels.Components
|
namespace Content.Server.Weapon.Ranged.Barrels.Components
|
||||||
@@ -328,7 +329,7 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Examine(FormattedMessage message, bool inDetailsRange)
|
public override void Examine(FormattedMessage.Builder message, bool inDetailsRange)
|
||||||
{
|
{
|
||||||
base.Examine(message, inDetailsRange);
|
base.Examine(message, inDetailsRange);
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ using Robust.Shared.Player;
|
|||||||
using Robust.Shared.Serialization;
|
using Robust.Shared.Serialization;
|
||||||
using Robust.Shared.Serialization.Manager.Attributes;
|
using Robust.Shared.Serialization.Manager.Attributes;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
using Robust.Shared.Utility.Markup;
|
||||||
using Robust.Shared.ViewVariables;
|
using Robust.Shared.ViewVariables;
|
||||||
|
|
||||||
namespace Content.Server.Weapon.Ranged.Barrels.Components
|
namespace Content.Server.Weapon.Ranged.Barrels.Components
|
||||||
@@ -237,7 +238,7 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components
|
|||||||
return TryInsertBullet(eventArgs);
|
return TryInsertBullet(eventArgs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Examine(FormattedMessage message, bool inDetailsRange)
|
public override void Examine(FormattedMessage.Builder message, bool inDetailsRange)
|
||||||
{
|
{
|
||||||
base.Examine(message, inDetailsRange);
|
base.Examine(message, inDetailsRange);
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ using Robust.Shared.Map;
|
|||||||
using Robust.Shared.Player;
|
using Robust.Shared.Player;
|
||||||
using Robust.Shared.Serialization.Manager.Attributes;
|
using Robust.Shared.Serialization.Manager.Attributes;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
using Robust.Shared.Utility.Markup;
|
||||||
using Robust.Shared.ViewVariables;
|
using Robust.Shared.ViewVariables;
|
||||||
|
|
||||||
namespace Content.Server.Weapon.Ranged.Barrels.Components
|
namespace Content.Server.Weapon.Ranged.Barrels.Components
|
||||||
@@ -430,7 +431,7 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Examine(FormattedMessage message, bool inDetailsRange)
|
public override void Examine(FormattedMessage.Builder message, bool inDetailsRange)
|
||||||
{
|
{
|
||||||
base.Examine(message, inDetailsRange);
|
base.Examine(message, inDetailsRange);
|
||||||
|
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ using Robust.Shared.Serialization;
|
|||||||
using Robust.Shared.Serialization.Manager.Attributes;
|
using Robust.Shared.Serialization.Manager.Attributes;
|
||||||
using Robust.Shared.Timing;
|
using Robust.Shared.Timing;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
using Robust.Shared.Utility.Markup;
|
||||||
|
|
||||||
namespace Content.Server.Weapon.Ranged.Barrels.Components
|
namespace Content.Server.Weapon.Ranged.Barrels.Components
|
||||||
{
|
{
|
||||||
@@ -407,7 +408,7 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
public virtual void Examine(FormattedMessage message, bool inDetailsRange)
|
public virtual void Examine(FormattedMessage.Builder message, bool inDetailsRange)
|
||||||
{
|
{
|
||||||
var fireRateMessage = Loc.GetString(FireRateSelector switch
|
var fireRateMessage = Loc.GetString(FireRateSelector switch
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ using Robust.Shared.Player;
|
|||||||
using Robust.Shared.Serialization.Manager.Attributes;
|
using Robust.Shared.Serialization.Manager.Attributes;
|
||||||
using Robust.Shared.Timing;
|
using Robust.Shared.Timing;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
using Robust.Shared.Utility.Markup;
|
||||||
using Robust.Shared.ViewVariables;
|
using Robust.Shared.ViewVariables;
|
||||||
|
|
||||||
namespace Content.Server.Window
|
namespace Content.Server.Window
|
||||||
@@ -42,7 +43,7 @@ namespace Content.Server.Window
|
|||||||
[DataField("knockSound")]
|
[DataField("knockSound")]
|
||||||
private SoundSpecifier _knockSound = new SoundPathSpecifier("/Audio/Effects/glass_knock.ogg");
|
private SoundSpecifier _knockSound = new SoundPathSpecifier("/Audio/Effects/glass_knock.ogg");
|
||||||
|
|
||||||
void IExamine.Examine(FormattedMessage message, bool inDetailsRange)
|
void IExamine.Examine(FormattedMessage.Builder message, bool inDetailsRange)
|
||||||
{
|
{
|
||||||
if (!_entMan.TryGetComponent(Owner, out DamageableComponent? damageable) ||
|
if (!_entMan.TryGetComponent(Owner, out DamageableComponent? damageable) ||
|
||||||
!_entMan.TryGetComponent(Owner, out DestructibleComponent? destructible))
|
!_entMan.TryGetComponent(Owner, out DestructibleComponent? destructible))
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ using Robust.Shared.Random;
|
|||||||
using Robust.Shared.Serialization.Manager.Attributes;
|
using Robust.Shared.Serialization.Manager.Attributes;
|
||||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
using Robust.Shared.Utility.Markup;
|
||||||
using Robust.Shared.ViewVariables;
|
using Robust.Shared.ViewVariables;
|
||||||
|
|
||||||
namespace Content.Server.WireHacking
|
namespace Content.Server.WireHacking
|
||||||
@@ -534,7 +535,7 @@ namespace Content.Server.WireHacking
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void IExamine.Examine(FormattedMessage message, bool inDetailsRange)
|
void IExamine.Examine(FormattedMessage.Builder message, bool inDetailsRange)
|
||||||
{
|
{
|
||||||
message.AddMarkup(Loc.GetString(IsPanelOpen
|
message.AddMarkup(Loc.GetString(IsPanelOpen
|
||||||
? "wires-component-on-examine-panel-open"
|
? "wires-component-on-examine-panel-open"
|
||||||
|
|||||||
@@ -36,13 +36,13 @@ namespace Content.Shared.Actions.Prototypes
|
|||||||
/// Name to show in UI. Accepts formatting.
|
/// Name to show in UI. Accepts formatting.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DataField("name")]
|
[DataField("name")]
|
||||||
public FormattedMessage Name { get; private set; } = new();
|
public FormattedMessage Name { get; private set; } = FormattedMessage.Empty;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Description to show in UI. Accepts formatting.
|
/// Description to show in UI. Accepts formatting.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DataField("description")]
|
[DataField("description")]
|
||||||
public FormattedMessage Description { get; } = new();
|
public FormattedMessage Description { get; } = FormattedMessage.Empty;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Requirements message to show in UI. Accepts formatting, but generally should be avoided
|
/// Requirements message to show in UI. Accepts formatting, but generally should be avoided
|
||||||
@@ -101,8 +101,10 @@ namespace Content.Shared.Actions.Prototypes
|
|||||||
|
|
||||||
public virtual void AfterDeserialization()
|
public virtual void AfterDeserialization()
|
||||||
{
|
{
|
||||||
Name = new FormattedMessage();
|
Name = new FormattedMessage(new []
|
||||||
Name.AddText(ID);
|
{
|
||||||
|
new Section {Content=ID}
|
||||||
|
});
|
||||||
|
|
||||||
if (BehaviorType == BehaviorType.None)
|
if (BehaviorType == BehaviorType.None)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -39,13 +39,13 @@ namespace Content.Shared.Alert
|
|||||||
/// Name to show in tooltip window. Accepts formatting.
|
/// Name to show in tooltip window. Accepts formatting.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DataField("name")]
|
[DataField("name")]
|
||||||
public FormattedMessage Name { get; private set; } = new();
|
public FormattedMessage Name { get; private set; } = FormattedMessage.Empty;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Description to show in tooltip window. Accepts formatting.
|
/// Description to show in tooltip window. Accepts formatting.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DataField("description")]
|
[DataField("description")]
|
||||||
public FormattedMessage Description { get; private set; } = new();
|
public FormattedMessage Description { get; private set; } = FormattedMessage.Empty;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Category the alert belongs to. Only one alert of a given category
|
/// Category the alert belongs to. Only one alert of a given category
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
using Robust.Shared.Localization;
|
using Robust.Shared.Localization;
|
||||||
using Robust.Shared.Serialization.Manager.Attributes;
|
using Robust.Shared.Serialization.Manager.Attributes;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
using Robust.Shared.Utility.Markup;
|
||||||
|
|
||||||
namespace Content.Shared.Construction.Steps
|
namespace Content.Shared.Construction.Steps
|
||||||
{
|
{
|
||||||
@@ -16,7 +17,7 @@ namespace Content.Shared.Construction.Steps
|
|||||||
if (string.IsNullOrEmpty(Name))
|
if (string.IsNullOrEmpty(Name))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
examinedEvent.Message.AddMarkup(Loc.GetString("construction-insert-arbitrary-entity", ("stepName", Name)));
|
examinedEvent.Message.AddMessage(Basic.RenderMarkup(Loc.GetString("construction-insert-arbitrary-entity", ("stepName", Name))));
|
||||||
}
|
}
|
||||||
|
|
||||||
public override ConstructionGuideEntry GenerateGuideEntry()
|
public override ConstructionGuideEntry GenerateGuideEntry()
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
using Robust.Shared.Localization;
|
using Robust.Shared.Localization;
|
||||||
using Robust.Shared.Serialization.Manager.Attributes;
|
using Robust.Shared.Serialization.Manager.Attributes;
|
||||||
|
using Robust.Shared.Utility.Markup;
|
||||||
|
|
||||||
namespace Content.Shared.Construction.Steps
|
namespace Content.Shared.Construction.Steps
|
||||||
{
|
{
|
||||||
@@ -23,13 +24,15 @@ namespace Content.Shared.Construction.Steps
|
|||||||
|
|
||||||
public override void DoExamine(ExaminedEvent examinedEvent)
|
public override void DoExamine(ExaminedEvent examinedEvent)
|
||||||
{
|
{
|
||||||
examinedEvent.Message.AddMarkup(string.IsNullOrEmpty(Name)
|
examinedEvent.Message.AddMessage(
|
||||||
|
Basic.RenderMarkup(string.IsNullOrEmpty(Name)
|
||||||
? Loc.GetString(
|
? Loc.GetString(
|
||||||
"construction-insert-entity-with-component",
|
"construction-insert-entity-with-component",
|
||||||
("componentName", Component))// Terrible.
|
("componentName", Component))// Terrible.
|
||||||
: Loc.GetString(
|
: Loc.GetString(
|
||||||
"construction-insert-exact-entity",
|
"construction-insert-exact-entity",
|
||||||
("entityName", Name)));
|
("entityName", Name))
|
||||||
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ using Robust.Shared.Localization;
|
|||||||
using Robust.Shared.Prototypes;
|
using Robust.Shared.Prototypes;
|
||||||
using Robust.Shared.Serialization.Manager.Attributes;
|
using Robust.Shared.Serialization.Manager.Attributes;
|
||||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
||||||
|
using Robust.Shared.Utility.Markup;
|
||||||
|
|
||||||
namespace Content.Shared.Construction.Steps
|
namespace Content.Shared.Construction.Steps
|
||||||
{
|
{
|
||||||
@@ -24,7 +25,7 @@ namespace Content.Shared.Construction.Steps
|
|||||||
{
|
{
|
||||||
var material = IoCManager.Resolve<IPrototypeManager>().Index<StackPrototype>(MaterialPrototypeId);
|
var material = IoCManager.Resolve<IPrototypeManager>().Index<StackPrototype>(MaterialPrototypeId);
|
||||||
|
|
||||||
examinedEvent.Message.AddMarkup(Loc.GetString("construction-insert-material-entity", ("amount", Amount), ("materialName", material.Name)));
|
examinedEvent.Message.AddMessage(Basic.RenderMarkup(Loc.GetString("construction-insert-material-entity", ("amount", Amount), ("materialName", material.Name))));
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool EntityValid(EntityUid uid, IEntityManager entityManager)
|
public override bool EntityValid(EntityUid uid, IEntityManager entityManager)
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
using Robust.Shared.Localization;
|
using Robust.Shared.Localization;
|
||||||
using Robust.Shared.Serialization.Manager.Attributes;
|
using Robust.Shared.Serialization.Manager.Attributes;
|
||||||
|
using Robust.Shared.Utility.Markup;
|
||||||
|
|
||||||
namespace Content.Shared.Construction.Steps
|
namespace Content.Shared.Construction.Steps
|
||||||
{
|
{
|
||||||
@@ -17,7 +18,8 @@ namespace Content.Shared.Construction.Steps
|
|||||||
|
|
||||||
public override void DoExamine(ExaminedEvent examinedEvent)
|
public override void DoExamine(ExaminedEvent examinedEvent)
|
||||||
{
|
{
|
||||||
examinedEvent.Message.AddMarkup(string.IsNullOrEmpty(Name)
|
var nb = new Basic();
|
||||||
|
nb.AddMarkup(string.IsNullOrEmpty(Name)
|
||||||
? Loc.GetString(
|
? Loc.GetString(
|
||||||
"construction-insert-prototype-no-name",
|
"construction-insert-prototype-no-name",
|
||||||
("prototypeName", Prototype) // Terrible.
|
("prototypeName", Prototype) // Terrible.
|
||||||
@@ -26,6 +28,8 @@ namespace Content.Shared.Construction.Steps
|
|||||||
"construction-insert-prototype",
|
"construction-insert-prototype",
|
||||||
("entityName", Name)
|
("entityName", Name)
|
||||||
));
|
));
|
||||||
|
|
||||||
|
examinedEvent.Message.AddMessage(nb.Render());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ using Robust.Shared.Map;
|
|||||||
using Robust.Shared.Maths;
|
using Robust.Shared.Maths;
|
||||||
using Robust.Shared.Physics;
|
using Robust.Shared.Physics;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
using Robust.Shared.Utility.Markup;
|
||||||
using static Content.Shared.Interaction.SharedInteractionSystem;
|
using static Content.Shared.Interaction.SharedInteractionSystem;
|
||||||
|
|
||||||
namespace Content.Shared.Examine
|
namespace Content.Shared.Examine
|
||||||
@@ -25,7 +26,7 @@ namespace Content.Shared.Examine
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="message">The message to append to which will be displayed.</param>
|
/// <param name="message">The message to append to which will be displayed.</param>
|
||||||
/// <param name="inDetailsRange">Whether the examiner is within the 'Details' range, allowing you to show information logically only availabe when close to the examined entity.</param>
|
/// <param name="inDetailsRange">Whether the examiner is within the 'Details' range, allowing you to show information logically only availabe when close to the examined entity.</param>
|
||||||
void Examine(FormattedMessage message, bool inDetailsRange);
|
void Examine(FormattedMessage.Builder message, bool inDetailsRange);
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract class ExamineSystemShared : EntitySystem
|
public abstract class ExamineSystemShared : EntitySystem
|
||||||
@@ -212,11 +213,11 @@ namespace Content.Shared.Examine
|
|||||||
|
|
||||||
public FormattedMessage GetExamineText(EntityUid entity, EntityUid? examiner)
|
public FormattedMessage GetExamineText(EntityUid entity, EntityUid? examiner)
|
||||||
{
|
{
|
||||||
var message = new FormattedMessage();
|
var message = new FormattedMessage.Builder();
|
||||||
|
|
||||||
if (examiner == null)
|
if (examiner == null)
|
||||||
{
|
{
|
||||||
return message;
|
return new(new Section[] {});
|
||||||
}
|
}
|
||||||
|
|
||||||
var doNewline = false;
|
var doNewline = false;
|
||||||
@@ -238,21 +239,15 @@ namespace Content.Shared.Examine
|
|||||||
//Add component statuses from components that report one
|
//Add component statuses from components that report one
|
||||||
foreach (var examineComponent in EntityManager.GetComponents<IExamine>(entity))
|
foreach (var examineComponent in EntityManager.GetComponents<IExamine>(entity))
|
||||||
{
|
{
|
||||||
var subMessage = new FormattedMessage();
|
examineComponent.Examine(message, isInDetailsRange);
|
||||||
examineComponent.Examine(subMessage, isInDetailsRange);
|
|
||||||
if (subMessage.Tags.Count == 0)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (doNewline)
|
if (doNewline)
|
||||||
message.AddText("\n");
|
message.AddText("\n");
|
||||||
|
|
||||||
message.AddMessage(subMessage);
|
|
||||||
doNewline = true;
|
doNewline = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
message.Pop();
|
return message.Build();
|
||||||
|
|
||||||
return message;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -269,7 +264,7 @@ namespace Content.Shared.Examine
|
|||||||
/// <seealso cref="PushMessage"/>
|
/// <seealso cref="PushMessage"/>
|
||||||
/// <seealso cref="PushMarkup"/>
|
/// <seealso cref="PushMarkup"/>
|
||||||
/// <seealso cref="PushText"/>
|
/// <seealso cref="PushText"/>
|
||||||
public FormattedMessage Message { get; }
|
public FormattedMessage.Builder Message { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The entity performing the examining.
|
/// The entity performing the examining.
|
||||||
@@ -288,7 +283,7 @@ namespace Content.Shared.Examine
|
|||||||
|
|
||||||
private bool _doNewLine;
|
private bool _doNewLine;
|
||||||
|
|
||||||
public ExaminedEvent(FormattedMessage message, EntityUid examined, EntityUid examiner, bool isInDetailsRange, bool doNewLine)
|
public ExaminedEvent(FormattedMessage.Builder message, EntityUid examined, EntityUid examiner, bool isInDetailsRange, bool doNewLine)
|
||||||
{
|
{
|
||||||
Message = message;
|
Message = message;
|
||||||
Examined = examined;
|
Examined = examined;
|
||||||
@@ -304,9 +299,6 @@ namespace Content.Shared.Examine
|
|||||||
/// <seealso cref="PushText"/>
|
/// <seealso cref="PushText"/>
|
||||||
public void PushMessage(FormattedMessage message)
|
public void PushMessage(FormattedMessage message)
|
||||||
{
|
{
|
||||||
if (message.Tags.Count == 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (_doNewLine)
|
if (_doNewLine)
|
||||||
Message.AddText("\n");
|
Message.AddText("\n");
|
||||||
|
|
||||||
@@ -321,7 +313,7 @@ namespace Content.Shared.Examine
|
|||||||
/// <seealso cref="PushMessage"/>
|
/// <seealso cref="PushMessage"/>
|
||||||
public void PushMarkup(string markup)
|
public void PushMarkup(string markup)
|
||||||
{
|
{
|
||||||
PushMessage(FormattedMessage.FromMarkup(markup));
|
PushMessage(Basic.RenderMarkup(markup));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -329,11 +321,6 @@ namespace Content.Shared.Examine
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <seealso cref="PushMarkup"/>
|
/// <seealso cref="PushMarkup"/>
|
||||||
/// <seealso cref="PushMessage"/>
|
/// <seealso cref="PushMessage"/>
|
||||||
public void PushText(string text)
|
public void PushText(string text) => Message.AddText(text);
|
||||||
{
|
|
||||||
var msg = new FormattedMessage();
|
|
||||||
msg.AddText(text);
|
|
||||||
PushMessage(msg);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user