1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 09:27:29 +08:00

Always bring master/music volume to 50%

This commit is contained in:
Salman Ahmed 2024-02-16 11:17:54 +03:00
parent 952c5b0d18
commit 583e71634f
2 changed files with 6 additions and 8 deletions

View File

@ -268,9 +268,9 @@ namespace osu.Game.Tests.Visual.Gameplay
{
addVolumeSteps("master and music volumes", () =>
{
audioManager.Volume.Value = 0.25;
audioManager.Volume.Value = 0.6;
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]
@ -279,8 +279,8 @@ namespace osu.Game.Tests.Visual.Gameplay
addVolumeSteps("master and music volumes", () =>
{
audioManager.Volume.Value = 0.01;
audioManager.VolumeTrack.Value = 0.25;
}, () => Precision.AlmostEquals(audioManager.Volume.Value, 0.5) && Precision.AlmostEquals(audioManager.VolumeTrack.Value, 0.25));
audioManager.VolumeTrack.Value = 0.6;
}, () => Precision.AlmostEquals(audioManager.Volume.Value, 0.5) && Precision.AlmostEquals(audioManager.VolumeTrack.Value, 0.6));
}
[Test]

View File

@ -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.
// 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 = 0.5;
if (audioManager.VolumeTrack.Value <= volume_requirement)
audioManager.VolumeTrack.Value = 0.5;
audioManager.Volume.Value = Math.Max(audioManager.Volume.Value, 0.5);
audioManager.VolumeTrack.Value = Math.Max(audioManager.VolumeTrack.Value, 0.5);
return true;
};