Files
crystall-punk-14/Content.Client/Info/DevInfoBanner.cs

39 lines
1.3 KiB
C#
Raw Permalink Normal View History

2022-03-13 19:33:19 -07:00
using Content.Client.Changelog;
using Content.Client.Credits;
2022-12-03 02:23:43 +01:00
using Content.Shared.CCVar;
2022-03-13 19:33:19 -07:00
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
2022-12-03 02:23:43 +01:00
using Robust.Shared.Configuration;
2022-03-13 19:33:19 -07:00
using Robust.Shared.IoC;
using Robust.Shared.Localization;
using Robust.Shared.Utility;
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>();
2022-12-03 02:23:43 +01:00
var cfg = IoCManager.Resolve<IConfigurationManager>();
2022-03-13 19:33:19 -07:00
2022-12-03 02:23:43 +01:00
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);
}
2022-03-13 19:33:19 -07:00
var creditsButton = new Button {Text = Loc.GetString("server-info-credits-button")};
creditsButton.OnPressed += args => new CreditsWindow().Open();
buttons.AddChild(creditsButton);
}
}
}