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

Merge tag '2018.1105.0' into tournament-tools

This commit is contained in:
Dean Herbert 2018-11-05 23:17:17 +09:00
commit 43c70d354d
32 changed files with 204 additions and 53 deletions

14
.github/ISSUE_TEMPLATE/bug-issues.md vendored Normal file
View File

@ -0,0 +1,14 @@
---
name: Bug Report
about: For issues regarding encountered game bugs
---
<!-- After you fill in all information, delete all comments in the issue -->
**Describe your problem:** <!-- Provide any information you believe could be useful -->
**Screenshots or videos showing encountered issue:**
**osu!lazer version:** <!-- Provide the version of your osu!lazer, you can find it at the bottom of the screen -->
**Logs:** <!-- Attach your osu!lazer logs, you can find them under %appdata%\osu\logs in Windows, or under ~/.local/share/osu/ in Linux and macOS -->

16
.github/ISSUE_TEMPLATE/crash-issues.md vendored Normal file
View File

@ -0,0 +1,16 @@
---
name: Crash Report
about: For issues regarding game crashes or permanent freezes
---
<!-- After you fill in all information, delete all comments in the issue -->
**Describe your problem:** <!-- Provide any information you believe could be useful -->
**Screenshots or videos showing encountered issue:**
**osu!lazer version:** <!-- Provide the version of your osu!lazer, you can find it at the bottom of the screen -->
**Logs:** <!-- Attach your osu!lazer logs, you can find them under %appdata%\osu\logs in Windows, or under ~/.local/share/osu/ in Linux and macOS -->
**Computer Specifications:** <!-- Attach your computer specifications, you can find them by using System Information in Windows, System Monitor in Linux, or About This Mac in macOS -->

View File

@ -0,0 +1,10 @@
---
name: Feature Request
about: Let us know what you would like to see in the game!
---
<!-- After you fill in all information, delete all comments in the issue -->
**Describe the feature:** <!-- Describe the feature you would like to see in the game -->
**Proposal designs of the feature:** <!-- Attach screenshots of how the feature should look like according to you -->

View File

@ -0,0 +1,10 @@
---
name: Missing for Live
about: Let us know the features you need which are available in osu-stable but not lazer
---
<!-- After you fill in all information, delete all comments in the issue -->
**Describe the feature:** <!-- Describe the missing game feature -->
**Designs:** <!-- Attach screenshots of how the feature is supposed to look like. For illustrative purpose only; final designs are usually re-imagined from scratch. -->

View File

@ -4,7 +4,7 @@
<PackageReference Include="Appveyor.TestLogger" Version="2.0.0" /> <PackageReference Include="Appveyor.TestLogger" Version="2.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" /> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="NUnit" Version="3.11.0" /> <PackageReference Include="NUnit" Version="3.11.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.10.0" /> <PackageReference Include="NUnit3TestAdapter" Version="3.11.0" />
<PackageReference Update="Microsoft.EntityFrameworkCore.Sqlite" Version="2.1.4" /> <PackageReference Update="Microsoft.EntityFrameworkCore.Sqlite" Version="2.1.4" />
</ItemGroup> </ItemGroup>
<PropertyGroup Label="Project"> <PropertyGroup Label="Project">

View File

@ -37,7 +37,7 @@ namespace osu.Game.Rulesets.Catch.Beatmaps
ControlPoints = curveData.ControlPoints, ControlPoints = curveData.ControlPoints,
PathType = curveData.PathType, PathType = curveData.PathType,
Distance = curveData.Distance, Distance = curveData.Distance,
RepeatSamples = curveData.RepeatSamples, NodeSamples = curveData.NodeSamples,
RepeatCount = curveData.RepeatCount, RepeatCount = curveData.RepeatCount,
X = (positionData?.X ?? 0) / CatchPlayfield.BASE_WIDTH, X = (positionData?.X ?? 0) / CatchPlayfield.BASE_WIDTH,
NewCombo = comboData?.NewCombo ?? false, NewCombo = comboData?.NewCombo ?? false,

