* 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
70 lines
2.3 KiB
C#
70 lines
2.3 KiB
C#
using Content.Client.Changelog;
|
|
using Content.Client.Credits;
|
|
using Content.Client.Links;
|
|
using Robust.Client.UserInterface;
|
|
using Robust.Client.UserInterface.Controls;
|
|
using Robust.Shared.IoC;
|
|
using Robust.Shared.Localization;
|
|
using Robust.Shared.Utility;
|
|
using Robust.Shared.Utility.Markup;
|
|
|
|
namespace Content.Client.Info
|
|
{
|
|
public class ServerInfo : BoxContainer
|
|
{
|
|
private readonly RichTextLabel _richTextLabel;
|
|
|
|
public ServerInfo()
|
|
{
|
|
Orientation = LayoutOrientation.Vertical;
|
|
|
|
_richTextLabel = new RichTextLabel
|
|
{
|
|
VerticalExpand = true
|
|
};
|
|
AddChild(_richTextLabel);
|
|
|
|
var buttons = new BoxContainer
|
|
{
|
|
Orientation = LayoutOrientation.Horizontal
|
|
};
|
|
AddChild(buttons);
|
|
|
|
var uriOpener = IoCManager.Resolve<IUriOpener>();
|
|
|
|
var rulesButton = new Button() { Text = Loc.GetString("server-info-rules-button") };
|
|
rulesButton.OnPressed += args => new RulesAndInfoWindow().Open();
|
|
|
|
var discordButton = new Button {Text = Loc.GetString("server-info-discord-button") };
|
|
discordButton.OnPressed += args => uriOpener.OpenUri(UILinks.Discord);
|
|
|
|
var websiteButton = new Button {Text = Loc.GetString("server-info-website-button") };
|
|
websiteButton.OnPressed += args => uriOpener.OpenUri(UILinks.Website);
|
|
|
|
var reportButton = new Button { Text = Loc.GetString("server-info-report-button") };
|
|
reportButton.OnPressed += args => uriOpener.OpenUri(UILinks.BugReport);
|
|
|
|
var creditsButton = new Button { Text = Loc.GetString("server-info-credits-button") };
|
|
creditsButton.OnPressed += args => new CreditsWindow().Open();
|
|
|
|
var changelogButton = new ChangelogButton
|
|
{
|
|
HorizontalExpand = true,
|
|
HorizontalAlignment = HAlignment.Right
|
|
};
|
|
|
|
buttons.AddChild(rulesButton);
|
|
buttons.AddChild(discordButton);
|
|
buttons.AddChild(websiteButton);
|
|
buttons.AddChild(reportButton);
|
|
buttons.AddChild(creditsButton);
|
|
buttons.AddChild(changelogButton);
|
|
}
|
|
|
|
public void SetInfoBlob(string markup)
|
|
{
|
|
_richTextLabel.SetMessage(Basic.RenderMarkup(markup));
|
|
}
|
|
}
|
|
}
|