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

Move implementation to OsuGameBase to ensure it applies to test scenes

This also removed a previous attempt at the same thing, which happened
to not be applying due to the reference to the applied bindable not
being held. Whoops.
This commit is contained in:
Dean Herbert 2021-02-11 15:02:34 +09:00
parent f21a3c0c48
commit df7aaa5c81
2 changed files with 6 additions and 10 deletions

View File

@ -174,8 +174,6 @@ namespace osu.Game
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent) => protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent) =>
dependencies = new DependencyContainer(base.CreateChildDependencies(parent)); dependencies = new DependencyContainer(base.CreateChildDependencies(parent));
private readonly BindableNumber<double> globalTrackVolumeAdjust = new BindableNumber<double>(0.5f);
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load() private void load()
{ {
@ -232,11 +230,6 @@ namespace osu.Game
Audio.AddAdjustment(AdjustableProperty.Volume, inactiveVolumeFade); Audio.AddAdjustment(AdjustableProperty.Volume, inactiveVolumeFade);
// drop track volume game-wide to leave some head-room for UI effects / samples.
// this means that for the time being, gameplay sample playback is louder relative to the audio track, compared to stable.
// we may want to revisit this if users notice or complain about the difference (consider this a bit of a trial).
Audio.Tracks.AddAdjustment(AdjustableProperty.Volume, globalTrackVolumeAdjust);
SelectedMods.BindValueChanged(modsChanged); SelectedMods.BindValueChanged(modsChanged);
Beatmap.BindValueChanged(beatmapChanged, true); Beatmap.BindValueChanged(beatmapChanged, true);
} }

View File

@ -155,6 +155,8 @@ namespace osu.Game
protected override UserInputManager CreateUserInputManager() => new OsuUserInputManager(); protected override UserInputManager CreateUserInputManager() => new OsuUserInputManager();
private readonly BindableNumber<double> globalTrackVolumeAdjust = new BindableNumber<double>(0.5f);
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load() private void load()
{ {
@ -278,9 +280,10 @@ namespace osu.Game
RegisterImportHandler(ScoreManager); RegisterImportHandler(ScoreManager);
RegisterImportHandler(SkinManager); RegisterImportHandler(SkinManager);
// tracks play so loud our samples can't keep up. // drop track volume game-wide to leave some head-room for UI effects / samples.
// this adds a global reduction of track volume for the time being. // this means that for the time being, gameplay sample playback is louder relative to the audio track, compared to stable.
Audio.Tracks.AddAdjustment(AdjustableProperty.Volume, new BindableDouble(0.8)); // we may want to revisit this if users notice or complain about the difference (consider this a bit of a trial).
Audio.Tracks.AddAdjustment(AdjustableProperty.Volume, globalTrackVolumeAdjust);
Beatmap = new NonNullableBindable<WorkingBeatmap>(defaultBeatmap); Beatmap = new NonNullableBindable<WorkingBeatmap>(defaultBeatmap);