From 6efe88a3d1bd97473b6ef7252c786572c2b6493e Mon Sep 17 00:00:00 2001 From: Cooderer <31316111+Cooderer@users.noreply.github.com> Date: Wed, 9 Aug 2023 14:19:13 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9A=D0=BD=D0=BE=D0=BF=D0=BA=D0=B0=20=D0=B2?= =?UTF-8?q?=20=D0=BF=D1=80=D0=B0=D0=B2=D0=B8=D0=BB=D0=B0=D1=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ссылка на правила по кнопке --- Content.Client/Info/RulesManager.cs | 7 + Content.Client/Info/RulesPopup.xaml | 4 +- Content.Client/Info/RulesPopup.xaml.cs | 28 +++- Content.Shared/CCVar/CCVars.cs | 6 + Resources/Locale/en-US/info/rules.ftl | 1 + Resources/Locale/ru-RU/info/rules.ftl | 1 + Resources/ServerInfo/LRP_RulesAruMoon.txt | 192 +--------------------- 7 files changed, 38 insertions(+), 201 deletions(-) diff --git a/Content.Client/Info/RulesManager.cs b/Content.Client/Info/RulesManager.cs index 76e7c34e5f2c97..db0bbc367af989 100644 --- a/Content.Client/Info/RulesManager.cs +++ b/Content.Client/Info/RulesManager.cs @@ -19,6 +19,8 @@ public sealed class RulesManager : SharedRulesManager [Dependency] private readonly IClientConsoleHost _consoleHost = default!; [Dependency] private readonly INetManager _netManager = default!; [Dependency] private readonly IEntitySystemManager _sysMan = default!; + [Dependency] private readonly IUriOpener _uri = default!; + [Dependency] private readonly IConfigurationManager _cfg = default!; private InfoSection rulesSection = new InfoSection("", "", false); private bool _shouldShowRules = false; @@ -73,6 +75,7 @@ private void ShowRules(float time) _activePopup.OnQuitPressed += OnQuitPressed; _activePopup.OnAcceptPressed += OnAcceptPressed; + _activePopup.OnToWikiSend += OnToWikiSendPressed; _userInterfaceManager.WindowRoot.AddChild(_activePopup); LayoutContainer.SetAnchorPreset(_activePopup, LayoutContainer.LayoutPreset.Wide); } @@ -89,6 +92,10 @@ private void OnAcceptPressed() _activePopup?.Orphan(); _activePopup = null; } + private void OnToWikiSendPressed() + { + _uri.OpenUri(_cfg.GetCVar(CCVars.InfoLinksWikiRules)); + } public void UpdateRules() { diff --git a/Content.Client/Info/RulesPopup.xaml b/Content.Client/Info/RulesPopup.xaml index ba3cb7f9e1ccb6..65e6dd0e62c4bd 100644 --- a/Content.Client/Info/RulesPopup.xaml +++ b/Content.Client/Info/RulesPopup.xaml @@ -1,4 +1,4 @@ -