mirror of
https://github.com/ppy/osu.git
synced 2025-02-20 00:52:56 +08:00
Use Bindable instead of bool
This commit is contained in:
parent
00e46fdefe
commit
811a08d18f
@ -32,11 +32,7 @@ namespace osu.Game.Overlays
|
|||||||
|
|
||||||
private readonly BindableDouble muteAdjustment = new BindableDouble();
|
private readonly BindableDouble muteAdjustment = new BindableDouble();
|
||||||
|
|
||||||
public bool IsMuted
|
public Bindable<bool> IsMuted => muteButton.Current;
|
||||||
{
|
|
||||||
get => muteButton.Current.Value;
|
|
||||||
set => muteButton.Current.Value = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(AudioManager audio, OsuColour colours)
|
private void load(AudioManager audio, OsuColour colours)
|
||||||
|
@ -159,7 +159,7 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
private void checkVolume(AudioManager audio)
|
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());
|
notificationOverlay.Post(new MutedNotification());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -513,7 +513,7 @@ namespace osu.Game.Screens.Play
|
|||||||
{
|
{
|
||||||
notificationOverlay.Hide();
|
notificationOverlay.Hide();
|
||||||
|
|
||||||
volumeOverlay.IsMuted = false;
|
volumeOverlay.IsMuted.Value = false;
|
||||||
audioManager.Volume.SetDefault();
|
audioManager.Volume.SetDefault();
|
||||||
audioManager.VolumeTrack.SetDefault();
|
audioManager.VolumeTrack.SetDefault();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user