2021-08-26 16:19:46 +08:00
|
|
|
// 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 System;
|
2023-04-26 19:55:39 +08:00
|
|
|
using System.Linq;
|
2021-08-26 16:19:46 +08:00
|
|
|
using osu.Game.Audio;
|
|
|
|
using osu.Game.Rulesets.Taiko.Objects;
|
|
|
|
using osu.Game.Rulesets.UI;
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Taiko.UI
|
|
|
|
{
|
|
|
|
public partial class DrumSampleTriggerSource : GameplaySampleTriggerSource
|
|
|
|
{
|
|
|
|
public DrumSampleTriggerSource(HitObjectContainer hitObjectContainer)
|
|
|
|
: base(hitObjectContainer)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public void Play(HitType hitType)
|
|
|
|
{
|
2023-04-26 19:55:39 +08:00
|
|
|
var hitSample = GetMostValidObject()?.Samples?.FirstOrDefault(o => o.Name == HitSampleInfo.HIT_NORMAL);
|
2021-08-26 16:19:46 +08:00
|
|
|
|
2023-04-26 19:55:39 +08:00
|
|
|
if (hitSample == null)
|
2021-08-26 16:19:46 +08:00
|
|
|
return;
|
|
|
|
|
2023-04-26 19:55:39 +08:00
|
|
|
PlaySamples(new ISampleInfo[] { new HitSampleInfo(hitType == HitType.Rim ? HitSampleInfo.HIT_CLAP : HitSampleInfo.HIT_NORMAL, hitSample.Bank, volume: hitSample.Volume) });
|
2021-08-26 16:19:46 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
public override void Play() => throw new InvalidOperationException(@"Use override with HitType parameter instead");
|
|
|
|
}
|
|
|
|
}
|