mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 10:21:18 +03:00
Add a Report Bugs button to the escape menu (#45807)
* Initial commit * refactor: cleanup of related code --------- Co-authored-by: Fildrance <fildrance@gmail.com>
This commit is contained in:
parent
9773bdcc54
commit
33f899f656
4 changed files with 27 additions and 13 deletions
|
|
@ -1,12 +1,8 @@
|
|||
using Content.Client.Changelog;
|
||||
using Content.Client.Credits;
|
||||
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;
|
||||
|
||||
namespace Content.Client.Info
|
||||
{
|
||||
|
|
@ -23,15 +19,15 @@ namespace Content.Client.Info
|
|||
var cfg = IoCManager.Resolve<IConfigurationManager>();
|
||||
|
||||
var bugReport = cfg.GetCVar(CCVars.InfoLinksBugReport);
|
||||
if (bugReport != "")
|
||||
if (!string.IsNullOrWhiteSpace(bugReport))
|
||||
{
|
||||
var reportButton = new Button {Text = Loc.GetString("server-info-report-button")};
|
||||
reportButton.OnPressed += args => uriOpener.OpenUri(bugReport);
|
||||
reportButton.OnPressed += _ => uriOpener.OpenUri(bugReport);
|
||||
buttons.AddChild(reportButton);
|
||||
}
|
||||
|
||||
var creditsButton = new Button {Text = Loc.GetString("server-info-credits-button")};
|
||||
creditsButton.OnPressed += args => new CreditsWindow().Open();
|
||||
creditsButton.OnPressed += _ => new CreditsWindow().Open();
|
||||
buttons.AddChild(creditsButton);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<ui1:EscapeMenu xmlns="https://spacestation14.io"
|
||||
<ui1:EscapeMenu xmlns="https://spacestation14.io"
|
||||
xmlns:changelog="clr-namespace:Content.Client.Changelog"
|
||||
xmlns:ui="clr-namespace:Content.Client.Voting.UI"
|
||||
xmlns:ui1="clr-namespace:Content.Client.Options.UI"
|
||||
|
|
@ -14,6 +14,7 @@
|
|||
<Button Access="Public" Name="WikiButton" Text="{Loc 'ui-escape-wiki'}" StyleClasses="OpenBoth" />
|
||||
<changelog:ChangelogButton Access="Public" Name="ChangelogButton" StyleClasses="OpenBoth"/>
|
||||
<Button Access="Public" Name="FeedbackButton" Text="{Loc 'ui-escape-feedback'}" StyleClasses="OpenBoth"/>
|
||||
<Button Access="Public" Name="BugReportButton" Text="{Loc 'ui-escape-bug-report'}" StyleClasses="OpenBoth"/>
|
||||
<Button Access="Public" Name="AdminRemarksButton" Text="{Loc 'ui-escape-remarks'}" StyleClasses="OpenRight"/>
|
||||
<PanelContainer StyleClasses="LowDivider" Margin="0 2.5 0 2.5" />
|
||||
<Button Access="Public" Name="OptionsButton" Text="{Loc 'ui-escape-options'}" />
|
||||
|
|
|
|||
|
|
@ -1,15 +1,31 @@
|
|||
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
|
||||
namespace Content.Client.Options.UI;
|
||||
|
||||
[GenerateTypedNameReferences]
|
||||
public sealed partial class EscapeMenu : DefaultWindow
|
||||
{
|
||||
[GenerateTypedNameReferences]
|
||||
public sealed partial class EscapeMenu : DefaultWindow
|
||||
public EscapeMenu()
|
||||
{
|
||||
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))
|
||||
{
|
||||
RobustXamlLoader.Load(this);
|
||||
BugReportButton.OnPressed += _ => uriOpener.OpenUri(bugReport);
|
||||
}
|
||||
else
|
||||
{
|
||||
BugReportButton.Visible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ ui-escape-wiki = Wiki
|
|||
ui-escape-disconnect = Disconnect
|
||||
ui-escape-quit = Quit
|
||||
ui-escape-feedback = Feedback
|
||||
ui-escape-bug-report = Report Bugs
|
||||
ui-escape-remarks = Admin Remarks
|
||||
|
||||
ui-escape-remarks-button-disabled = This functionality has been disabled by the server.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue