mirror of
https://github.com/osukey/osukey.git
synced 2025-05-05 13:47:19 +09:00
Merge branch 'master' into search-via-online-id
This commit is contained in:
commit
09f3c0f091
@ -1,6 +1,7 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
@ -56,6 +57,7 @@ namespace osu.Game.Rulesets.Catch.Objects
|
|||||||
Volume = s.Volume
|
Volume = s.Volume
|
||||||
}).ToList();
|
}).ToList();
|
||||||
|
|
||||||
|
int nodeIndex = 0;
|
||||||
SliderEventDescriptor? lastEvent = null;
|
SliderEventDescriptor? lastEvent = null;
|
||||||
|
|
||||||
foreach (var e in SliderEventGenerator.Generate(StartTime, SpanDuration, Velocity, TickDistance, Path.Distance, this.SpanCount(), LegacyLastTickOffset, cancellationToken))
|
foreach (var e in SliderEventGenerator.Generate(StartTime, SpanDuration, Velocity, TickDistance, Path.Distance, this.SpanCount(), LegacyLastTickOffset, cancellationToken))
|
||||||
@ -105,7 +107,7 @@ namespace osu.Game.Rulesets.Catch.Objects
|
|||||||
case SliderEventType.Repeat:
|
case SliderEventType.Repeat:
|
||||||
AddNested(new Fruit
|
AddNested(new Fruit
|
||||||
{
|
{
|
||||||
Samples = Samples,
|
Samples = this.GetNodeSamples(nodeIndex++),
|
||||||
StartTime = e.Time,
|
StartTime = e.Time,
|
||||||
X = X + Path.PositionAt(e.PathProgress).X,
|
X = X + Path.PositionAt(e.PathProgress).X,
|
||||||
});
|
});
|
||||||
@ -119,7 +121,7 @@ namespace osu.Game.Rulesets.Catch.Objects
|
|||||||
public double Duration
|
public double Duration
|
||||||
{
|
{
|
||||||
get => this.SpanCount() * Path.Distance / Velocity;
|
get => this.SpanCount() * Path.Distance / Velocity;
|
||||||
set => throw new System.NotSupportedException($"Adjust via {nameof(RepeatCount)} instead"); // can be implemented if/when needed.
|
set => throw new NotSupportedException($"Adjust via {nameof(RepeatCount)} instead"); // can be implemented if/when needed.
|
||||||
}
|
}
|
||||||
|
|
||||||
public double EndTime => StartTime + Duration;
|
public double EndTime => StartTime + Duration;
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
["soft-hitnormal"],
|
["soft-hitnormal"],
|
||||||
["drum-hitnormal"]
|
["drum-hitnormal"]
|
||||||
],
|
],
|
||||||
"Samples": ["drum-hitnormal"]
|
"Samples": ["-hitnormal"]
|
||||||
}, {
|
}, {
|
||||||
"StartTime": 1875.0,
|
"StartTime": 1875.0,
|
||||||
"EndTime": 2750.0,
|
"EndTime": 2750.0,
|
||||||
@ -19,7 +19,7 @@
|
|||||||
["soft-hitnormal"],
|
["soft-hitnormal"],
|
||||||
["drum-hitnormal"]
|
["drum-hitnormal"]
|
||||||
],
|
],
|
||||||
"Samples": ["drum-hitnormal"]
|
"Samples": ["-hitnormal"]
|
||||||
}]
|
}]
|
||||||
}, {
|
}, {
|
||||||
"StartTime": 3750.0,
|
"StartTime": 3750.0,
|
||||||
|
@ -137,6 +137,10 @@ namespace osu.Game.Rulesets.Osu.Objects
|
|||||||
|
|
||||||
Velocity = scoringDistance / timingPoint.BeatLength;
|
Velocity = scoringDistance / timingPoint.BeatLength;
|
||||||
TickDistance = scoringDistance / difficulty.SliderTickRate * TickDistanceMultiplier;
|
TickDistance = scoringDistance / difficulty.SliderTickRate * TickDistanceMultiplier;
|
||||||
|
|
||||||
|
// The samples should be attached to the slider tail, however this can only be done after LegacyLastTick is removed otherwise they would play earlier than they're intended to.
|
||||||
|
// For now, the samples are attached to and played by the slider itself at the correct end time.
|
||||||
|
Samples = this.GetNodeSamples(repeatCount + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void CreateNestedHitObjects(CancellationToken cancellationToken)
|
protected override void CreateNestedHitObjects(CancellationToken cancellationToken)
|
||||||
@ -230,15 +234,12 @@ namespace osu.Game.Rulesets.Osu.Objects
|
|||||||
tick.Samples = sampleList;
|
tick.Samples = sampleList;
|
||||||
|
|
||||||
foreach (var repeat in NestedHitObjects.OfType<SliderRepeat>())
|
foreach (var repeat in NestedHitObjects.OfType<SliderRepeat>())
|
||||||
repeat.Samples = getNodeSamples(repeat.RepeatIndex + 1);
|
repeat.Samples = this.GetNodeSamples(repeat.RepeatIndex + 1);
|
||||||
|
|
||||||
if (HeadCircle != null)
|
if (HeadCircle != null)
|
||||||
HeadCircle.Samples = getNodeSamples(0);
|
HeadCircle.Samples = this.GetNodeSamples(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
private IList<HitSampleInfo> getNodeSamples(int nodeIndex) =>
|
|
||||||
nodeIndex < NodeSamples.Count ? NodeSamples[nodeIndex] : Samples;
|
|
||||||
|
|
||||||
public override Judgement CreateJudgement() => new OsuIgnoreJudgement();
|
public override Judgement CreateJudgement() => new OsuIgnoreJudgement();
|
||||||
|
|
||||||
protected override HitWindows CreateHitWindows() => HitWindows.Empty;
|
protected override HitWindows CreateHitWindows() => HitWindows.Empty;
|
||||||
|
@ -184,9 +184,6 @@ namespace osu.Game.Rulesets.Objects.Legacy
|
|||||||
nodeSamples.Add(convertSoundType(nodeSoundTypes[i], nodeBankInfos[i]));
|
nodeSamples.Add(convertSoundType(nodeSoundTypes[i], nodeBankInfos[i]));
|
||||||
|
|
||||||
result = CreateSlider(pos, combo, comboOffset, convertControlPoints(points, pathType), length, repeatCount, nodeSamples);
|
result = CreateSlider(pos, combo, comboOffset, convertControlPoints(points, pathType), length, repeatCount, nodeSamples);
|
||||||
|
|
||||||
// The samples are played when the slider ends, which is the last node
|
|
||||||
result.Samples = nodeSamples[^1];
|
|
||||||
}
|
}
|
||||||
else if (type.HasFlag(LegacyHitObjectType.Spinner))
|
else if (type.HasFlag(LegacyHitObjectType.Spinner))
|
||||||
{
|
{
|
||||||
|
@ -35,5 +35,15 @@ namespace osu.Game.Rulesets.Objects.Types
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="obj">The object that has repeats.</param>
|
/// <param name="obj">The object that has repeats.</param>
|
||||||
public static int SpanCount(this IHasRepeats obj) => obj.RepeatCount + 1;
|
public static int SpanCount(this IHasRepeats obj) => obj.RepeatCount + 1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Retrieves the samples at a particular node in a <see cref="IHasRepeats"/> object.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="obj">The <see cref="HitObject"/>.</param>
|
||||||
|
/// <param name="nodeIndex">The node to attempt to retrieve the samples at.</param>
|
||||||
|
/// <returns>The samples at the given node index, or <paramref name="obj"/>'s default samples if the given node doesn't exist.</returns>
|
||||||
|
public static IList<HitSampleInfo> GetNodeSamples<T>(this T obj, int nodeIndex)
|
||||||
|
where T : HitObject, IHasRepeats
|
||||||
|
=> nodeIndex < obj.NodeSamples.Count ? obj.NodeSamples[nodeIndex] : obj.Samples;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user