From 9904daf28a042cbcddd5d17156201778bb982c21 Mon Sep 17 00:00:00 2001 From: Aviu00 <93730715+Aviu00@users.noreply.github.com> Date: Wed, 9 Aug 2023 20:20:37 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A0=D0=B5=D0=B4=D0=B8=D1=80=D0=B5=D0=BA?= =?UTF-8?q?=D1=82=20=D0=BD=D0=B0=20=D0=B2=D0=B8=D0=BA=D0=B8=20=D0=B2=20?= =?UTF-8?q?=D0=BF=D1=80=D0=B0=D0=B2=D0=B8=D0=BB=D0=B0=D1=85=20(#281)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Rules wiki redirect * Better button --- Content.Client/Info/RulesAndInfoWindow.cs | 15 +++++++++++++-- Content.Client/White/Rules/RulesWikiSection.xaml | 11 +++++++++++ .../White/Rules/RulesWikiSection.xaml.cs | 14 ++++++++++++++ Content.Shared/White/WhiteCVars.cs | 8 ++++++++ 4 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 Content.Client/White/Rules/RulesWikiSection.xaml create mode 100644 Content.Client/White/Rules/RulesWikiSection.xaml.cs diff --git a/Content.Client/Info/RulesAndInfoWindow.cs b/Content.Client/Info/RulesAndInfoWindow.cs index 7a763a1d6f..c14bbb60de 100644 --- a/Content.Client/Info/RulesAndInfoWindow.cs +++ b/Content.Client/Info/RulesAndInfoWindow.cs @@ -1,5 +1,7 @@ using System.Numerics; using Content.Client.UserInterface.Systems.EscapeMenu; +using Content.Client.White.Rules; +using Content.Shared.White; using Robust.Client.ResourceManagement; using Robust.Client.UserInterface; using Robust.Client.UserInterface.Controls; @@ -12,7 +14,11 @@ namespace Content.Client.Info public sealed class RulesAndInfoWindow : DefaultWindow { [Dependency] private readonly IResourceManager _resourceManager = default!; - [Dependency] private readonly RulesManager _rules = default!; + // WD EDIT + // [Dependency] private readonly RulesManager _rules = default!; + [Dependency] private readonly IUriOpener _uri = default!; + [Dependency] private readonly IConfigurationManager _cfg = default!; + // WD EDIT END public RulesAndInfoWindow() { @@ -31,7 +37,12 @@ namespace Content.Client.Info TabContainer.SetTabTitle(rulesList, Loc.GetString("ui-info-tab-rules")); TabContainer.SetTabTitle(tutorialList, Loc.GetString("ui-info-tab-tutorial")); - AddSection(rulesList, _rules.RulesSection()); + // WD EDIT + // AddSection(rulesList, _rules.RulesSection()); + var rulesWikiSection = new RulesWikiSection(); + rulesList.InfoContainer.AddChild(rulesWikiSection); + rulesWikiSection.RulesButton.OnPressed += _ => _uri.OpenUri(_cfg.GetCVar(WhiteCVars.RulesWiki)); + // WD EDIT END PopulateTutorial(tutorialList); Contents.AddChild(rootContainer); diff --git a/Content.Client/White/Rules/RulesWikiSection.xaml b/Content.Client/White/Rules/RulesWikiSection.xaml new file mode 100644 index 0000000000..efb136fa3f --- /dev/null +++ b/Content.Client/White/Rules/RulesWikiSection.xaml @@ -0,0 +1,11 @@ + +