mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 10:21:18 +03:00
* Initial commit * refactor: cleanup of related code --------- Co-authored-by: Fildrance <fildrance@gmail.com>
34 lines
1.2 KiB
C#
34 lines
1.2 KiB
C#
using Content.Client.Credits;
|
|
using Content.Shared.CCVar;
|
|
using Robust.Client.UserInterface;
|
|
using Robust.Client.UserInterface.Controls;
|
|
using Robust.Shared.Configuration;
|
|
|
|
namespace Content.Client.Info
|
|
{
|
|
public sealed class DevInfoBanner : BoxContainer
|
|
{
|
|
public DevInfoBanner() {
|
|
var buttons = new BoxContainer
|
|
{
|
|
Orientation = LayoutOrientation.Horizontal
|
|
};
|
|
AddChild(buttons);
|
|
|
|
var uriOpener = IoCManager.Resolve<IUriOpener>();
|
|
var cfg = IoCManager.Resolve<IConfigurationManager>();
|
|
|
|
var bugReport = cfg.GetCVar(CCVars.InfoLinksBugReport);
|
|
if (!string.IsNullOrWhiteSpace(bugReport))
|
|
{
|
|
var reportButton = new Button {Text = Loc.GetString("server-info-report-button")};
|
|
reportButton.OnPressed += _ => uriOpener.OpenUri(bugReport);
|
|
buttons.AddChild(reportButton);
|
|
}
|
|
|
|
var creditsButton = new Button {Text = Loc.GetString("server-info-credits-button")};
|
|
creditsButton.OnPressed += _ => new CreditsWindow().Open();
|
|
buttons.AddChild(creditsButton);
|
|
}
|
|
}
|
|
}
|