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 @@ public void CloseAllOverlays(bool hideToolbar = true)
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent) =>
dependencies = new DependencyContainer(base.CreateChildDependencies(parent));
private readonly BindableNumber<double> globalTrackVolumeAdjust = new BindableNumber<double>(0.5f);
[BackgroundDependencyLoader]
private void load()
{
@ -232,11 +230,6 @@ private void load()
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);
Beatmap.BindValueChanged(beatmapChanged, true);
}

View File

@ -155,6 +155,8 @@ protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnl
protected override UserInputManager CreateUserInputManager() => new OsuUserInputManager();
private readonly BindableNumber<double> globalTrackVolumeAdjust = new BindableNumber<double>(0.5f);
[BackgroundDependencyLoader]
private void load()
{
@ -278,9 +280,10 @@ List<ScoreInfo> getBeatmapScores(BeatmapSetInfo set)
RegisterImportHandler(ScoreManager);
RegisterImportHandler(SkinManager);
// tracks play so loud our samples can't keep up.
// this adds a global reduction of track volume for the time being.
Audio.Tracks.AddAdjustment(AdjustableProperty.Volume, new BindableDouble(0.8));
// 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);
Beatmap = new NonNullableBindable<WorkingBeatmap>(defaultBeatmap);