View File

@ -152,7 +152,7 @@ namespace osu.Game.Rulesets.Catch.Objects
set { Path.ControlPoints = value; } set { Path.ControlPoints = value; }
} }
public List<List<SampleInfo>> RepeatSamples { get; set; } = new List<List<SampleInfo>>(); public List<List<SampleInfo>> NodeSamples { get; set; } = new List<List<SampleInfo>>();
public PathType PathType public PathType PathType
{ {

View File

@ -4,7 +4,7 @@
<PackageReference Include="Appveyor.TestLogger" Version="2.0.0" /> <PackageReference Include="Appveyor.TestLogger" Version="2.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" /> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="NUnit" Version="3.11.0" /> <PackageReference Include="NUnit" Version="3.11.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.10.0" /> <PackageReference Include="NUnit3TestAdapter" Version="3.11.0" />
<PackageReference Update="Microsoft.EntityFrameworkCore.Sqlite" Version="2.1.4" /> <PackageReference Update="Microsoft.EntityFrameworkCore.Sqlite" Version="2.1.4" />
</ItemGroup> </ItemGroup>
<PropertyGroup Label="Project"> <PropertyGroup Label="Project">

View File

@ -247,7 +247,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps
double segmentTime = (curveData.EndTime - HitObject.StartTime) / curveData.SpanCount(); double segmentTime = (curveData.EndTime - HitObject.StartTime) / curveData.SpanCount();
int index = (int)(segmentTime == 0 ? 0 : (time - HitObject.StartTime) / segmentTime); int index = (int)(segmentTime == 0 ? 0 : (time - HitObject.StartTime) / segmentTime);
return curveData.RepeatSamples[index]; return curveData.NodeSamples[index];
} }
} }
} }

View File

@ -470,7 +470,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy
double segmentTime = (EndTime - HitObject.StartTime) / spanCount; double segmentTime = (EndTime - HitObject.StartTime) / spanCount;
int index = (int)(segmentTime == 0 ? 0 : (time - HitObject.StartTime) / segmentTime); int index = (int)(segmentTime == 0 ? 0 : (time - HitObject.StartTime) / segmentTime);
return curveData.RepeatSamples[index]; return curveData.NodeSamples[index];
} }
/// <summary> /// <summary>

View File

@ -116,7 +116,7 @@ namespace osu.Game.Rulesets.Osu.Tests
}, },
Distance = 700, Distance = 700,
RepeatCount = repeats, RepeatCount = repeats,
RepeatSamples = createEmptySamples(repeats), NodeSamples = createEmptySamples(repeats),
StackHeight = 10 StackHeight = 10
}; };
@ -148,7 +148,7 @@ namespace osu.Game.Rulesets.Osu.Tests
}, },
Distance = distance, Distance = distance,
RepeatCount = repeats, RepeatCount = repeats,
RepeatSamples = createEmptySamples(repeats), NodeSamples = createEmptySamples(repeats),
StackHeight = stackHeight StackHeight = stackHeight
}; };
@ -169,7 +169,7 @@ namespace osu.Game.Rulesets.Osu.Tests
}, },
Distance = 600, Distance = 600,
RepeatCount = repeats, RepeatCount = repeats,
RepeatSamples = createEmptySamples(repeats) NodeSamples = createEmptySamples(repeats)
}; };
addSlider(slider, 2, 3); addSlider(slider, 2, 3);
@ -195,7 +195,7 @@ namespace osu.Game.Rulesets.Osu.Tests
}, },
Distance = 793.4417, Distance = 793.4417,
RepeatCount = repeats, RepeatCount = repeats,
RepeatSamples = createEmptySamples(repeats) NodeSamples = createEmptySamples(repeats)
}; };
addSlider(slider, 2, 3); addSlider(slider, 2, 3);
@ -220,7 +220,7 @@ namespace osu.Game.Rulesets.Osu.Tests
}, },
Distance = 480, Distance = 480,
RepeatCount = repeats, RepeatCount = repeats,
RepeatSamples = createEmptySamples(repeats) NodeSamples = createEmptySamples(repeats)
}; };
addSlider(slider, 2, 3); addSlider(slider, 2, 3);
@ -246,7 +246,7 @@ namespace osu.Game.Rulesets.Osu.Tests
}, },
Distance = 1000, Distance = 1000,
RepeatCount = repeats, RepeatCount = repeats,
RepeatSamples = createEmptySamples(repeats) NodeSamples = createEmptySamples(repeats)
}; };
addSlider(slider, 2, 3); addSlider(slider, 2, 3);
@ -274,7 +274,7 @@ namespace osu.Game.Rulesets.Osu.Tests
}, },
Distance = 300, Distance = 300,
RepeatCount = repeats, RepeatCount = repeats,
RepeatSamples = repeatSamples NodeSamples = repeatSamples
}; };
addSlider(slider, 3, 1); addSlider(slider, 3, 1);

