mirror of
https://github.com/ppy/osu.git
synced 2025-01-06 20:33:08 +08:00
Move DrumSamplePlayer
to be a skinnable component
This commit is contained in:
parent
72e44d20e4
commit
f54eb8d7fa
@ -60,6 +60,9 @@ namespace osu.Game.Rulesets.Taiko.Skinning.Argon
|
||||
// the drawable needs to expire as soon as possible to avoid accumulating empty drawables on the playfield.
|
||||
return Drawable.Empty().With(d => d.Expire());
|
||||
|
||||
case TaikoSkinComponents.DrumSamplePlayer:
|
||||
return Drawable.Empty();
|
||||
|
||||
case TaikoSkinComponents.TaikoExplosionGreat:
|
||||
case TaikoSkinComponents.TaikoExplosionMiss:
|
||||
case TaikoSkinComponents.TaikoExplosionOk:
|
||||
|
@ -52,6 +52,9 @@ namespace osu.Game.Rulesets.Taiko.Skinning.Legacy
|
||||
|
||||
return null;
|
||||
|
||||
case TaikoSkinComponents.DrumSamplePlayer:
|
||||
return null;
|
||||
|
||||
case TaikoSkinComponents.CentreHit:
|
||||
case TaikoSkinComponents.RimHit:
|
||||
if (hasHitCircle)
|
||||
|
@ -21,6 +21,7 @@ namespace osu.Game.Rulesets.Taiko
|
||||
TaikoExplosionKiai,
|
||||
Scroller,
|
||||
Mascot,
|
||||
KiaiGlow
|
||||
KiaiGlow,
|
||||
DrumSamplePlayer
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
// 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.Framework.Input.Bindings;
|
||||
@ -12,13 +13,16 @@ namespace osu.Game.Rulesets.Taiko.UI
|
||||
{
|
||||
internal partial class DrumSamplePlayer : CompositeDrawable, IKeyBindingHandler<TaikoAction>
|
||||
{
|
||||
private readonly DrumSampleTriggerSource leftRimSampleTriggerSource;
|
||||
private readonly DrumSampleTriggerSource leftCentreSampleTriggerSource;
|
||||
private readonly DrumSampleTriggerSource rightCentreSampleTriggerSource;
|
||||
private readonly DrumSampleTriggerSource rightRimSampleTriggerSource;
|
||||
private DrumSampleTriggerSource leftRimSampleTriggerSource = null!;
|
||||
private DrumSampleTriggerSource leftCentreSampleTriggerSource = null!;
|
||||
private DrumSampleTriggerSource rightCentreSampleTriggerSource = null!;
|
||||
private DrumSampleTriggerSource rightRimSampleTriggerSource = null!;
|
||||
|
||||
public DrumSamplePlayer(HitObjectContainer hitObjectContainer)
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(DrawableRuleset drawableRuleset)
|
||||
{
|
||||
var hitObjectContainer = drawableRuleset.Playfield.HitObjectContainer;
|
||||
|
||||
InternalChildren = new Drawable[]
|
||||
{
|
||||
leftRimSampleTriggerSource = new DrumSampleTriggerSource(hitObjectContainer),
|
||||
|
@ -170,7 +170,10 @@ namespace osu.Game.Rulesets.Taiko.UI
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
},
|
||||
drumRollHitContainer.CreateProxy(),
|
||||
new DrumSamplePlayer(HitObjectContainer),
|
||||
new SkinnableDrawable(new TaikoSkinComponentLookup(TaikoSkinComponents.DrumSamplePlayer), _ => new DrumSamplePlayer())
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
},
|
||||
// this is added at the end of the hierarchy to receive input before taiko objects.
|
||||
// but is proxied below everything to not cover visual effects such as hit explosions.
|
||||
inputDrum,
|
||||
|
Loading…
Reference in New Issue
Block a user