mirror of
https://github.com/ppy/osu.git
synced 2024-12-13 08:32:57 +08:00
Cache IScrollingInfo
at a HitObjectComposer
level automatically
This commit is contained in:
parent
6f4a2b9889
commit
d26d4b8b79
@ -57,16 +57,9 @@ namespace osu.Game.Rulesets.Mania.Edit
|
||||
protected override Playfield PlayfieldAtScreenSpacePosition(Vector2 screenSpacePosition) =>
|
||||
Playfield.GetColumnByPosition(screenSpacePosition);
|
||||
|
||||
protected override DrawableRuleset<ManiaHitObject> CreateDrawableRuleset(Ruleset ruleset, IBeatmap beatmap, IReadOnlyList<Mod> mods)
|
||||
{
|
||||
protected override DrawableRuleset<ManiaHitObject> CreateDrawableRuleset(Ruleset ruleset, IBeatmap beatmap, IReadOnlyList<Mod> mods) =>
|
||||
drawableRuleset = new DrawableManiaEditorRuleset(ruleset, beatmap, mods);
|
||||
|
||||
// This is the earliest we can cache the scrolling info to ourselves, before masks are added to the hierarchy and inject it
|
||||
dependencies.CacheAs(drawableRuleset.ScrollingInfo);
|
||||
|
||||
return drawableRuleset;
|
||||
}
|
||||
|
||||
protected override ComposeBlueprintContainer CreateBlueprintContainer()
|
||||
=> new ManiaBlueprintContainer(this);
|
||||
|
||||
|
@ -119,6 +119,9 @@ namespace osu.Game.Rulesets.Edit
|
||||
return;
|
||||
}
|
||||
|
||||
if (DrawableRuleset is IDrawableScrollingRuleset scrollingRuleset)
|
||||
dependencies.CacheAs(scrollingRuleset.ScrollingInfo);
|
||||
|
||||
dependencies.CacheAs(Playfield);
|
||||
|
||||
InternalChildren = new Drawable[]
|
||||
|
@ -81,7 +81,7 @@ namespace osu.Game.Rulesets.UI.Scrolling
|
||||
/// </summary>
|
||||
protected readonly SortedList<MultiplierControlPoint> ControlPoints = new SortedList<MultiplierControlPoint>(Comparer<MultiplierControlPoint>.Default);
|
||||
|
||||
protected IScrollingInfo ScrollingInfo => scrollingInfo;
|
||||
public IScrollingInfo ScrollingInfo => scrollingInfo;
|
||||
|
||||
[Cached(Type = typeof(IScrollingInfo))]
|
||||
private readonly LocalScrollingInfo scrollingInfo;
|
||||
|
@ -11,5 +11,7 @@ namespace osu.Game.Rulesets.UI.Scrolling
|
||||
public interface IDrawableScrollingRuleset
|
||||
{
|
||||
ScrollVisualisationMethod VisualisationMethod { get; }
|
||||
|
||||
IScrollingInfo ScrollingInfo { get; }
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user