1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-13 08:32:57 +08:00

add sample info to Banana and SpinnerBonusTick

This commit is contained in:
OliBomby 2023-05-01 14:14:57 +02:00
parent cef9f73d34
commit 27cfadca16
5 changed files with 6 additions and 14 deletions

View File

@ -22,11 +22,9 @@ namespace osu.Game.Rulesets.Catch.Objects
public override Judgement CreateJudgement() => new CatchBananaJudgement();
private static readonly List<HitSampleInfo> samples = new List<HitSampleInfo> { new BananaHitSampleInfo() };
public Banana()
public Banana(int volume = 100)
{
Samples = samples;
Samples = new List<HitSampleInfo> { new BananaHitSampleInfo(volume) };
}
// override any external colour changes with banananana
@ -53,7 +51,7 @@ namespace osu.Game.Rulesets.Catch.Objects
public override IEnumerable<string> LookupNames => lookup_names;
public BananaHitSampleInfo(int volume = 0)
public BananaHitSampleInfo(int volume = 100)
: base(string.Empty, volume: volume)
{
}

View File

@ -35,7 +35,7 @@ namespace osu.Game.Rulesets.Catch.Objects
{
cancellationToken.ThrowIfCancellationRequested();
AddNested(new Banana
AddNested(new Banana(GetSampleInfo().Volume)
{
StartTime = time,
BananaIndex = i,

View File

@ -72,7 +72,7 @@ namespace osu.Game.Rulesets.Osu.Objects
AddNested(i < SpinsRequired
? new SpinnerTick { StartTime = startTime, SpinnerDuration = Duration }
: new SpinnerBonusTick { StartTime = startTime, SpinnerDuration = Duration });
: new SpinnerBonusTick { StartTime = startTime, SpinnerDuration = Duration, Samples = new[] { GetSampleInfo("spinnerbonus") } });
}
}

View File

@ -3,7 +3,6 @@
#nullable disable
using osu.Game.Audio;
using osu.Game.Rulesets.Judgements;
using osu.Game.Rulesets.Scoring;
@ -11,11 +10,6 @@ namespace osu.Game.Rulesets.Osu.Objects
{
public class SpinnerBonusTick : SpinnerTick
{
public SpinnerBonusTick()
{
Samples.Add(new HitSampleInfo("spinnerbonus"));
}
public override Judgement CreateJudgement() => new OsuSpinnerBonusTickJudgement();
public class OsuSpinnerBonusTickJudgement : OsuSpinnerTickJudgement

View File

@ -210,7 +210,7 @@ namespace osu.Game.Rulesets.Objects
/// </summary>
/// <param name="sampleName">The name of the sample.</param>
/// <returns>A populated <see cref="HitSampleInfo"/>.</returns>
protected HitSampleInfo GetSampleInfo(string sampleName)
protected HitSampleInfo GetSampleInfo(string sampleName = HitSampleInfo.HIT_NORMAL)
{
var hitnormalSample = Samples.FirstOrDefault(s => s.Name == HitSampleInfo.HIT_NORMAL);
return hitnormalSample == null ? new HitSampleInfo(sampleName) : hitnormalSample.With(newName: sampleName);