View File

@ -4,7 +4,7 @@
<PackageReference Include="Appveyor.TestLogger" Version="2.0.0" /> <PackageReference Include="Appveyor.TestLogger" Version="2.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" /> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="NUnit" Version="3.11.0" /> <PackageReference Include="NUnit" Version="3.11.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.10.0" /> <PackageReference Include="NUnit3TestAdapter" Version="3.11.0" />
<PackageReference Update="Microsoft.EntityFrameworkCore.Sqlite" Version="2.1.4" /> <PackageReference Update="Microsoft.EntityFrameworkCore.Sqlite" Version="2.1.4" />
</ItemGroup> </ItemGroup>
<PropertyGroup Label="Project"> <PropertyGroup Label="Project">

View File

@ -38,7 +38,7 @@ namespace osu.Game.Rulesets.Osu.Beatmaps
ControlPoints = curveData.ControlPoints, ControlPoints = curveData.ControlPoints,
PathType = curveData.PathType, PathType = curveData.PathType,
Distance = curveData.Distance, Distance = curveData.Distance,
RepeatSamples = curveData.RepeatSamples, NodeSamples = curveData.NodeSamples,
RepeatCount = curveData.RepeatCount, RepeatCount = curveData.RepeatCount,
Position = positionData?.Position ?? Vector2.Zero, Position = positionData?.Position ?? Vector2.Zero,
NewCombo = comboData?.NewCombo ?? false, NewCombo = comboData?.NewCombo ?? false,

View File

@ -111,7 +111,8 @@ namespace osu.Game.Rulesets.Osu.Objects
/// </summary> /// </summary>
internal float LazyTravelDistance; internal float LazyTravelDistance;
public List<List<SampleInfo>> RepeatSamples { get; set; } = new List<List<SampleInfo>>(); public List<List<SampleInfo>> NodeSamples { get; set; } = new List<List<SampleInfo>>();
public int RepeatCount { get; set; } public int RepeatCount { get; set; }
/// <summary> /// <summary>
@ -169,7 +170,7 @@ namespace osu.Game.Rulesets.Osu.Objects
{ {
StartTime = StartTime, StartTime = StartTime,
Position = Position, Position = Position,
Samples = Samples, Samples = getNodeSamples(0),
SampleControlPoint = SampleControlPoint, SampleControlPoint = SampleControlPoint,
IndexInCurrentCombo = IndexInCurrentCombo, IndexInCurrentCombo = IndexInCurrentCombo,
ComboIndex = ComboIndex, ComboIndex = ComboIndex,
@ -249,11 +250,18 @@ namespace osu.Game.Rulesets.Osu.Objects
Position = Position + Path.PositionAt(repeat % 2), Position = Position + Path.PositionAt(repeat % 2),
StackHeight = StackHeight, StackHeight = StackHeight,
Scale = Scale, Scale = Scale,
Samples = new List<SampleInfo>(RepeatSamples[repeatIndex]) Samples = getNodeSamples(1 + repeatIndex)
}); });
} }
} }
private List<SampleInfo> getNodeSamples(int nodeIndex)
{
if (nodeIndex < NodeSamples.Count)
return NodeSamples[nodeIndex];
return Samples;
}
public override Judgement CreateJudgement() => new OsuJudgement(); public override Judgement CreateJudgement() => new OsuJudgement();
} }
} }

