mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 16:27:26 +08:00
Merge pull request #3232 from smoogipoo/fix-combo-colours
Implement hitobject combo offsets
This commit is contained in:
commit
d110d19f99
@ -41,6 +41,7 @@ namespace osu.Game.Rulesets.Catch.Beatmaps
|
||||
RepeatCount = curveData.RepeatCount,
|
||||
X = (positionData?.X ?? 0) / CatchPlayfield.BASE_WIDTH,
|
||||
NewCombo = comboData?.NewCombo ?? false,
|
||||
ComboOffset = comboData?.ComboOffset ?? 0,
|
||||
LegacyLastTickOffset = legacyOffset?.LegacyLastTickOffset ?? 0
|
||||
};
|
||||
}
|
||||
@ -51,7 +52,8 @@ namespace osu.Game.Rulesets.Catch.Beatmaps
|
||||
StartTime = obj.StartTime,
|
||||
Samples = obj.Samples,
|
||||
Duration = endTime.Duration,
|
||||
NewCombo = comboData?.NewCombo ?? false
|
||||
NewCombo = comboData?.NewCombo ?? false,
|
||||
ComboOffset = comboData?.ComboOffset ?? 0,
|
||||
};
|
||||
}
|
||||
else
|
||||
@ -61,6 +63,7 @@ namespace osu.Game.Rulesets.Catch.Beatmaps
|
||||
StartTime = obj.StartTime,
|
||||
Samples = obj.Samples,
|
||||
NewCombo = comboData?.NewCombo ?? false,
|
||||
ComboOffset = comboData?.ComboOffset ?? 0,
|
||||
X = (positionData?.X ?? 0) / CatchPlayfield.BASE_WIDTH
|
||||
};
|
||||
}
|
||||
|
@ -20,6 +20,8 @@ namespace osu.Game.Rulesets.Catch.Objects
|
||||
|
||||
public virtual bool NewCombo { get; set; }
|
||||
|
||||
public int ComboOffset { get; set; }
|
||||
|
||||
public int IndexInCurrentCombo { get; set; }
|
||||
|
||||
public int ComboIndex { get; set; }
|
||||
|
@ -42,6 +42,7 @@ namespace osu.Game.Rulesets.Osu.Beatmaps
|
||||
RepeatCount = curveData.RepeatCount,
|
||||
Position = positionData?.Position ?? Vector2.Zero,
|
||||
NewCombo = comboData?.NewCombo ?? false,
|
||||
ComboOffset = comboData?.ComboOffset ?? 0,
|
||||
LegacyLastTickOffset = legacyOffset?.LegacyLastTickOffset
|
||||
};
|
||||
}
|
||||
@ -52,7 +53,9 @@ namespace osu.Game.Rulesets.Osu.Beatmaps
|
||||
StartTime = original.StartTime,
|
||||
Samples = original.Samples,
|
||||
EndTime = endTimeData.EndTime,
|
||||
Position = positionData?.Position ?? OsuPlayfield.BASE_SIZE / 2
|
||||
Position = positionData?.Position ?? OsuPlayfield.BASE_SIZE / 2,
|
||||
NewCombo = comboData?.NewCombo ?? false,
|
||||
ComboOffset = comboData?.ComboOffset ?? 0,
|
||||
};
|
||||
}
|
||||
else
|
||||
@ -62,7 +65,8 @@ namespace osu.Game.Rulesets.Osu.Beatmaps
|
||||
StartTime = original.StartTime,
|
||||
Samples = original.Samples,
|
||||
Position = positionData?.Position ?? Vector2.Zero,
|
||||
NewCombo = comboData?.NewCombo ?? false
|
||||
NewCombo = comboData?.NewCombo ?? false,
|
||||
ComboOffset = comboData?.ComboOffset ?? 0,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -54,6 +54,8 @@ namespace osu.Game.Rulesets.Osu.Objects
|
||||
|
||||
public virtual bool NewCombo { get; set; }
|
||||
|
||||
public int ComboOffset { get; set; }
|
||||
|
||||
public virtual int IndexInCurrentCombo { get; set; }
|
||||
|
||||
public virtual int ComboIndex { get; set; }
|
||||
|
@ -186,6 +186,18 @@ namespace osu.Game.Tests.Beatmaps.Formats
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestDecodeBeatmapComboOffsets()
|
||||
{
|
||||
var decoder = new LegacyBeatmapDecoder();
|
||||
using (var resStream = Resource.OpenResource("hitobject-combo-offset.osu"))
|
||||
using (var stream = new StreamReader(resStream))
|
||||
{
|
||||
var beatmap = decoder.Decode(stream);
|
||||
Assert.AreEqual(3, ((IHasCombo)beatmap.HitObjects[0]).ComboOffset);
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestDecodeBeatmapHitObjects()
|
||||
{
|
||||
|
4
osu.Game.Tests/Resources/hitobject-combo-offset.osu
Normal file
4
osu.Game.Tests/Resources/hitobject-combo-offset.osu
Normal file
@ -0,0 +1,4 @@
|
||||
osu file format v14
|
||||
|
||||
[HitObjects]
|
||||
255,193,2170,49,0,0:0:0:0:
|
@ -27,11 +27,10 @@ namespace osu.Game.Beatmaps
|
||||
if (obj.NewCombo)
|
||||
{
|
||||
obj.IndexInCurrentCombo = 0;
|
||||
obj.ComboIndex = (lastObj?.ComboIndex ?? 0) + obj.ComboOffset + 1;
|
||||
|
||||
if (lastObj != null)
|
||||
{
|
||||
lastObj.LastInCombo = true;
|
||||
obj.ComboIndex = lastObj.ComboIndex + 1;
|
||||
}
|
||||
}
|
||||
else if (lastObj != null)
|
||||
{
|
||||
|
@ -126,16 +126,16 @@ namespace osu.Game.Beatmaps.Formats
|
||||
switch (beatmap.BeatmapInfo.RulesetID)
|
||||
{
|
||||
case 0:
|
||||
parser = new Rulesets.Objects.Legacy.Osu.ConvertHitObjectParser();
|
||||
parser = new Rulesets.Objects.Legacy.Osu.ConvertHitObjectParser(getOffsetTime(), FormatVersion);
|
||||
break;
|
||||
case 1:
|
||||
parser = new Rulesets.Objects.Legacy.Taiko.ConvertHitObjectParser();
|
||||
parser = new Rulesets.Objects.Legacy.Taiko.ConvertHitObjectParser(getOffsetTime(), FormatVersion);
|
||||
break;
|
||||
case 2:
|
||||
parser = new Rulesets.Objects.Legacy.Catch.ConvertHitObjectParser();
|
||||
parser = new Rulesets.Objects.Legacy.Catch.ConvertHitObjectParser(getOffsetTime(), FormatVersion);
|
||||
break;
|
||||
case 3:
|
||||
parser = new Rulesets.Objects.Legacy.Mania.ConvertHitObjectParser();
|
||||
parser = new Rulesets.Objects.Legacy.Mania.ConvertHitObjectParser(getOffsetTime(), FormatVersion);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -405,9 +405,9 @@ namespace osu.Game.Beatmaps.Formats
|
||||
{
|
||||
// If the ruleset wasn't specified, assume the osu!standard ruleset.
|
||||
if (parser == null)
|
||||
parser = new Rulesets.Objects.Legacy.Osu.ConvertHitObjectParser();
|
||||
parser = new Rulesets.Objects.Legacy.Osu.ConvertHitObjectParser(getOffsetTime(), FormatVersion);
|
||||
|
||||
var obj = parser.Parse(line, getOffsetTime());
|
||||
var obj = parser.Parse(line);
|
||||
|
||||
if (obj != null)
|
||||
{
|
||||
|
@ -13,5 +13,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Catch
|
||||
public float X { get; set; }
|
||||
|
||||
public bool NewCombo { get; set; }
|
||||
|
||||
public int ComboOffset { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -13,21 +13,28 @@ namespace osu.Game.Rulesets.Objects.Legacy.Catch
|
||||
/// </summary>
|
||||
public class ConvertHitObjectParser : Legacy.ConvertHitObjectParser
|
||||
{
|
||||
protected override HitObject CreateHit(Vector2 position, bool newCombo)
|
||||
public ConvertHitObjectParser(double offset, int formatVersion)
|
||||
: base(offset, formatVersion)
|
||||
{
|
||||
}
|
||||
|
||||
protected override HitObject CreateHit(Vector2 position, bool newCombo, int comboOffset)
|
||||
{
|
||||
return new ConvertHit
|
||||
{
|
||||
X = position.X,
|
||||
NewCombo = newCombo,
|
||||
ComboOffset = comboOffset
|
||||
};
|
||||
}
|
||||
|
||||
protected override HitObject CreateSlider(Vector2 position, bool newCombo, List<Vector2> controlPoints, double length, CurveType curveType, int repeatCount, List<List<SampleInfo>> repeatSamples)
|
||||
protected override HitObject CreateSlider(Vector2 position, bool newCombo, int comboOffset, List<Vector2> controlPoints, double length, CurveType curveType, int repeatCount, List<List<SampleInfo>> repeatSamples)
|
||||
{
|
||||
return new ConvertSlider
|
||||
{
|
||||
X = position.X,
|
||||
NewCombo = newCombo,
|
||||
NewCombo = FirstObject || newCombo,
|
||||
ComboOffset = comboOffset,
|
||||
ControlPoints = controlPoints,
|
||||
Distance = length,
|
||||
CurveType = curveType,
|
||||
@ -36,15 +43,17 @@ namespace osu.Game.Rulesets.Objects.Legacy.Catch
|
||||
};
|
||||
}
|
||||
|
||||
protected override HitObject CreateSpinner(Vector2 position, double endTime)
|
||||
protected override HitObject CreateSpinner(Vector2 position, bool newCombo, int comboOffset, double endTime)
|
||||
{
|
||||
return new ConvertSpinner
|
||||
{
|
||||
EndTime = endTime
|
||||
EndTime = endTime,
|
||||
NewCombo = FirstObject || newCombo,
|
||||
ComboOffset = comboOffset
|
||||
};
|
||||
}
|
||||
|
||||
protected override HitObject CreateHold(Vector2 position, bool newCombo, double endTime)
|
||||
protected override HitObject CreateHold(Vector2 position, bool newCombo, int comboOffset, double endTime)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
@ -13,5 +13,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Catch
|
||||
public float X { get; set; }
|
||||
|
||||
public bool NewCombo { get; set; }
|
||||
|
||||
public int ComboOffset { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -8,10 +8,14 @@ namespace osu.Game.Rulesets.Objects.Legacy.Catch
|
||||
/// <summary>
|
||||
/// Legacy osu!catch Spinner-type, used for parsing Beatmaps.
|
||||
/// </summary>
|
||||
internal sealed class ConvertSpinner : HitObject, IHasEndTime
|
||||
internal sealed class ConvertSpinner : HitObject, IHasEndTime, IHasCombo
|
||||
{
|
||||
public double EndTime { get; set; }
|
||||
|
||||
public double Duration => EndTime - StartTime;
|
||||
|
||||
public bool NewCombo { get; set; }
|
||||
|
||||
public int ComboOffset { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -19,12 +19,25 @@ namespace osu.Game.Rulesets.Objects.Legacy
|
||||
/// </summary>
|
||||
public abstract class ConvertHitObjectParser : HitObjectParser
|
||||
{
|
||||
public override HitObject Parse(string text)
|
||||
/// <summary>
|
||||
/// The offset to apply to all time values.
|
||||
/// </summary>
|
||||
protected readonly double Offset;
|
||||
|
||||
/// <summary>
|
||||
/// The beatmap version.
|
||||
/// </summary>
|
||||
protected readonly int FormatVersion;
|
||||
|
||||
protected bool FirstObject { get; private set; } = true;
|
||||
|
||||
protected ConvertHitObjectParser(double offset, int formatVersion)
|
||||
{
|
||||
return Parse(text, 0);
|
||||
Offset = offset;
|
||||
FormatVersion = formatVersion;
|
||||
}
|
||||
|
||||
public HitObject Parse(string text, double offset)
|
||||
public override HitObject Parse(string text)
|
||||
{
|
||||
try
|
||||
{
|
||||
@ -32,7 +45,11 @@ namespace osu.Game.Rulesets.Objects.Legacy
|
||||
|
||||
Vector2 pos = new Vector2((int)Convert.ToSingle(split[0], CultureInfo.InvariantCulture), (int)Convert.ToSingle(split[1], CultureInfo.InvariantCulture));
|
||||
|
||||
ConvertHitObjectType type = (ConvertHitObjectType)int.Parse(split[3]) & ~ConvertHitObjectType.ColourHax;
|
||||
ConvertHitObjectType type = (ConvertHitObjectType)int.Parse(split[3]);
|
||||
|
||||
int comboOffset = (int)(type & ConvertHitObjectType.ComboOffset) >> 4;
|
||||
type &= ~ConvertHitObjectType.ComboOffset;
|
||||
|
||||
bool combo = type.HasFlag(ConvertHitObjectType.NewCombo);
|
||||
type &= ~ConvertHitObjectType.NewCombo;
|
||||
|
||||
@ -43,7 +60,7 @@ namespace osu.Game.Rulesets.Objects.Legacy
|
||||
|
||||
if (type.HasFlag(ConvertHitObjectType.Circle))
|
||||
{
|
||||
result = CreateHit(pos, combo);
|
||||
result = CreateHit(pos, combo, comboOffset);
|
||||
|
||||
if (split.Length > 5)
|
||||
readCustomSampleBanks(split[5], bankInfo);
|
||||
@ -148,11 +165,11 @@ namespace osu.Game.Rulesets.Objects.Legacy
|
||||
for (int i = 0; i < nodes; i++)
|
||||
nodeSamples.Add(convertSoundType(nodeSoundTypes[i], nodeBankInfos[i]));
|
||||
|
||||
result = CreateSlider(pos, combo, points, length, curveType, repeatCount, nodeSamples);
|
||||
result = CreateSlider(pos, combo, comboOffset, points, length, curveType, repeatCount, nodeSamples);
|
||||
}
|
||||
else if (type.HasFlag(ConvertHitObjectType.Spinner))
|
||||
{
|
||||
result = CreateSpinner(new Vector2(512, 384) / 2, Convert.ToDouble(split[5], CultureInfo.InvariantCulture) + offset);
|
||||
result = CreateSpinner(new Vector2(512, 384) / 2, combo, comboOffset, Convert.ToDouble(split[5], CultureInfo.InvariantCulture) + Offset);
|
||||
|
||||
if (split.Length > 6)
|
||||
readCustomSampleBanks(split[6], bankInfo);
|
||||
@ -170,15 +187,17 @@ namespace osu.Game.Rulesets.Objects.Legacy
|
||||
readCustomSampleBanks(string.Join(":", ss.Skip(1)), bankInfo);
|
||||
}
|
||||
|
||||
result = CreateHold(pos, combo, endTime + offset);
|
||||
result = CreateHold(pos, combo, comboOffset, endTime + Offset);
|
||||
}
|
||||
|
||||
if (result == null)
|
||||
throw new InvalidOperationException($@"Unknown hit object type {type}.");
|
||||
|
||||
result.StartTime = Convert.ToDouble(split[2], CultureInfo.InvariantCulture) + offset;
|
||||
result.StartTime = Convert.ToDouble(split[2], CultureInfo.InvariantCulture) + Offset;
|
||||
result.Samples = convertSoundType(soundType, bankInfo);
|
||||
|
||||
FirstObject = false;
|
||||
|
||||
return result;
|
||||
}
|
||||
catch (FormatException)
|
||||
@ -221,37 +240,42 @@ namespace osu.Game.Rulesets.Objects.Legacy
|
||||
/// </summary>
|
||||
/// <param name="position">The position of the hit object.</param>
|
||||
/// <param name="newCombo">Whether the hit object creates a new combo.</param>
|
||||
/// <param name="comboOffset">When starting a new combo, the offset of the new combo relative to the current one.</param>
|
||||
/// <returns>The hit object.</returns>
|
||||
protected abstract HitObject CreateHit(Vector2 position, bool newCombo);
|
||||
protected abstract HitObject CreateHit(Vector2 position, bool newCombo, int comboOffset);
|
||||
|
||||
/// <summary>
|
||||
/// Creats a legacy Slider-type hit object.
|
||||
/// </summary>
|
||||
/// <param name="position">The position of the hit object.</param>
|
||||
/// <param name="newCombo">Whether the hit object creates a new combo.</param>
|
||||
/// <param name="comboOffset">When starting a new combo, the offset of the new combo relative to the current one.</param>
|
||||
/// <param name="controlPoints">The slider control points.</param>
|
||||
/// <param name="length">The slider length.</param>
|
||||
/// <param name="curveType">The slider curve type.</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>
|
||||
/// <returns>The hit object.</returns>
|
||||
protected abstract HitObject CreateSlider(Vector2 position, bool newCombo, List<Vector2> controlPoints, double length, CurveType curveType, int repeatCount, List<List<SampleInfo>> repeatSamples);
|
||||
protected abstract HitObject CreateSlider(Vector2 position, bool newCombo, int comboOffset, List<Vector2> controlPoints, double length, CurveType curveType, int repeatCount, List<List<SampleInfo>> repeatSamples);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a legacy Spinner-type hit object.
|
||||
/// </summary>
|
||||
/// <param name="position">The position of the hit object.</param>
|
||||
/// <param name="newCombo">Whether the hit object creates a new combo.</param>
|
||||
/// <param name="comboOffset">When starting a new combo, the offset of the new combo relative to the current one.</param>
|
||||
/// <param name="endTime">The spinner end time.</param>
|
||||
/// <returns>The hit object.</returns>
|
||||
protected abstract HitObject CreateSpinner(Vector2 position, double endTime);
|
||||
protected abstract HitObject CreateSpinner(Vector2 position, bool newCombo, int comboOffset, double endTime);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a legacy Hold-type hit object.
|
||||
/// </summary>
|
||||
/// <param name="position">The position of the hit object.</param>
|
||||
/// <param name="newCombo">Whether the hit object creates a new combo.</param>
|
||||
/// <param name="comboOffset">When starting a new combo, the offset of the new combo relative to the current one.</param>
|
||||
/// <param name="endTime">The hold end time.</param>
|
||||
protected abstract HitObject CreateHold(Vector2 position, bool newCombo, double endTime);
|
||||
protected abstract HitObject CreateHold(Vector2 position, bool newCombo, int comboOffset, double endTime);
|
||||
|
||||
private List<SampleInfo> convertSoundType(LegacySoundType type, SampleBankInfo bankInfo)
|
||||
{
|
||||
|
@ -12,7 +12,7 @@ namespace osu.Game.Rulesets.Objects.Legacy
|
||||
Slider = 1 << 1,
|
||||
NewCombo = 1 << 2,
|
||||
Spinner = 1 << 3,
|
||||
ColourHax = 112,
|
||||
ComboOffset = 1 << 4 | 1 << 5 | 1 << 6,
|
||||
Hold = 1 << 7
|
||||
}
|
||||
}
|
||||
|
@ -8,12 +8,10 @@ namespace osu.Game.Rulesets.Objects.Legacy.Mania
|
||||
/// <summary>
|
||||
/// Legacy osu!mania Hit-type, used for parsing Beatmaps.
|
||||
/// </summary>
|
||||
internal sealed class ConvertHit : HitObject, IHasXPosition, IHasCombo
|
||||
internal sealed class ConvertHit : HitObject, IHasXPosition
|
||||
{
|
||||
public float X { get; set; }
|
||||
|
||||
public bool NewCombo { get; set; }
|
||||
|
||||
protected override HitWindows CreateHitWindows() => null;
|
||||
}
|
||||
}
|
||||
|
@ -13,21 +13,24 @@ namespace osu.Game.Rulesets.Objects.Legacy.Mania
|
||||
/// </summary>
|
||||
public class ConvertHitObjectParser : Legacy.ConvertHitObjectParser
|
||||
{
|
||||
protected override HitObject CreateHit(Vector2 position, bool newCombo)
|
||||
public ConvertHitObjectParser(double offset, int formatVersion)
|
||||
: base(offset, formatVersion)
|
||||
{
|
||||
}
|
||||
|
||||
protected override HitObject CreateHit(Vector2 position, bool newCombo, int comboOffset)
|
||||
{
|
||||
return new ConvertHit
|
||||
{
|
||||
X = position.X,
|
||||
NewCombo = newCombo,
|
||||
X = position.X
|
||||
};
|
||||
}
|
||||
|
||||
protected override HitObject CreateSlider(Vector2 position, bool newCombo, List<Vector2> controlPoints, double length, CurveType curveType, int repeatCount, List<List<SampleInfo>> repeatSamples)
|
||||
protected override HitObject CreateSlider(Vector2 position, bool newCombo, int comboOffset, List<Vector2> controlPoints, double length, CurveType curveType, int repeatCount, List<List<SampleInfo>> repeatSamples)
|
||||
{
|
||||
return new ConvertSlider
|
||||
{
|
||||
X = position.X,
|
||||
NewCombo = newCombo,
|
||||
ControlPoints = controlPoints,
|
||||
Distance = length,
|
||||
CurveType = curveType,
|
||||
@ -36,7 +39,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Mania
|
||||
};
|
||||
}
|
||||
|
||||
protected override HitObject CreateSpinner(Vector2 position, double endTime)
|
||||
protected override HitObject CreateSpinner(Vector2 position, bool newCombo, int comboOffset, double endTime)
|
||||
{
|
||||
return new ConvertSpinner
|
||||
{
|
||||
@ -45,7 +48,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Mania
|
||||
};
|
||||
}
|
||||
|
||||
protected override HitObject CreateHold(Vector2 position, bool newCombo, double endTime)
|
||||
protected override HitObject CreateHold(Vector2 position, bool newCombo, int comboOffset, double endTime)
|
||||
{
|
||||
return new ConvertHold
|
||||
{
|
||||
|
@ -8,12 +8,10 @@ namespace osu.Game.Rulesets.Objects.Legacy.Mania
|
||||
/// <summary>
|
||||
/// Legacy osu!mania Slider-type, used for parsing Beatmaps.
|
||||
/// </summary>
|
||||
internal sealed class ConvertSlider : Legacy.ConvertSlider, IHasXPosition, IHasCombo
|
||||
internal sealed class ConvertSlider : Legacy.ConvertSlider, IHasXPosition
|
||||
{
|
||||
public float X { get; set; }
|
||||
|
||||
public bool NewCombo { get; set; }
|
||||
|
||||
protected override HitWindows CreateHitWindows() => null;
|
||||
}
|
||||
}
|
||||
|
@ -19,6 +19,8 @@ namespace osu.Game.Rulesets.Objects.Legacy.Osu
|
||||
|
||||
public bool NewCombo { get; set; }
|
||||
|
||||
public int ComboOffset { get; set; }
|
||||
|
||||
protected override HitWindows CreateHitWindows() => null;
|
||||
}
|
||||
}
|
||||
|
@ -14,21 +14,28 @@ namespace osu.Game.Rulesets.Objects.Legacy.Osu
|
||||
/// </summary>
|
||||
public class ConvertHitObjectParser : Legacy.ConvertHitObjectParser
|
||||
{
|
||||
protected override HitObject CreateHit(Vector2 position, bool newCombo)
|
||||
public ConvertHitObjectParser(double offset, int formatVersion)
|
||||
: base(offset, formatVersion)
|
||||
{
|
||||
}
|
||||
|
||||
protected override HitObject CreateHit(Vector2 position, bool newCombo, int comboOffset)
|
||||
{
|
||||
return new ConvertHit
|
||||
{
|
||||
Position = position,
|
||||
NewCombo = newCombo,
|
||||
NewCombo = FirstObject || newCombo,
|
||||
ComboOffset = comboOffset
|
||||
};
|
||||
}
|
||||
|
||||
protected override HitObject CreateSlider(Vector2 position, bool newCombo, List<Vector2> controlPoints, double length, CurveType curveType, int repeatCount, List<List<SampleInfo>> repeatSamples)
|
||||
protected override HitObject CreateSlider(Vector2 position, bool newCombo, int comboOffset, List<Vector2> controlPoints, double length, CurveType curveType, int repeatCount, List<List<SampleInfo>> repeatSamples)
|
||||
{
|
||||
return new ConvertSlider
|
||||
{
|
||||
Position = position,
|
||||
NewCombo = newCombo,
|
||||
NewCombo = FirstObject || newCombo,
|
||||
ComboOffset = comboOffset,
|
||||
ControlPoints = controlPoints,
|
||||
Distance = Math.Max(0, length),
|
||||
CurveType = curveType,
|
||||
@ -37,16 +44,18 @@ namespace osu.Game.Rulesets.Objects.Legacy.Osu
|
||||
};
|
||||
}
|
||||
|
||||
protected override HitObject CreateSpinner(Vector2 position, double endTime)
|
||||
protected override HitObject CreateSpinner(Vector2 position, bool newCombo, int comboOffset, double endTime)
|
||||
{
|
||||
return new ConvertSpinner
|
||||
{
|
||||
Position = position,
|
||||
EndTime = endTime
|
||||
EndTime = endTime,
|
||||
NewCombo = FormatVersion <= 8 || FirstObject || newCombo,
|
||||
ComboOffset = comboOffset
|
||||
};
|
||||
}
|
||||
|
||||
protected override HitObject CreateHold(Vector2 position, bool newCombo, double endTime)
|
||||
protected override HitObject CreateHold(Vector2 position, bool newCombo, int comboOffset, double endTime)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
@ -19,6 +19,8 @@ namespace osu.Game.Rulesets.Objects.Legacy.Osu
|
||||
|
||||
public bool NewCombo { get; set; }
|
||||
|
||||
public int ComboOffset { get; set; }
|
||||
|
||||
protected override HitWindows CreateHitWindows() => null;
|
||||
}
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Osu
|
||||
/// <summary>
|
||||
/// Legacy osu! Spinner-type, used for parsing Beatmaps.
|
||||
/// </summary>
|
||||
internal sealed class ConvertSpinner : HitObject, IHasEndTime, IHasPosition
|
||||
internal sealed class ConvertSpinner : HitObject, IHasEndTime, IHasPosition, IHasCombo
|
||||
{
|
||||
public double EndTime { get; set; }
|
||||
|
||||
@ -22,5 +22,9 @@ namespace osu.Game.Rulesets.Objects.Legacy.Osu
|
||||
public float Y => Position.Y;
|
||||
|
||||
protected override HitWindows CreateHitWindows() => null;
|
||||
|
||||
public bool NewCombo { get; set; }
|
||||
|
||||
public int ComboOffset { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,17 +1,13 @@
|
||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Game.Rulesets.Objects.Types;
|
||||
|
||||
namespace osu.Game.Rulesets.Objects.Legacy.Taiko
|
||||
{
|
||||
/// <summary>
|
||||
/// Legacy osu!taiko Hit-type, used for parsing Beatmaps.
|
||||
/// </summary>
|
||||
internal sealed class ConvertHit : HitObject, IHasCombo
|
||||
internal sealed class ConvertHit : HitObject
|
||||
{
|
||||
public bool NewCombo { get; set; }
|
||||
|
||||
protected override HitWindows CreateHitWindows() => null;
|
||||
}
|
||||
}
|
||||
|
@ -13,19 +13,20 @@ namespace osu.Game.Rulesets.Objects.Legacy.Taiko
|
||||
/// </summary>
|
||||
public class ConvertHitObjectParser : Legacy.ConvertHitObjectParser
|
||||
{
|
||||
protected override HitObject CreateHit(Vector2 position, bool newCombo)
|
||||
public ConvertHitObjectParser(double offset, int formatVersion)
|
||||
: base(offset, formatVersion)
|
||||
{
|
||||
return new ConvertHit
|
||||
{
|
||||
NewCombo = newCombo,
|
||||
};
|
||||
}
|
||||
|
||||
protected override HitObject CreateSlider(Vector2 position, bool newCombo, List<Vector2> controlPoints, double length, CurveType curveType, int repeatCount, List<List<SampleInfo>> repeatSamples)
|
||||
protected override HitObject CreateHit(Vector2 position, bool newCombo, int comboOffset)
|
||||
{
|
||||
return new ConvertHit();
|
||||
}
|
||||
|
||||
protected override HitObject CreateSlider(Vector2 position, bool newCombo, int comboOffset, List<Vector2> controlPoints, double length, CurveType curveType, int repeatCount, List<List<SampleInfo>> repeatSamples)
|
||||
{
|
||||
return new ConvertSlider
|
||||
{
|
||||
NewCombo = newCombo,
|
||||
ControlPoints = controlPoints,
|
||||
Distance = length,
|
||||
CurveType = curveType,
|
||||
@ -34,7 +35,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Taiko
|
||||
};
|
||||
}
|
||||
|
||||
protected override HitObject CreateSpinner(Vector2 position, double endTime)
|
||||
protected override HitObject CreateSpinner(Vector2 position, bool newCombo, int comboOffset, double endTime)
|
||||
{
|
||||
return new ConvertSpinner
|
||||
{
|
||||
@ -42,7 +43,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Taiko
|
||||
};
|
||||
}
|
||||
|
||||
protected override HitObject CreateHold(Vector2 position, bool newCombo, double endTime)
|
||||
protected override HitObject CreateHold(Vector2 position, bool newCombo, int comboOffset, double endTime)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
@ -1,17 +1,13 @@
|
||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Game.Rulesets.Objects.Types;
|
||||
|
||||
namespace osu.Game.Rulesets.Objects.Legacy.Taiko
|
||||
{
|
||||
/// <summary>
|
||||
/// Legacy osu!taiko Slider-type, used for parsing Beatmaps.
|
||||
/// </summary>
|
||||
internal sealed class ConvertSlider : Legacy.ConvertSlider, IHasCombo
|
||||
internal sealed class ConvertSlider : Legacy.ConvertSlider
|
||||
{
|
||||
public bool NewCombo { get; set; }
|
||||
|
||||
protected override HitWindows CreateHitWindows() => null;
|
||||
}
|
||||
}
|
||||
|
@ -12,5 +12,10 @@ namespace osu.Game.Rulesets.Objects.Types
|
||||
/// Whether the HitObject starts a new combo.
|
||||
/// </summary>
|
||||
bool NewCombo { get; }
|
||||
|
||||
/// <summary>
|
||||
/// When starting a new combo, the offset of the new combo relative to the current one.
|
||||
/// </summary>
|
||||
int ComboOffset { get; }
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user