Use Bindable instead of bool

This commit is contained in:
Craftplacer 2019-09-15 16:50:01 +02:00
parent 00e46fdefe
commit 811a08d18f
2 changed files with 3 additions and 7 deletions

View File

@ -32,11 +32,7 @@ namespace osu.Game.Overlays
private readonly BindableDouble muteAdjustment = new BindableDouble();
public bool IsMuted
{
get => muteButton.Current.Value;
set => muteButton.Current.Value = value;
}
public Bindable<bool> IsMuted => muteButton.Current;
[BackgroundDependencyLoader]
private void load(AudioManager audio, OsuColour colours)

View File

@ -159,7 +159,7 @@ namespace osu.Game.Screens.Play
private void checkVolume(AudioManager audio)
{
if (volumeOverlay.IsMuted || audio.Volume.Value <= audio.Volume.MinValue || audio.VolumeTrack.Value <= audio.VolumeTrack.MinValue)
if (volumeOverlay.IsMuted.Value || audio.Volume.Value <= audio.Volume.MinValue || audio.VolumeTrack.Value <= audio.VolumeTrack.MinValue)
notificationOverlay.Post(new MutedNotification());
}
@ -513,7 +513,7 @@ namespace osu.Game.Screens.Play
{
notificationOverlay.Hide();
volumeOverlay.IsMuted = false;
volumeOverlay.IsMuted.Value = false;
audioManager.Volume.SetDefault();
audioManager.VolumeTrack.SetDefault();