Make InputDrum handle all Normals/Claps, hitobjects all others

This commit is contained in:
smoogipoo
2017-12-26 14:18:23 +09:00
parent 58c35b8ba5
commit 14162b5d46
7 changed files with 72 additions and 94 deletions

View File

@ -123,9 +123,6 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
MainPiece.AccentColour = colours.YellowDark;
expandingRing.Colour = colours.YellowLight;
targetRing.BorderColour = colours.YellowDark.Opacity(0.25f);
foreach (var mapping in HitObject.ProgressionSamples)
mapping.RetrieveChannels(audio);
}
protected override void LoadComplete()
@ -223,22 +220,6 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
UpdateJudgement(true);
if (AllJudged)
return true;
// While the swell hasn't been fully judged, input is still blocked so it doesn't fall through to other hitobjects
// This causes the playfield to not play sounds, so they need to be handled locally
var mappingIndex = HitObject.ProgressionSamples.BinarySearch(new DrumSampleMapping { Time = Time.Current });
if (mappingIndex < 0)
mappingIndex = ~mappingIndex - 1;
var mapping = HitObject.ProgressionSamples[mappingIndex];
if (isCentre)
mapping.CentreChannel.Play();
else
mapping.RimChannel.Play();
return true;
}
}

View File

@ -6,6 +6,10 @@ using osu.Framework.Input.Bindings;
using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces;
using OpenTK;
using System;
using System.Linq;
using osu.Game.Audio;
using System.Collections.Generic;
namespace osu.Game.Rulesets.Taiko.Objects.Drawables
{
@ -35,6 +39,9 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
MainPiece.KiaiMode = HitObject.Kiai;
}
// Normal and clap samples are handled by the drum
protected override IEnumerable<SampleInfo> GetSamples() => HitObject.Samples.Where(s => s.Name != SampleInfo.HIT_NORMAL && s.Name != SampleInfo.HIT_CLAP);
protected virtual TaikoPiece CreateMainPiece() => new CirclePiece();
public abstract bool OnPressed(TaikoAction action);

View File

@ -20,18 +20,5 @@ namespace osu.Game.Rulesets.Taiko.Objects
/// The number of hits required to complete the swell successfully.
/// </summary>
public int RequiredHits = 10;
public List<DrumSampleMapping> ProgressionSamples = new List<DrumSampleMapping>();
protected override void ApplyDefaultsToSelf(ControlPointInfo controlPointInfo, BeatmapDifficulty difficulty)
{
base.ApplyDefaultsToSelf(controlPointInfo, difficulty);
var progressionSamplePoints = new[] { controlPointInfo.SamplePointAt(StartTime) }
.Concat(controlPointInfo.SamplePoints.Where(p => p.Time > StartTime && p.Time <= EndTime));
foreach (var point in progressionSamplePoints)
ProgressionSamples.Add(new DrumSampleMapping(point));
}
}
}