mirror of
https://github.com/osukey/osukey.git
synced 2025-08-07 00:23:59 +09:00
Merge pull request #1932 from peppy/fix-slider-tick-sample-doubling
Fix slider samples playing twice when additions are present
This commit is contained in:
@ -61,6 +61,7 @@ namespace osu.Game.Rulesets.Osu.Objects
|
|||||||
public int RepeatCount { get; set; } = 1;
|
public int RepeatCount { get; set; } = 1;
|
||||||
|
|
||||||
private int stackHeight;
|
private int stackHeight;
|
||||||
|
|
||||||
public override int StackHeight
|
public override int StackHeight
|
||||||
{
|
{
|
||||||
get { return stackHeight; }
|
get { return stackHeight; }
|
||||||
@ -130,6 +131,17 @@ namespace osu.Game.Rulesets.Osu.Objects
|
|||||||
var distanceProgress = d / length;
|
var distanceProgress = d / length;
|
||||||
var timeProgress = reversed ? 1 - distanceProgress : distanceProgress;
|
var timeProgress = reversed ? 1 - distanceProgress : distanceProgress;
|
||||||
|
|
||||||
|
var firstSample = Samples.FirstOrDefault(s => s.Name == SampleInfo.HIT_NORMAL) ?? Samples.FirstOrDefault(); // TODO: remove this when guaranteed sort is present for samples (https://github.com/ppy/osu/issues/1933)
|
||||||
|
var sampleList = new List<SampleInfo>();
|
||||||
|
|
||||||
|
if (firstSample != null)
|
||||||
|
sampleList.Add(new SampleInfo
|
||||||
|
{
|
||||||
|
Bank = firstSample.Bank,
|
||||||
|
Volume = firstSample.Volume,
|
||||||
|
Name = @"slidertick",
|
||||||
|
});
|
||||||
|
|
||||||
AddNested(new SliderTick
|
AddNested(new SliderTick
|
||||||
{
|
{
|
||||||
RepeatIndex = repeat,
|
RepeatIndex = repeat,
|
||||||
@ -138,12 +150,7 @@ namespace osu.Game.Rulesets.Osu.Objects
|
|||||||
StackHeight = StackHeight,
|
StackHeight = StackHeight,
|
||||||
Scale = Scale,
|
Scale = Scale,
|
||||||
ComboColour = ComboColour,
|
ComboColour = ComboColour,
|
||||||
Samples = new List<SampleInfo>(Samples.Select(s => new SampleInfo
|
Samples = sampleList
|
||||||
{
|
|
||||||
Bank = s.Bank,
|
|
||||||
Name = @"slidertick",
|
|
||||||
Volume = s.Volume
|
|
||||||
}))
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user