CatStation/Content.Client/Options/UI/EscapeMenu.xaml.cs
SlamBamActionman 33f899f656
Add a Report Bugs button to the escape menu (#45807)
* Initial commit

* refactor: cleanup of related code

---------

Co-authored-by: Fildrance <fildrance@gmail.com>
2026-09-03 11:03:46 +00:00

31 lines
927 B
C#

using Content.Shared.CCVar;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Configuration;
namespace Content.Client.Options.UI;
[GenerateTypedNameReferences]
public sealed partial class EscapeMenu : DefaultWindow
{
public EscapeMenu()
{
RobustXamlLoader.Load(this);
// TODO: removed with https://github.com/space-wizards/space-station-14/pull/44431
var uriOpener = IoCManager.Resolve<IUriOpener>();
var cfg = IoCManager.Resolve<IConfigurationManager>();
var bugReport = cfg.GetCVar(CCVars.InfoLinksBugReport);
if (!string.IsNullOrWhiteSpace(bugReport))
{
BugReportButton.OnPressed += _ => uriOpener.OpenUri(bugReport);
}
else
{
BugReportButton.Visible = false;
}
}
}