From dbfa90e95678e7e593e6e25bc6085de47b4dde47 Mon Sep 17 00:00:00 2001 From: Vigers Ray Date: Fri, 29 Nov 2024 04:35:28 +0300 Subject: [PATCH] =?UTF-8?q?=D0=97=D0=B2=D1=83=D0=BA=D0=BE=D0=B2=D0=BE?= =?UTF-8?q?=D0=B5=20=D0=BE=D0=BF=D0=BE=D0=B2=D0=B5=D1=89=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5=20=D0=BD=D0=BE=D0=B2=D1=8B=D1=85=20=D1=80=D0=BE=D0=BB?= =?UTF-8?q?=D0=B5=D0=B9=20=D0=B4=D0=BB=D1=8F=20=D0=BF=D1=80=D0=B8=D0=B7?= =?UTF-8?q?=D1=80=D0=B0=D0=BA=D0=BE=D0=B2=20=D0=B8=20=D0=B2=D1=8B=D0=BD?= =?UTF-8?q?=D0=BE=D1=81=20=D0=BF=D1=80=D0=B0=D0=B2=D0=B8=D0=BB=20=D0=B2=20?= =?UTF-8?q?=D0=BE=D1=82=D0=B4=D0=B5=D0=BB=D1=8C=D0=BD=D1=83=D1=8E=20=D0=BA?= =?UTF-8?q?=D0=BD=D0=BE=D0=BF=D0=BA=D1=83.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Content.Client/Ghost/GhostSystem.cs | 14 +++++++ .../Roles/GhostRoleButtonsBox.xaml.cs | 2 + .../Controls/Roles/GhostRoleEntryButtons.xaml | 11 ++++- .../Controls/Roles/GhostRoleRulesWindow.xaml | 6 --- .../Roles/GhostRoleRulesWindow.xaml.cs | 38 +----------------- .../Ghost/Controls/Roles/GhostRolesEui.cs | 23 +++++------ .../Controls/Roles/GhostRolesWindow.xaml.cs | 2 + .../Systems/Ghost/GhostUIController.cs | 2 +- Resources/Audio/_Sunrise/Misc/ping.ogg | Bin 0 -> 9903 bytes Resources/Changelog/ChangelogSunrise.yml | 17 ++++++++ .../Locale/ru-RU/_strings/ghost/ghost-gui.ftl | 1 + 11 files changed, 57 insertions(+), 59 deletions(-) create mode 100644 Resources/Audio/_Sunrise/Misc/ping.ogg diff --git a/Content.Client/Ghost/GhostSystem.cs b/Content.Client/Ghost/GhostSystem.cs index f4f7e3459f..24210187db 100644 --- a/Content.Client/Ghost/GhostSystem.cs +++ b/Content.Client/Ghost/GhostSystem.cs @@ -1,9 +1,11 @@ using Content.Client.Movement.Systems; using Content.Shared.Actions; using Content.Shared.Ghost; +using Robust.Client.Audio; using Robust.Client.Console; using Robust.Client.GameObjects; using Robust.Client.Player; +using Robust.Shared.Audio; using Robust.Shared.Player; namespace Content.Client.Ghost @@ -14,6 +16,7 @@ namespace Content.Client.Ghost [Dependency] private readonly IPlayerManager _playerManager = default!; [Dependency] private readonly SharedActionsSystem _actions = default!; [Dependency] private readonly ContentEyeSystem _contentEye = default!; + [Dependency] private readonly AudioSystem _audioSystem = default!; public int AvailableGhostRoleCount { get; private set; } @@ -156,6 +159,17 @@ namespace Content.Client.Ghost private void OnUpdateGhostRoleCount(GhostUpdateGhostRoleCountEvent msg) { + + if (msg.AvailableGhostRoles > AvailableGhostRoleCount && IsGhost) + { + _audioSystem.PlayGlobal( + "/Audio/_Sunrise/Misc/ping.ogg", + Filter.Local(), + false, + new AudioParams().WithVolume(10f) + ); + } + AvailableGhostRoleCount = msg.AvailableGhostRoles; GhostRoleCountUpdated?.Invoke(msg); } diff --git a/Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRoleButtonsBox.xaml.cs b/Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRoleButtonsBox.xaml.cs index 7df0243416..830e91cbce 100644 --- a/Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRoleButtonsBox.xaml.cs +++ b/Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRoleButtonsBox.xaml.cs @@ -14,6 +14,7 @@ namespace Content.Client.UserInterface.Systems.Ghost.Controls.Roles { private SpriteSystem _spriteSystem; public event Action? OnRoleSelected; + public event Action? OnRoleRules; public event Action? OnRoleFollow; public GhostRoleButtonsBox(bool hasAccess, FormattedMessage? reason, IEnumerable roles, SpriteSystem spriteSystem) @@ -25,6 +26,7 @@ namespace Content.Client.UserInterface.Systems.Ghost.Controls.Roles { var button = new GhostRoleEntryButtons(role); button.RequestButton.OnPressed += _ => OnRoleSelected?.Invoke(role); + button.RulesButton.OnPressed += _ => OnRoleRules?.Invoke(role); button.FollowButton.OnPressed += _ => OnRoleFollow?.Invoke(role); if (!hasAccess) diff --git a/Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRoleEntryButtons.xaml b/Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRoleEntryButtons.xaml index 05c52deef1..917c3929e1 100644 --- a/Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRoleEntryButtons.xaml +++ b/Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRoleEntryButtons.xaml @@ -6,10 +6,17 @@ Text="{Loc 'ghost-roles-window-request-role-button'}" StyleClasses="OpenRight" HorizontalExpand="True" - SizeFlagsStretchRatio="3"/> + SizeFlagsStretchRatio="2"/> +