mirror of
https://github.com/osukey/osukey.git
synced 2025-05-20 21:17:32 +09:00
Merge remote-tracking branch 'origin/master' into fix-slider-samples
# Conflicts: # osu.Game.Tests/Beatmaps/Formats/LegacyBeatmapDecoderTest.cs
This commit is contained in:
commit
ace1dce281
@ -377,5 +377,18 @@ namespace osu.Game.Tests.Beatmaps.Formats
|
|||||||
Assert.AreEqual(SampleInfo.HIT_CLAP, slider3.NodeSamples[2][1].Name);
|
Assert.AreEqual(SampleInfo.HIT_CLAP, slider3.NodeSamples[2][1].Name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestDecodeHitObjectNullAdditionBank()
|
||||||
|
{
|
||||||
|
var decoder = new LegacyBeatmapDecoder { ApplyOffsets = false };
|
||||||
|
using (var resStream = Resource.OpenResource("hitobject-no-addition-bank.osu"))
|
||||||
|
using (var stream = new StreamReader(resStream))
|
||||||
|
{
|
||||||
|
var hitObjects = decoder.Decode(stream).HitObjects;
|
||||||
|
|
||||||
|
Assert.AreEqual(hitObjects[0].Samples[0].Bank, hitObjects[0].Samples[1].Bank);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
4
osu.Game.Tests/Resources/hitobject-no-addition-bank.osu
Normal file
4
osu.Game.Tests/Resources/hitobject-no-addition-bank.osu
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
osu file format v14
|
||||||
|
|
||||||
|
[HitObjects]
|
||||||
|
444,320,1000,5,2,3:0:1:0:
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using osu.Framework.Lists;
|
|
||||||
using osu.Game.Audio;
|
using osu.Game.Audio;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Beatmaps.ControlPoints;
|
using osu.Game.Beatmaps.ControlPoints;
|
||||||
@ -56,7 +55,7 @@ namespace osu.Game.Rulesets.Objects
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public HitWindows HitWindows { get; set; }
|
public HitWindows HitWindows { get; set; }
|
||||||
|
|
||||||
private readonly SortedList<HitObject> nestedHitObjects = new SortedList<HitObject>(compareObjects);
|
private readonly List<HitObject> nestedHitObjects = new List<HitObject>();
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public IReadOnlyList<HitObject> NestedHitObjects => nestedHitObjects;
|
public IReadOnlyList<HitObject> NestedHitObjects => nestedHitObjects;
|
||||||
@ -74,6 +73,8 @@ namespace osu.Game.Rulesets.Objects
|
|||||||
|
|
||||||
CreateNestedHitObjects();
|
CreateNestedHitObjects();
|
||||||
|
|
||||||
|
nestedHitObjects.Sort((h1, h2) => h1.StartTime.CompareTo(h2.StartTime));
|
||||||
|
|
||||||
foreach (var h in nestedHitObjects)
|
foreach (var h in nestedHitObjects)
|
||||||
{
|
{
|
||||||
h.HitWindows = HitWindows;
|
h.HitWindows = HitWindows;
|
||||||
@ -114,7 +115,5 @@ namespace osu.Game.Rulesets.Objects
|
|||||||
/// </para>
|
/// </para>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected virtual HitWindows CreateHitWindows() => new HitWindows();
|
protected virtual HitWindows CreateHitWindows() => new HitWindows();
|
||||||
|
|
||||||
private static int compareObjects(HitObject first, HitObject second) => first.StartTime.CompareTo(second.StartTime);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -245,7 +245,7 @@ namespace osu.Game.Rulesets.Objects.Legacy
|
|||||||
stringAddBank = null;
|
stringAddBank = null;
|
||||||
|
|
||||||
bankInfo.Normal = stringBank;
|
bankInfo.Normal = stringBank;
|
||||||
bankInfo.Add = stringAddBank;
|
bankInfo.Add = string.IsNullOrEmpty(stringAddBank) ? stringBank : stringAddBank;
|
||||||
|
|
||||||
if (split.Length > 2)
|
if (split.Length > 2)
|
||||||
bankInfo.CustomSampleBank = int.Parse(split[2]);
|
bankInfo.CustomSampleBank = int.Parse(split[2]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user