Launcher info links. (#12781)

This commit is contained in:
Pieter-Jan Briers
2022-12-03 02:23:43 +01:00
committed by GitHub
parent 083ef009d6
commit a6045e4538
12 changed files with 147 additions and 36 deletions

View File

@@ -1,8 +1,9 @@
using Content.Client.Changelog;
using Content.Client.Credits;
using Content.Client.Links;
using Content.Shared.CCVar;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Shared.Configuration;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
using Robust.Shared.Utility;
@@ -19,13 +20,18 @@ namespace Content.Client.Info
AddChild(buttons);
var uriOpener = IoCManager.Resolve<IUriOpener>();
var cfg = IoCManager.Resolve<IConfigurationManager>();
var reportButton = new Button {Text = Loc.GetString("server-info-report-button")};
reportButton.OnPressed += args => uriOpener.OpenUri(UILinks.BugReport);
var bugReport = cfg.GetCVar(CCVars.InfoLinksBugReport);
if (bugReport != "")
{
var reportButton = new Button {Text = Loc.GetString("server-info-report-button")};
reportButton.OnPressed += args => uriOpener.OpenUri(bugReport);
buttons.AddChild(reportButton);
}
var creditsButton = new Button {Text = Loc.GetString("server-info-credits-button")};
creditsButton.OnPressed += args => new CreditsWindow().Open();
buttons.AddChild(reportButton);
buttons.AddChild(creditsButton);
}
}