Add option to disable bwoink sound. (#33782)
* Add option to disable bwoink sound. * Now it's working only with active admin status. * No bwoink, only "notification sound" * Moar changes * Another one
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using Content.Client.Administration.Managers;
|
||||
using Content.Client.Audio;
|
||||
using Content.Shared.CCVar;
|
||||
using Robust.Client.Audio;
|
||||
@@ -12,8 +13,9 @@ namespace Content.Client.Options.UI.Tabs;
|
||||
[GenerateTypedNameReferences]
|
||||
public sealed partial class AudioTab : Control
|
||||
{
|
||||
[Dependency] private readonly IConfigurationManager _cfg = default!;
|
||||
[Dependency] private readonly IAudioManager _audio = default!;
|
||||
[Dependency] private readonly IClientAdminManager _admin = default!;
|
||||
[Dependency] private readonly IConfigurationManager _cfg = default!;
|
||||
|
||||
public AudioTab()
|
||||
{
|
||||
@@ -61,10 +63,30 @@ public sealed partial class AudioTab : Control
|
||||
Control.AddOptionCheckBox(CCVars.RestartSoundsEnabled, RestartSoundsCheckBox);
|
||||
Control.AddOptionCheckBox(CCVars.EventMusicEnabled, EventMusicCheckBox);
|
||||
Control.AddOptionCheckBox(CCVars.AdminSoundsEnabled, AdminSoundsCheckBox);
|
||||
Control.AddOptionCheckBox(CCVars.BwoinkSoundEnabled, BwoinkSoundCheckBox);
|
||||
|
||||
Control.Initialize();
|
||||
}
|
||||
|
||||
protected override void EnteredTree()
|
||||
{
|
||||
base.EnteredTree();
|
||||
_admin.AdminStatusUpdated += UpdateAdminButtonsVisibility;
|
||||
UpdateAdminButtonsVisibility();
|
||||
}
|
||||
|
||||
protected override void ExitedTree()
|
||||
{
|
||||
base.ExitedTree();
|
||||
_admin.AdminStatusUpdated -= UpdateAdminButtonsVisibility;
|
||||
}
|
||||
|
||||
|
||||
private void UpdateAdminButtonsVisibility()
|
||||
{
|
||||
BwoinkSoundCheckBox.Visible = _admin.IsActive();
|
||||
}
|
||||
|
||||
private void OnMasterVolumeSliderChanged(float value)
|
||||
{
|
||||
// TODO: I was thinking of giving OptionsTabControlRow a flag to "set CVar immediately", but I'm deferring that
|
||||
|
||||
Reference in New Issue
Block a user