1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-06 09:03:01 +08:00

Adjust naming and transitions

This commit is contained in:
Dean Herbert 2019-06-17 23:24:52 +09:00
parent d7d6feb001
commit ad4c9babe7

View File

@ -181,7 +181,7 @@ namespace osu.Game
configSkin.ValueChanged += skinId => SkinManager.CurrentSkinInfo.Value = SkinManager.Query(s => s.ID == skinId.NewValue) ?? SkinInfo.Default; configSkin.ValueChanged += skinId => SkinManager.CurrentSkinInfo.Value = SkinManager.Query(s => s.ID == skinId.NewValue) ?? SkinInfo.Default;
configSkin.TriggerChange(); configSkin.TriggerChange();
LocalConfig.BindWith(OsuSetting.VolumeInactive, inactiveVolume); LocalConfig.BindWith(OsuSetting.VolumeInactive, userInactiveVolume);
IsActive.BindValueChanged(active => updateActiveState(active.NewValue), true); IsActive.BindValueChanged(active => updateActiveState(active.NewValue), true);
} }
@ -686,21 +686,21 @@ namespace osu.Game
return false; return false;
} }
private readonly BindableDouble inactiveVolume = new BindableDouble(); private readonly BindableDouble userInactiveVolume = new BindableDouble();
private readonly BindableDouble inactiveVolAdjust = new BindableDouble(); private readonly BindableDouble inactiveVolumeFade = new BindableDouble();
private void updateActiveState(bool isActive) private void updateActiveState(bool isActive)
{ {
if (isActive) if (isActive)
{ {
this.TransformBindableTo(inactiveVolAdjust, 1, 750, Easing.In) this.TransformBindableTo(inactiveVolumeFade, 1, 500, Easing.OutQuint)
.Finally(_ => Audio.RemoveAdjustment(AdjustableProperty.Volume, inactiveVolAdjust)); //wait for the transition to finish to remove the inactive audio adjustement .Finally(_ => Audio.RemoveAdjustment(AdjustableProperty.Volume, inactiveVolumeFade)); //wait for the transition to finish to remove the inactive audio adjustement
} }
else else
{ {
Audio.AddAdjustment(AdjustableProperty.Volume, inactiveVolAdjust); Audio.AddAdjustment(AdjustableProperty.Volume, inactiveVolumeFade);
this.TransformBindableTo(inactiveVolAdjust, inactiveVolume.Value, 750, Easing.Out); this.TransformBindableTo(inactiveVolumeFade, userInactiveVolume.Value, 1500, Easing.OutSine);
} }
} }