View File

@ -4,7 +4,7 @@
<PackageReference Include="Appveyor.TestLogger" Version="2.0.0" /> <PackageReference Include="Appveyor.TestLogger" Version="2.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" /> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="NUnit" Version="3.11.0" /> <PackageReference Include="NUnit" Version="3.11.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.10.0" /> <PackageReference Include="NUnit3TestAdapter" Version="3.11.0" />
<PackageReference Update="Microsoft.EntityFrameworkCore.Sqlite" Version="2.1.4" /> <PackageReference Update="Microsoft.EntityFrameworkCore.Sqlite" Version="2.1.4" />
</ItemGroup> </ItemGroup>
<PropertyGroup Label="Project"> <PropertyGroup Label="Project">

View File

@ -117,7 +117,7 @@ namespace osu.Game.Rulesets.Taiko.Beatmaps
if (!isForCurrentRuleset && tickSpacing > 0 && osuDuration < 2 * speedAdjustedBeatLength) if (!isForCurrentRuleset && tickSpacing > 0 && osuDuration < 2 * speedAdjustedBeatLength)
{ {
List<List<SampleInfo>> allSamples = curveData != null ? curveData.RepeatSamples : new List<List<SampleInfo>>(new[] { samples }); List<List<SampleInfo>> allSamples = curveData != null ? curveData.NodeSamples : new List<List<SampleInfo>>(new[] { samples });
int i = 0; int i = 0;
for (double j = obj.StartTime; j <= obj.StartTime + taikoDuration + tickSpacing / 8; j += tickSpacing) for (double j = obj.StartTime; j <= obj.StartTime + taikoDuration + tickSpacing / 8; j += tickSpacing)

View File

@ -14,6 +14,7 @@ using osu.Game.Beatmaps.Formats;
using osu.Game.Beatmaps.Timing; using osu.Game.Beatmaps.Timing;
using osu.Game.Rulesets.Catch.Beatmaps; using osu.Game.Rulesets.Catch.Beatmaps;
using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Objects.Legacy;
using osu.Game.Rulesets.Osu; using osu.Game.Rulesets.Osu;
using osu.Game.Rulesets.Osu.Beatmaps; using osu.Game.Rulesets.Osu.Beatmaps;
using osu.Game.Skinning; using osu.Game.Skinning;
@ -333,5 +334,61 @@ namespace osu.Game.Tests.Beatmaps.Formats
SampleInfo getTestableSampleInfo(HitObject hitObject) => hitObject.SampleControlPoint.ApplyTo(hitObject.Samples[0]); SampleInfo getTestableSampleInfo(HitObject hitObject) => hitObject.SampleControlPoint.ApplyTo(hitObject.Samples[0]);
} }
[Test]
public void TestDecodeSliderSamples()
{
var decoder = new LegacyBeatmapDecoder { ApplyOffsets = false };
using (var resStream = Resource.OpenResource("slider-samples.osu"))
using (var stream = new StreamReader(resStream))
{
var hitObjects = decoder.Decode(stream).HitObjects;
var slider1 = (ConvertSlider)hitObjects[0];
Assert.AreEqual(1, slider1.NodeSamples[0].Count);
Assert.AreEqual(SampleInfo.HIT_NORMAL, slider1.NodeSamples[0][0].Name);
Assert.AreEqual(1, slider1.NodeSamples[1].Count);
Assert.AreEqual(SampleInfo.HIT_NORMAL, slider1.NodeSamples[1][0].Name);
Assert.AreEqual(1, slider1.NodeSamples[2].Count);
Assert.AreEqual(SampleInfo.HIT_NORMAL, slider1.NodeSamples[2][0].Name);
var slider2 = (ConvertSlider)hitObjects[1];
Assert.AreEqual(2, slider2.NodeSamples[0].Count);
Assert.AreEqual(SampleInfo.HIT_NORMAL, slider2.NodeSamples[0][0].Name);
Assert.AreEqual(SampleInfo.HIT_CLAP, slider2.NodeSamples[0][1].Name);
Assert.AreEqual(2, slider2.NodeSamples[1].Count);
Assert.AreEqual(SampleInfo.HIT_NORMAL, slider2.NodeSamples[1][0].Name);
Assert.AreEqual(SampleInfo.HIT_CLAP, slider2.NodeSamples[1][1].Name);
Assert.AreEqual(2, slider2.NodeSamples[2].Count);
Assert.AreEqual(SampleInfo.HIT_NORMAL, slider2.NodeSamples[2][0].Name);
Assert.AreEqual(SampleInfo.HIT_CLAP, slider2.NodeSamples[2][1].Name);
var slider3 = (ConvertSlider)hitObjects[2];
Assert.AreEqual(2, slider3.NodeSamples[0].Count);
Assert.AreEqual(SampleInfo.HIT_NORMAL, slider3.NodeSamples[0][0].Name);
Assert.AreEqual(SampleInfo.HIT_WHISTLE, slider3.NodeSamples[0][1].Name);
Assert.AreEqual(1, slider3.NodeSamples[1].Count);
Assert.AreEqual(SampleInfo.HIT_NORMAL, slider3.NodeSamples[1][0].Name);
Assert.AreEqual(2, slider3.NodeSamples[2].Count);
Assert.AreEqual(SampleInfo.HIT_NORMAL, slider3.NodeSamples[2][0].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);
}
}
} }
} }

