mirror of
https://github.com/osukey/osukey.git
synced 2025-08-08 00:53:56 +09:00
Fix mute button not prolonging volume control display
This commit is contained in:
@ -59,18 +59,10 @@ namespace osu.Game.Graphics.UserInterface.Volume
|
|||||||
{
|
{
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
|
|
||||||
volumeMeterMaster.Bindable.ValueChanged += volumeChanged;
|
volumeMeterMaster.Bindable.ValueChanged += _ => settingChanged();
|
||||||
volumeMeterEffect.Bindable.ValueChanged += volumeChanged;
|
volumeMeterEffect.Bindable.ValueChanged += _ => settingChanged();
|
||||||
volumeMeterMusic.Bindable.ValueChanged += volumeChanged;
|
volumeMeterMusic.Bindable.ValueChanged += _ => settingChanged();
|
||||||
}
|
muted.ValueChanged += _ => settingChanged();
|
||||||
|
|
||||||
protected override void Dispose(bool isDisposing)
|
|
||||||
{
|
|
||||||
base.Dispose(isDisposing);
|
|
||||||
|
|
||||||
volumeMeterMaster.Bindable.ValueChanged -= volumeChanged;
|
|
||||||
volumeMeterEffect.Bindable.ValueChanged -= volumeChanged;
|
|
||||||
volumeMeterMusic.Bindable.ValueChanged -= volumeChanged;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Adjust(GlobalAction action)
|
public bool Adjust(GlobalAction action)
|
||||||
@ -98,13 +90,13 @@ namespace osu.Game.Graphics.UserInterface.Volume
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void volumeChanged(double newVolume)
|
private void settingChanged()
|
||||||
{
|
{
|
||||||
Show();
|
Show();
|
||||||
schedulePopOut();
|
schedulePopOut();
|
||||||
}
|
}
|
||||||
|
|
||||||
private readonly BindableDouble muteBindable = new BindableDouble();
|
private readonly BindableDouble muteAdjustment = new BindableDouble();
|
||||||
|
|
||||||
private readonly BindableBool muted = new BindableBool();
|
private readonly BindableBool muted = new BindableBool();
|
||||||
|
|
||||||
@ -119,12 +111,12 @@ namespace osu.Game.Graphics.UserInterface.Volume
|
|||||||
{
|
{
|
||||||
if (mute)
|
if (mute)
|
||||||
{
|
{
|
||||||
audio.AddAdjustment(AdjustableProperty.Volume, muteBindable);
|
audio.AddAdjustment(AdjustableProperty.Volume, muteAdjustment);
|
||||||
muteIcon.Icon = FontAwesome.fa_volume_off;
|
muteIcon.Icon = FontAwesome.fa_volume_off;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
audio.RemoveAdjustment(AdjustableProperty.Volume, muteBindable);
|
audio.RemoveAdjustment(AdjustableProperty.Volume, muteAdjustment);
|
||||||
muteIcon.Icon = FontAwesome.fa_volume_up;
|
muteIcon.Icon = FontAwesome.fa_volume_up;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user