Отключение звука новых ролей (#1658)

This commit is contained in:
Babaev 2025-04-04 15:38:31 +06:00 committed by GitHub
parent ec4717482c
commit 2df43d876c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 24 additions and 7 deletions

View file

@ -1,12 +1,14 @@
using Content.Client.Movement.Systems;
using Content.Shared.Actions;
using Content.Shared.Ghost;
using Content.Shared._Sunrise.SunriseCCVars; // Sunrise-Edit
using Robust.Client.Audio;
using Robust.Client.Console;
using Robust.Client.GameObjects;
using Robust.Client.Player;
using Robust.Shared.Audio;
using Robust.Shared.Player;
using Robust.Shared.Configuration; // Sunrise-Edit
namespace Content.Client.Ghost
{
@ -18,6 +20,7 @@ namespace Content.Client.Ghost
[Dependency] private readonly PointLightSystem _pointLightSystem = default!;
[Dependency] private readonly ContentEyeSystem _contentEye = default!;
[Dependency] private readonly AudioSystem _audioSystem = default!;
[Dependency] private readonly IConfigurationManager _cfg = default!; // Sunrise-Edit
public int AvailableGhostRoleCount { get; private set; }
@ -179,15 +182,19 @@ 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)
);
// Sunrise-Edit-Start
if (!_cfg.GetCVar(SunriseCCVars.MuteGhostRoleNotification))
{
_audioSystem.PlayGlobal(
"/Audio/_Sunrise/Misc/ping.ogg",
Filter.Local(),
false,
new AudioParams().WithVolume(10f)
);
}
// Sunrise-Edit-End
}
AvailableGhostRoleCount = msg.AvailableGhostRoles;

View file

@ -30,6 +30,7 @@
<CheckBox Name="TapePlayerClientCheckBox" Text="{Loc 'ui-options-tape-player-enabled'}" />
<CheckBox Name="JumpSoundDisableCheckBox" Text="{Loc 'ui-options-jump-sound-disable'}" />
<CheckBox Name="VoteMusicDisableCheckBox" Text="{Loc 'ui-options-vote-music-disable'}" />
<CheckBox Name="MuteGhostRoleNotificationCheckBox" Text="{Loc 'ui-options-mute-new-ghost-roles'}" />
<!-- Graphics -->
<Label Text="{Loc 'ui-options-sunrise-general-graphics'}" StyleClasses="LabelKeyText"/>

View file

@ -41,6 +41,7 @@ public sealed partial class ExtraTab : Control
Control.AddOptionCheckBox(SunriseCCVars.TapePlayerClientEnabled, TapePlayerClientCheckBox);
Control.AddOptionCheckBox(SunriseCCVars.JumpSoundDisable, JumpSoundDisableCheckBox);
Control.AddOptionCheckBox(SunriseCCVars.VoteMusicDisable, VoteMusicDisableCheckBox);
Control.AddOptionCheckBox(SunriseCCVars.MuteGhostRoleNotification, MuteGhostRoleNotificationCheckBox);
_cfg.OnValueChanged(SunriseCCVars.LobbyBackgroundType, OnLobbyBackgroundTypeChanged, true);

View file

@ -414,4 +414,11 @@ public sealed class SunriseCCVars
public static readonly CVarDef<bool> ChatPointingVisuals =
CVarDef.Create("chat_icon_pointing.enable", true, CVar.CLIENTONLY | CVar.ARCHIVE);
/*
* Mute new ghost role sound
*/
public static readonly CVarDef<bool> MuteGhostRoleNotification =
CVarDef.Create("ghost.mute_role_notification", false, CVar.CLIENTONLY | CVar.ARCHIVE);
}

View file

@ -14,6 +14,7 @@ ui-options-tab-extra = Экстра
ui-options-tape-player-enabled = Школьники с колонками (Нужен рестарт раунда)
ui-options-jump-sound-disable = Отключить звук прыжка
ui-options-vote-music-disable = Отключить музыку голосования
ui-options-mute-new-ghost-roles = Отключить звук новых гост-ролей
ui-options-function-toggle-standing = Лечь/Встать
ui-options-function-cock-gun = Взвести оружие/Разрядить
ui-options-function-jump = Прыжок