View File

@ -0,0 +1,4 @@
osu file format v14
[HitObjects]
444,320,1000,5,2,3:0:1:0:

View File

@ -0,0 +1,23 @@
osu file format v14
[General]
SampleSet: Normal
[Difficulty]
SliderMultiplier:1.6
SliderTickRate:2
[TimingPoints]
24735,389.61038961039,4,1,1,25,1,0
[HitObjects]
// Unified: Normal, Normal, Normal
168,256,30579,6,0,B|248:320|320:248,2,160
// Unified: Normal+Clap, Normal+Clap, Normal+Clap
168,256,32137,6,8,B|248:320|320:248,2,160
// Nodal: Normal+Whistle, Normal, Normal+Clap
// Nodal sounds should override the unified clap sound
168,256,33696,6,8,B|248:320|320:248,2,160,2|0|8

View File

@ -5,7 +5,7 @@
<PackageReference Include="DeepEqual" Version="1.6.0" /> <PackageReference Include="DeepEqual" Version="1.6.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" /> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="NUnit" Version="3.11.0" /> <PackageReference Include="NUnit" Version="3.11.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.10.0" /> <PackageReference Include="NUnit3TestAdapter" Version="3.11.0" />
<PackageReference Update="Microsoft.EntityFrameworkCore.Sqlite" Version="2.1.4" /> <PackageReference Update="Microsoft.EntityFrameworkCore.Sqlite" Version="2.1.4" />
</ItemGroup> </ItemGroup>
<PropertyGroup Label="Project"> <PropertyGroup Label="Project">

View File

@ -74,7 +74,6 @@ namespace osu.Game.Tournament.Tests
new VideoSprite(storage.GetStream("BG Logoless - OWC.m4v")) new VideoSprite(storage.GetStream("BG Logoless - OWC.m4v"))
{ {
Loop = true, Loop = true,
ShowLastFrameDuringHideCutoff = true,
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
FillMode = FillMode.Fit, FillMode = FillMode.Fit,
}, },

View File

@ -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);
} }
} }

View File

