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

Allow audio adjustments to be applied to DrawableRulesets

This commit is contained in:
Dean Herbert 2021-07-30 16:47:07 +09:00
parent 3cfd235b7f
commit 0c3f1195e9

View File

@ -1,29 +1,29 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Judgements;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Objects.Drawables;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using JetBrains.Annotations;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Cursor;
using osu.Framework.Input;
using osu.Framework.Input.Events;
using osu.Game.Beatmaps;
using osu.Game.Configuration;
using osu.Game.Graphics.Cursor;
using osu.Game.Input.Handlers;
using osu.Game.Overlays;
using osu.Game.Replays;
using osu.Game.Rulesets.Configuration;
using osu.Game.Rulesets.Judgements;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Scoring;
using osu.Game.Scoring;
using osu.Game.Screens.Play;
@ -98,6 +98,14 @@ namespace osu.Game.Rulesets.UI
private DrawableRulesetDependencies dependencies;
/// <summary>
/// An audio container which can be used to apply adjustments to playfield content.
/// </summary>
/// <remarks>
/// Does not affect <see cref="Overlays"/>.
/// </remarks>
public AudioContainer AudioContainer { get; private set; }
/// <summary>
/// Creates a ruleset visualisation for the provided ruleset and beatmap.
/// </summary>
@ -155,21 +163,22 @@ namespace osu.Game.Rulesets.UI
[BackgroundDependencyLoader]
private void load(CancellationToken? cancellationToken)
{
InternalChildren = new Drawable[]
InternalChild = frameStabilityContainer = new FrameStabilityContainer(GameplayStartTime)
{
frameStabilityContainer = new FrameStabilityContainer(GameplayStartTime)
FrameStablePlayback = FrameStablePlayback,
Children = new Drawable[]
{
FrameStablePlayback = FrameStablePlayback,
Children = new Drawable[]
FrameStableComponents,
AudioContainer = new AudioContainer
{
FrameStableComponents,
KeyBindingInputManager
RelativeSizeAxes = Axes.Both,
Child = KeyBindingInputManager
.WithChild(CreatePlayfieldAdjustmentContainer()
.WithChild(Playfield)
),
Overlays,
}
},
},
Overlays,
}
};
if ((ResumeOverlay = CreateResumeOverlay()) != null)