diff --git a/osu.Game.Rulesets.Taiko/Skinning/Argon/ArgonDrumSamplePlayer.cs b/osu.Game.Rulesets.Taiko/Skinning/Argon/ArgonDrumSamplePlayer.cs new file mode 100644 index 0000000000..5b690be780 --- /dev/null +++ b/osu.Game.Rulesets.Taiko/Skinning/Argon/ArgonDrumSamplePlayer.cs @@ -0,0 +1,49 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using osu.Game.Audio; +using osu.Game.Rulesets.Taiko.Objects; +using osu.Game.Rulesets.Taiko.UI; +using osu.Game.Rulesets.UI; + +namespace osu.Game.Rulesets.Taiko.Skinning.Argon +{ + public partial class ArgonDrumSamplePlayer : DrumSamplePlayer + { + protected override DrumSampleTriggerSource CreateTriggerSource(HitObjectContainer hitObjectContainer) => + new ArgonDrumSampleTriggerSource(hitObjectContainer); + + public partial class ArgonDrumSampleTriggerSource : DrumSampleTriggerSource + { + public ArgonDrumSampleTriggerSource(HitObjectContainer hitObjectContainer) + : base(hitObjectContainer) + { + } + + public override void Play(HitType hitType) + { + // let the magic begin... + + TaikoHitObject? hitObject = GetMostValidObject() as TaikoHitObject; + + if (hitObject == null) + return; + + var baseSample = hitObject.CreateHitSampleInfo(hitType == HitType.Rim ? HitSampleInfo.HIT_CLAP : HitSampleInfo.HIT_NORMAL); + + if ((hitObject as TaikoStrongableHitObject)?.IsStrong == true || hitObject is StrongNestedHitObject) + { + PlaySamples(new ISampleInfo[] + { + hitObject.CreateHitSampleInfo(hitType == HitType.Rim ? HitSampleInfo.HIT_WHISTLE : HitSampleInfo.HIT_FINISH), + baseSample + }); + } + else + { + PlaySamples(new ISampleInfo[] { baseSample }); + } + } + } + } +} diff --git a/osu.Game.Rulesets.Taiko/Skinning/Argon/TaikoArgonSkinTransformer.cs b/osu.Game.Rulesets.Taiko/Skinning/Argon/TaikoArgonSkinTransformer.cs index 7e3b0e99b6..9fcecd2b1a 100644 --- a/osu.Game.Rulesets.Taiko/Skinning/Argon/TaikoArgonSkinTransformer.cs +++ b/osu.Game.Rulesets.Taiko/Skinning/Argon/TaikoArgonSkinTransformer.cs @@ -61,7 +61,7 @@ namespace osu.Game.Rulesets.Taiko.Skinning.Argon return Drawable.Empty().With(d => d.Expire()); case TaikoSkinComponents.DrumSamplePlayer: - return Drawable.Empty(); + return new ArgonDrumSamplePlayer(); case TaikoSkinComponents.TaikoExplosionGreat: case TaikoSkinComponents.TaikoExplosionMiss: diff --git a/osu.Game.Rulesets.Taiko/UI/DrumSamplePlayer.cs b/osu.Game.Rulesets.Taiko/UI/DrumSamplePlayer.cs index f1dcd23698..b60ad209ff 100644 --- a/osu.Game.Rulesets.Taiko/UI/DrumSamplePlayer.cs +++ b/osu.Game.Rulesets.Taiko/UI/DrumSamplePlayer.cs @@ -11,7 +11,7 @@ using osu.Game.Rulesets.UI; namespace osu.Game.Rulesets.Taiko.UI { - internal partial class DrumSamplePlayer : CompositeDrawable, IKeyBindingHandler + public partial class DrumSamplePlayer : CompositeDrawable, IKeyBindingHandler { private DrumSampleTriggerSource leftRimSampleTriggerSource = null!; private DrumSampleTriggerSource leftCentreSampleTriggerSource = null!; @@ -25,13 +25,16 @@ namespace osu.Game.Rulesets.Taiko.UI InternalChildren = new Drawable[] { - leftRimSampleTriggerSource = new DrumSampleTriggerSource(hitObjectContainer), - leftCentreSampleTriggerSource = new DrumSampleTriggerSource(hitObjectContainer), - rightCentreSampleTriggerSource = new DrumSampleTriggerSource(hitObjectContainer), - rightRimSampleTriggerSource = new DrumSampleTriggerSource(hitObjectContainer), + leftRimSampleTriggerSource = CreateTriggerSource(hitObjectContainer), + leftCentreSampleTriggerSource = CreateTriggerSource(hitObjectContainer), + rightCentreSampleTriggerSource = CreateTriggerSource(hitObjectContainer), + rightRimSampleTriggerSource = CreateTriggerSource(hitObjectContainer), }; } + protected virtual DrumSampleTriggerSource CreateTriggerSource(HitObjectContainer hitObjectContainer) + => new DrumSampleTriggerSource(hitObjectContainer); + public bool OnPressed(KeyBindingPressEvent e) { switch (e.Action) diff --git a/osu.Game.Rulesets.Taiko/UI/DrumSampleTriggerSource.cs b/osu.Game.Rulesets.Taiko/UI/DrumSampleTriggerSource.cs index 6098db4f7a..939eba684b 100644 --- a/osu.Game.Rulesets.Taiko/UI/DrumSampleTriggerSource.cs +++ b/osu.Game.Rulesets.Taiko/UI/DrumSampleTriggerSource.cs @@ -15,7 +15,7 @@ namespace osu.Game.Rulesets.Taiko.UI { } - public void Play(HitType hitType) + public virtual void Play(HitType hitType) { TaikoHitObject? hitObject = GetMostValidObject() as TaikoHitObject;