@ -37,7 +37,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Catch
}; };
} }
protected override HitObject CreateSlider(Vector2 position, bool newCombo, int comboOffset, Vector2[] controlPoints, double length, PathType pathType, int repeatCount, List<List<SampleInfo>> repeatSamples) protected override HitObject CreateSlider(Vector2 position, bool newCombo, int comboOffset, Vector2[] controlPoints, double length, PathType pathType, int repeatCount, List<List<SampleInfo>> nodeSamples)
{ {
newCombo |= forceNewCombo; newCombo |= forceNewCombo;
comboOffset += extraComboOffset; comboOffset += extraComboOffset;
@ -53,7 +53,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Catch
ControlPoints = controlPoints, ControlPoints = controlPoints,
Distance = length, Distance = length,
PathType = pathType, PathType = pathType,
RepeatSamples = repeatSamples, NodeSamples = nodeSamples,
RepeatCount = repeatCount RepeatCount = repeatCount
}; };
} }

View File

@ -179,6 +179,9 @@ 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, points, length, pathType, repeatCount, nodeSamples); result = CreateSlider(pos, combo, comboOffset, points, length, pathType, repeatCount, nodeSamples);
// The samples are played when the slider ends, which is the last node
result.Samples = nodeSamples[nodeSamples.Count - 1];
} }
else if (type.HasFlag(ConvertHitObjectType.Spinner)) else if (type.HasFlag(ConvertHitObjectType.Spinner))
{ {
@ -210,7 +213,9 @@ namespace osu.Game.Rulesets.Objects.Legacy
} }
result.StartTime = Convert.ToDouble(split[2], CultureInfo.InvariantCulture) + Offset; result.StartTime = Convert.ToDouble(split[2], CultureInfo.InvariantCulture) + Offset;
result.Samples = convertSoundType(soundType, bankInfo);
if (result.Samples.Count == 0)
result.Samples = convertSoundType(soundType, bankInfo);
FirstObject = false; FirstObject = false;
@ -240,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]);
@ -270,9 +275,9 @@ namespace osu.Game.Rulesets.Objects.Legacy
/// <param name="length">The slider length.</param> /// <param name="length">The slider length.</param>
/// <param name="pathType">The slider curve type.</param> /// <param name="pathType">The slider curve type.</param>
/// <param name="repeatCount">The slider repeat count.</param> /// <param name="repeatCount">The slider repeat count.</param>
/// <param name="repeatSamples">The samples to be played when the repeat nodes are hit. This includes the head and tail of the slider.</param> /// <param name="nodeSamples">The samples to be played when the slider nodes are hit. This includes the head and tail of the slider.</param>
/// <returns>The hit object.</returns> /// <returns>The hit object.</returns>
protected abstract HitObject CreateSlider(Vector2 position, bool newCombo, int comboOffset, Vector2[] controlPoints, double length, PathType pathType, int repeatCount, List<List<SampleInfo>> repeatSamples); protected abstract HitObject CreateSlider(Vector2 position, bool newCombo, int comboOffset, Vector2[] controlPoints, double length, PathType pathType, int repeatCount, List<List<SampleInfo>> nodeSamples);
/// <summary> /// <summary>
/// Creates a legacy Spinner-type hit object. /// Creates a legacy Spinner-type hit object.

View File

@ -26,7 +26,7 @@ namespace osu.Game.Rulesets.Objects.Legacy
public double Distance { get; set; } public double Distance { get; set; }
public List<List<SampleInfo>> RepeatSamples { get; set; } public List<List<SampleInfo>> NodeSamples { get; set; }
public int RepeatCount { get; set; } public int RepeatCount { get; set; }
public double EndTime => StartTime + this.SpanCount() * Distance / Velocity; public double EndTime => StartTime + this.SpanCount() * Distance / Velocity;

View File

