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

Register bar line pool & use in drawable ruleset

This commit is contained in:
Bartłomiej Dach 2020-12-13 20:12:54 +01:00
parent c103c3691f
commit ea09cbddc6
3 changed files with 10 additions and 2 deletions

View File

@ -151,7 +151,7 @@ namespace osu.Game.Rulesets.Taiko.Tests
Major = major Major = major
}; };
DrawableRuleset.Playfield.Add(new DrawableBarLine(bl)); DrawableRuleset.Playfield.Add(bl);
} }
private void addSwell(double duration = default_duration) private void addSwell(double duration = default_duration)

View File

@ -1,11 +1,19 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation;
using osu.Game.Rulesets.Taiko.Objects;
using osu.Game.Rulesets.Taiko.Objects.Drawables;
using osu.Game.Rulesets.UI.Scrolling; using osu.Game.Rulesets.UI.Scrolling;
namespace osu.Game.Rulesets.Taiko.UI namespace osu.Game.Rulesets.Taiko.UI
{ {
public class BarLinePlayfield : ScrollingPlayfield public class BarLinePlayfield : ScrollingPlayfield
{ {
[BackgroundDependencyLoader]
private void load()
{
RegisterPool<BarLine, DrawableBarLine>(15);
}
} }
} }

View File

@ -40,7 +40,7 @@ namespace osu.Game.Rulesets.Taiko.UI
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load() private void load()
{ {
new BarLineGenerator<BarLine>(Beatmap).BarLines.ForEach(bar => Playfield.Add(new DrawableBarLine(bar))); new BarLineGenerator<BarLine>(Beatmap).BarLines.ForEach(bar => Playfield.Add(bar));
FrameStableComponents.Add(scroller = new SkinnableDrawable(new TaikoSkinComponent(TaikoSkinComponents.Scroller), _ => Empty()) FrameStableComponents.Add(scroller = new SkinnableDrawable(new TaikoSkinComponent(TaikoSkinComponents.Scroller), _ => Empty())
{ {