mirror of
https://github.com/ppy/osu.git
synced 2025-02-06 21:43:21 +08:00
Always bring master/music volume to 50%
This commit is contained in:
parent
952c5b0d18
commit
583e71634f
@ -268,9 +268,9 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
{
|
{
|
||||||
addVolumeSteps("master and music volumes", () =>
|
addVolumeSteps("master and music volumes", () =>
|
||||||
{
|
{
|
||||||
audioManager.Volume.Value = 0.25;
|
audioManager.Volume.Value = 0.6;
|
||||||
audioManager.VolumeTrack.Value = 0.01;
|
audioManager.VolumeTrack.Value = 0.01;
|
||||||
}, () => Precision.AlmostEquals(audioManager.Volume.Value, 0.25) && Precision.AlmostEquals(audioManager.VolumeTrack.Value, 0.5));
|
}, () => Precision.AlmostEquals(audioManager.Volume.Value, 0.6) && Precision.AlmostEquals(audioManager.VolumeTrack.Value, 0.5));
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@ -279,8 +279,8 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
addVolumeSteps("master and music volumes", () =>
|
addVolumeSteps("master and music volumes", () =>
|
||||||
{
|
{
|
||||||
audioManager.Volume.Value = 0.01;
|
audioManager.Volume.Value = 0.01;
|
||||||
audioManager.VolumeTrack.Value = 0.25;
|
audioManager.VolumeTrack.Value = 0.6;
|
||||||
}, () => Precision.AlmostEquals(audioManager.Volume.Value, 0.5) && Precision.AlmostEquals(audioManager.VolumeTrack.Value, 0.25));
|
}, () => Precision.AlmostEquals(audioManager.Volume.Value, 0.5) && Precision.AlmostEquals(audioManager.VolumeTrack.Value, 0.6));
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
@ -585,10 +585,8 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
// Check values before resetting, as the user may have only had mute enabled, in which case we might not need to adjust volumes.
|
// Check values before resetting, as the user may have only had mute enabled, in which case we might not need to adjust volumes.
|
||||||
// Note that we only restore halfway to ensure the user isn't suddenly overloaded by unexpectedly high volume.
|
// Note that we only restore halfway to ensure the user isn't suddenly overloaded by unexpectedly high volume.
|
||||||
if (audioManager.Volume.Value <= volume_requirement)
|
audioManager.Volume.Value = Math.Max(audioManager.Volume.Value, 0.5);
|
||||||
audioManager.Volume.Value = 0.5;
|
audioManager.VolumeTrack.Value = Math.Max(audioManager.VolumeTrack.Value, 0.5);
|
||||||
if (audioManager.VolumeTrack.Value <= volume_requirement)
|
|
||||||
audioManager.VolumeTrack.Value = 0.5;
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user