@ -26,7 +26,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Mania
}; };
} }
protected override HitObject CreateSlider(Vector2 position, bool newCombo, int comboOffset, Vector2[] controlPoints, double length, PathType pathType, int repeatCount, List<List<SampleInfo>> repeatSamples) protected override HitObject CreateSlider(Vector2 position, bool newCombo, int comboOffset, Vector2[] controlPoints, double length, PathType pathType, int repeatCount, List<List<SampleInfo>> nodeSamples)
{ {
return new ConvertSlider return new ConvertSlider
{ {
@ -34,7 +34,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Mania
ControlPoints = controlPoints, ControlPoints = controlPoints,
Distance = length, Distance = length,
PathType = pathType, PathType = pathType,
RepeatSamples = repeatSamples, NodeSamples = nodeSamples,
RepeatCount = repeatCount RepeatCount = repeatCount
}; };
} }

View File

@ -38,7 +38,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Osu
}; };
} }
protected override HitObject CreateSlider(Vector2 position, bool newCombo, int comboOffset, Vector2[] controlPoints, double length, PathType pathType, int repeatCount, List<List<SampleInfo>> repeatSamples) protected override HitObject CreateSlider(Vector2 position, bool newCombo, int comboOffset, Vector2[] controlPoints, double length, PathType pathType, int repeatCount, List<List<SampleInfo>> nodeSamples)
{ {
newCombo |= forceNewCombo; newCombo |= forceNewCombo;
comboOffset += extraComboOffset; comboOffset += extraComboOffset;
@ -54,7 +54,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Osu
ControlPoints = controlPoints, ControlPoints = controlPoints,
Distance = Math.Max(0, length), Distance = Math.Max(0, length),
PathType = pathType, PathType = pathType,
RepeatSamples = repeatSamples, NodeSamples = nodeSamples,
RepeatCount = repeatCount RepeatCount = repeatCount
}; };
} }

View File

@ -23,14 +23,14 @@ namespace osu.Game.Rulesets.Objects.Legacy.Taiko
return new ConvertHit(); return new ConvertHit();
} }
protected override HitObject CreateSlider(Vector2 position, bool newCombo, int comboOffset, Vector2[] controlPoints, double length, PathType pathType, int repeatCount, List<List<SampleInfo>> repeatSamples) protected override HitObject CreateSlider(Vector2 position, bool newCombo, int comboOffset, Vector2[] controlPoints, double length, PathType pathType, int repeatCount, List<List<SampleInfo>> nodeSamples)
{ {
return new ConvertSlider return new ConvertSlider
{ {
ControlPoints = controlPoints, ControlPoints = controlPoints,
Distance = length, Distance = length,
PathType = pathType, PathType = pathType,
RepeatSamples = repeatSamples, NodeSamples = nodeSamples,
RepeatCount = repeatCount RepeatCount = repeatCount
}; };
} }

View File

@ -17,9 +17,15 @@ namespace osu.Game.Rulesets.Objects.Types
int RepeatCount { get; } int RepeatCount { get; }
/// <summary> /// <summary>
/// The samples to be played when each repeat node is hit (0 -> first repeat node, 1 -> second repeat node, etc). /// The samples to be played when each node of the <see cref="IHasRepeats"/> is hit.<br />
/// 0: The first node.<br />
/// 1: The first repeat.<br />
/// 2: The second repeat.<br />
/// ...<br />
/// n-1: The last repeat.<br />
/// n: The last node.
/// </summary> /// </summary>
List<List<SampleInfo>> RepeatSamples { get; } List<List<SampleInfo>> NodeSamples { get; }
} }
public static class HasRepeatsExtensions public static class HasRepeatsExtensions

View File

@ -7,6 +7,7 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Shapes;
using osu.Framework.Input.Events; using osu.Framework.Input.Events;
using osu.Framework.Threading;
using osu.Framework.Timing; using osu.Framework.Timing;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
using osu.Game.Graphics; using osu.Game.Graphics;
@ -43,17 +44,23 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Parts
return true; return true;
} }
private ScheduledDelegate scheduledSeek;
/// <summary> /// <summary>
/// Seeks the <see cref="SummaryTimeline"/> to the time closest to a position on the screen relative to the <see cref="SummaryTimeline"/>. /// Seeks the <see cref="SummaryTimeline"/> to the time closest to a position on the screen relative to the <see cref="SummaryTimeline"/>.
/// </summary> /// </summary>
/// <param name="screenPosition">The position in screen coordinates.</param> /// <param name="screenPosition">The position in screen coordinates.</param>
private void seekToPosition(Vector2 screenPosition) private void seekToPosition(Vector2 screenPosition)
{ {
if (Beatmap.Value == null) scheduledSeek?.Cancel();
return; scheduledSeek = Schedule(() =>
{
if (Beatmap.Value == null)
return;
float markerPos = MathHelper.Clamp(ToLocalSpace(screenPosition).X, 0, DrawWidth); float markerPos = MathHelper.Clamp(ToLocalSpace(screenPosition).X, 0, DrawWidth);
adjustableClock.Seek(markerPos / DrawWidth * Beatmap.Value.Track.Length); adjustableClock.Seek(markerPos / DrawWidth * Beatmap.Value.Track.Length);
});
} }
protected override void Update() protected override void Update()

View File

@ -11,7 +11,6 @@
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" /> <Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup> </ItemGroup>
<ItemGroup Label="Project References"> <ItemGroup Label="Project References">
<ProjectReference Include="..\..\osu-framework\osu.Framework\osu.Framework.csproj" />
<ProjectReference Include="..\osu-resources\osu.Game.Resources\osu.Game.Resources.csproj" /> <ProjectReference Include="..\osu-resources\osu.Game.Resources\osu.Game.Resources.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup Label="Package References"> <ItemGroup Label="Package References">
@ -19,7 +18,7 @@
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.1.4" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.1.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.1.4" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.1.4" />
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" /> <PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
<PackageReference Include="ppy.osu.Framework" Version="0.0.7459" /> <PackageReference Include="ppy.osu.Framework" Version="2018.1105.0" />
<PackageReference Include="SharpCompress" Version="0.22.0" /> <PackageReference Include="SharpCompress" Version="0.22.0" />
<PackageReference Include="NUnit" Version="3.11.0" /> <PackageReference Include="NUnit" Version="3.11.0" />
<PackageReference Include="SharpRaven" Version="2.4.0" /> <PackageReference Include="SharpRaven" Version="2.4.0" />

View File

@ -31,8 +31,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Game.Tournament", "osu.
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Game.Tournament.Tests", "osu.Game.Tournament.Tests\osu.Game.Tournament.Tests.csproj", "{5789E78D-38F9-4072-AB7B-978F34B2C17F}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Game.Tournament.Tests", "osu.Game.Tournament.Tests\osu.Game.Tournament.Tests.csproj", "{5789E78D-38F9-4072-AB7B-978F34B2C17F}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Framework", "..\osu-framework\osu.Framework\osu.Framework.csproj", "{7A69A230-45A1-4444-8C43-A582E4F48C1E}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -95,10 +93,6 @@ Global
{5789E78D-38F9-4072-AB7B-978F34B2C17F}.Debug|Any CPU.Build.0 = Debug|Any CPU {5789E78D-38F9-4072-AB7B-978F34B2C17F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5789E78D-38F9-4072-AB7B-978F34B2C17F}.Release|Any CPU.ActiveCfg = Release|Any CPU {5789E78D-38F9-4072-AB7B-978F34B2C17F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5789E78D-38F9-4072-AB7B-978F34B2C17F}.Release|Any CPU.Build.0 = Release|Any CPU {5789E78D-38F9-4072-AB7B-978F34B2C17F}.Release|Any CPU.Build.0 = Release|Any CPU
{7A69A230-45A1-4444-8C43-A582E4F48C1E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7A69A230-45A1-4444-8C43-A582E4F48C1E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7A69A230-45A1-4444-8C43-A582E4F48C1E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7A69A230-45A1-4444-8C43-A582E4F48C1E}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE