mirror of
https://github.com/ppy/osu.git
synced 2024-12-05 10:33:22 +08:00
Merge pull request #28473 from bdach/beatmap-info-purge
Move unnecessary properties from `BeatmapInfo` / realm to `IBeatmap`
This commit is contained in:
commit
5b2558cec2
@ -55,7 +55,7 @@ namespace osu.Game.Rulesets.Mania.Edit.Setup
|
|||||||
{
|
{
|
||||||
Caption = "Use special (N+1) style",
|
Caption = "Use special (N+1) style",
|
||||||
HintText = "Changes one column to act as a classic \"scratch\" or \"special\" column, which can be moved around by the user's skin (to the left/right/centre). Generally used in 6K (5+1) or 8K (7+1) configurations.",
|
HintText = "Changes one column to act as a classic \"scratch\" or \"special\" column, which can be moved around by the user's skin (to the left/right/centre). Generally used in 6K (5+1) or 8K (7+1) configurations.",
|
||||||
Current = { Value = Beatmap.BeatmapInfo.SpecialStyle }
|
Current = { Value = Beatmap.SpecialStyle }
|
||||||
},
|
},
|
||||||
healthDrainSlider = new FormSliderBar<float>
|
healthDrainSlider = new FormSliderBar<float>
|
||||||
{
|
{
|
||||||
@ -157,7 +157,7 @@ namespace osu.Game.Rulesets.Mania.Edit.Setup
|
|||||||
// for now, update these on commit rather than making BeatmapMetadata bindables.
|
// for now, update these on commit rather than making BeatmapMetadata bindables.
|
||||||
// after switching database engines we can reconsider if switching to bindables is a good direction.
|
// after switching database engines we can reconsider if switching to bindables is a good direction.
|
||||||
Beatmap.Difficulty.CircleSize = keyCountSlider.Current.Value;
|
Beatmap.Difficulty.CircleSize = keyCountSlider.Current.Value;
|
||||||
Beatmap.BeatmapInfo.SpecialStyle = specialStyle.Current.Value;
|
Beatmap.SpecialStyle = specialStyle.Current.Value;
|
||||||
Beatmap.Difficulty.DrainRate = healthDrainSlider.Current.Value;
|
Beatmap.Difficulty.DrainRate = healthDrainSlider.Current.Value;
|
||||||
Beatmap.Difficulty.OverallDifficulty = overallDifficultySlider.Current.Value;
|
Beatmap.Difficulty.OverallDifficulty = overallDifficultySlider.Current.Value;
|
||||||
Beatmap.Difficulty.SliderMultiplier = baseVelocitySlider.Current.Value;
|
Beatmap.Difficulty.SliderMultiplier = baseVelocitySlider.Current.Value;
|
||||||
|
@ -191,7 +191,7 @@ namespace osu.Game.Rulesets.Osu.Tests.Editor
|
|||||||
|
|
||||||
private void gridSizeIs(int size)
|
private void gridSizeIs(int size)
|
||||||
=> AddAssert($"grid size is {size}", () => this.ChildrenOfType<RectangularPositionSnapGrid>().Single().Spacing.Value == new Vector2(size)
|
=> AddAssert($"grid size is {size}", () => this.ChildrenOfType<RectangularPositionSnapGrid>().Single().Spacing.Value == new Vector2(size)
|
||||||
&& EditorBeatmap.BeatmapInfo.GridSize == size);
|
&& EditorBeatmap.GridSize == size);
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestGridTypeToggling()
|
public void TestGridTypeToggling()
|
||||||
|
@ -83,10 +83,7 @@ namespace osu.Game.Rulesets.Osu.Tests.Mods
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
BeatmapInfo =
|
StackLeniency = 0,
|
||||||
{
|
|
||||||
StackLeniency = 0,
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
ReplayFrames = new List<ReplayFrame>
|
ReplayFrames = new List<ReplayFrame>
|
||||||
{
|
{
|
||||||
|
@ -74,12 +74,12 @@ namespace osu.Game.Rulesets.Osu.Tests.Mods
|
|||||||
{
|
{
|
||||||
BeatmapInfo = new BeatmapInfo
|
BeatmapInfo = new BeatmapInfo
|
||||||
{
|
{
|
||||||
StackLeniency = 0,
|
|
||||||
Difficulty = new BeatmapDifficulty
|
Difficulty = new BeatmapDifficulty
|
||||||
{
|
{
|
||||||
ApproachRate = 8.5f
|
ApproachRate = 8.5f
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
StackLeniency = 0,
|
||||||
ControlPointInfo = controlPointInfo
|
ControlPointInfo = controlPointInfo
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -465,7 +465,7 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
private void performTest(List<ReplayFrame> frames, Beatmap<OsuHitObject> beatmap)
|
private void performTest(List<ReplayFrame> frames, Beatmap<OsuHitObject> beatmap)
|
||||||
{
|
{
|
||||||
beatmap.BeatmapInfo.Ruleset = new OsuRuleset().RulesetInfo;
|
beatmap.BeatmapInfo.Ruleset = new OsuRuleset().RulesetInfo;
|
||||||
beatmap.BeatmapInfo.StackLeniency = 0;
|
beatmap.StackLeniency = 0;
|
||||||
beatmap.BeatmapInfo.Difficulty = new BeatmapDifficulty
|
beatmap.BeatmapInfo.Difficulty = new BeatmapDifficulty
|
||||||
{
|
{
|
||||||
SliderMultiplier = 4,
|
SliderMultiplier = 4,
|
||||||
|
@ -56,13 +56,13 @@ namespace osu.Game.Rulesets.Osu.Beatmaps
|
|||||||
h.StackHeight = 0;
|
h.StackHeight = 0;
|
||||||
|
|
||||||
if (beatmap.BeatmapInfo.BeatmapVersion >= 6)
|
if (beatmap.BeatmapInfo.BeatmapVersion >= 6)
|
||||||
applyStacking(beatmap.BeatmapInfo, hitObjects, 0, hitObjects.Count - 1);
|
applyStacking(beatmap, hitObjects, 0, hitObjects.Count - 1);
|
||||||
else
|
else
|
||||||
applyStackingOld(beatmap.BeatmapInfo, hitObjects);
|
applyStackingOld(beatmap, hitObjects);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void applyStacking(BeatmapInfo beatmapInfo, List<OsuHitObject> hitObjects, int startIndex, int endIndex)
|
private static void applyStacking(IBeatmap beatmap, List<OsuHitObject> hitObjects, int startIndex, int endIndex)
|
||||||
{
|
{
|
||||||
ArgumentOutOfRangeException.ThrowIfGreaterThan(startIndex, endIndex);
|
ArgumentOutOfRangeException.ThrowIfGreaterThan(startIndex, endIndex);
|
||||||
ArgumentOutOfRangeException.ThrowIfNegative(startIndex);
|
ArgumentOutOfRangeException.ThrowIfNegative(startIndex);
|
||||||
@ -87,7 +87,7 @@ namespace osu.Game.Rulesets.Osu.Beatmaps
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
double endTime = stackBaseObject.GetEndTime();
|
double endTime = stackBaseObject.GetEndTime();
|
||||||
double stackThreshold = objectN.TimePreempt * beatmapInfo.StackLeniency;
|
double stackThreshold = objectN.TimePreempt * beatmap.StackLeniency;
|
||||||
|
|
||||||
if (objectN.StartTime - endTime > stackThreshold)
|
if (objectN.StartTime - endTime > stackThreshold)
|
||||||
// We are no longer within stacking range of the next object.
|
// We are no longer within stacking range of the next object.
|
||||||
@ -132,7 +132,7 @@ namespace osu.Game.Rulesets.Osu.Beatmaps
|
|||||||
OsuHitObject objectI = hitObjects[i];
|
OsuHitObject objectI = hitObjects[i];
|
||||||
if (objectI.StackHeight != 0 || objectI is Spinner) continue;
|
if (objectI.StackHeight != 0 || objectI is Spinner) continue;
|
||||||
|
|
||||||
double stackThreshold = objectI.TimePreempt * beatmapInfo.StackLeniency;
|
double stackThreshold = objectI.TimePreempt * beatmap.StackLeniency;
|
||||||
|
|
||||||
/* If this object is a hitcircle, then we enter this "special" case.
|
/* If this object is a hitcircle, then we enter this "special" case.
|
||||||
* It either ends with a stack of hitcircles only, or a stack of hitcircles that are underneath a slider.
|
* It either ends with a stack of hitcircles only, or a stack of hitcircles that are underneath a slider.
|
||||||
@ -214,7 +214,7 @@ namespace osu.Game.Rulesets.Osu.Beatmaps
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void applyStackingOld(BeatmapInfo beatmapInfo, List<OsuHitObject> hitObjects)
|
private static void applyStackingOld(IBeatmap beatmap, List<OsuHitObject> hitObjects)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < hitObjects.Count; i++)
|
for (int i = 0; i < hitObjects.Count; i++)
|
||||||
{
|
{
|
||||||
@ -228,7 +228,7 @@ namespace osu.Game.Rulesets.Osu.Beatmaps
|
|||||||
|
|
||||||
for (int j = i + 1; j < hitObjects.Count; j++)
|
for (int j = i + 1; j < hitObjects.Count; j++)
|
||||||
{
|
{
|
||||||
double stackThreshold = hitObjects[i].TimePreempt * beatmapInfo.StackLeniency;
|
double stackThreshold = hitObjects[i].TimePreempt * beatmap.StackLeniency;
|
||||||
|
|
||||||
if (hitObjects[j].StartTime - stackThreshold > startTime)
|
if (hitObjects[j].StartTime - stackThreshold > startTime)
|
||||||
break;
|
break;
|
||||||
|
@ -170,7 +170,7 @@ namespace osu.Game.Rulesets.Osu.Edit
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
Spacing.Value = editorBeatmap.BeatmapInfo.GridSize;
|
Spacing.Value = editorBeatmap.GridSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
@ -204,7 +204,7 @@ namespace osu.Game.Rulesets.Osu.Edit
|
|||||||
spacingSlider.ContractedLabelText = $"S: {spacing.NewValue:#,0.##}";
|
spacingSlider.ContractedLabelText = $"S: {spacing.NewValue:#,0.##}";
|
||||||
spacingSlider.ExpandedLabelText = $"Spacing: {spacing.NewValue:#,0.##}";
|
spacingSlider.ExpandedLabelText = $"Spacing: {spacing.NewValue:#,0.##}";
|
||||||
SpacingVector.Value = new Vector2(spacing.NewValue);
|
SpacingVector.Value = new Vector2(spacing.NewValue);
|
||||||
editorBeatmap.BeatmapInfo.GridSize = (int)spacing.NewValue;
|
editorBeatmap.GridSize = (int)spacing.NewValue;
|
||||||
}, true);
|
}, true);
|
||||||
|
|
||||||
GridLinesRotation.BindValueChanged(rotation =>
|
GridLinesRotation.BindValueChanged(rotation =>
|
||||||
|
@ -119,7 +119,7 @@ namespace osu.Game.Rulesets.Osu.Edit.Setup
|
|||||||
{
|
{
|
||||||
Caption = "Stack Leniency",
|
Caption = "Stack Leniency",
|
||||||
HintText = "In play mode, osu! automatically stacks notes which occur at the same location. Increasing this value means it is more likely to snap notes of further time-distance.",
|
HintText = "In play mode, osu! automatically stacks notes which occur at the same location. Increasing this value means it is more likely to snap notes of further time-distance.",
|
||||||
Current = new BindableFloat(Beatmap.BeatmapInfo.StackLeniency)
|
Current = new BindableFloat(Beatmap.StackLeniency)
|
||||||
{
|
{
|
||||||
Default = 0.7f,
|
Default = 0.7f,
|
||||||
MinValue = 0,
|
MinValue = 0,
|
||||||
@ -148,7 +148,7 @@ namespace osu.Game.Rulesets.Osu.Edit.Setup
|
|||||||
Beatmap.Difficulty.OverallDifficulty = overallDifficultySlider.Current.Value;
|
Beatmap.Difficulty.OverallDifficulty = overallDifficultySlider.Current.Value;
|
||||||
Beatmap.Difficulty.SliderMultiplier = baseVelocitySlider.Current.Value;
|
Beatmap.Difficulty.SliderMultiplier = baseVelocitySlider.Current.Value;
|
||||||
Beatmap.Difficulty.SliderTickRate = tickRateSlider.Current.Value;
|
Beatmap.Difficulty.SliderTickRate = tickRateSlider.Current.Value;
|
||||||
Beatmap.BeatmapInfo.StackLeniency = stackLeniency.Current.Value;
|
Beatmap.StackLeniency = stackLeniency.Current.Value;
|
||||||
|
|
||||||
Beatmap.UpdateAllHitObjects();
|
Beatmap.UpdateAllHitObjects();
|
||||||
Beatmap.SaveState();
|
Beatmap.SaveState();
|
||||||
|
@ -80,16 +80,16 @@ namespace osu.Game.Tests.Beatmaps.Formats
|
|||||||
var metadata = beatmap.Metadata;
|
var metadata = beatmap.Metadata;
|
||||||
|
|
||||||
Assert.AreEqual("03. Renatus - Soleily 192kbps.mp3", metadata.AudioFile);
|
Assert.AreEqual("03. Renatus - Soleily 192kbps.mp3", metadata.AudioFile);
|
||||||
Assert.AreEqual(0, beatmapInfo.AudioLeadIn);
|
Assert.AreEqual(0, beatmap.AudioLeadIn);
|
||||||
Assert.AreEqual(164471, metadata.PreviewTime);
|
Assert.AreEqual(164471, metadata.PreviewTime);
|
||||||
Assert.AreEqual(0.7f, beatmapInfo.StackLeniency);
|
Assert.AreEqual(0.7f, beatmap.StackLeniency);
|
||||||
Assert.IsTrue(beatmapInfo.Ruleset.OnlineID == 0);
|
Assert.IsTrue(beatmapInfo.Ruleset.OnlineID == 0);
|
||||||
Assert.IsFalse(beatmapInfo.LetterboxInBreaks);
|
Assert.IsFalse(beatmap.LetterboxInBreaks);
|
||||||
Assert.IsFalse(beatmapInfo.SpecialStyle);
|
Assert.IsFalse(beatmap.SpecialStyle);
|
||||||
Assert.IsFalse(beatmapInfo.WidescreenStoryboard);
|
Assert.IsFalse(beatmap.WidescreenStoryboard);
|
||||||
Assert.IsFalse(beatmapInfo.SamplesMatchPlaybackRate);
|
Assert.IsFalse(beatmap.SamplesMatchPlaybackRate);
|
||||||
Assert.AreEqual(CountdownType.None, beatmapInfo.Countdown);
|
Assert.AreEqual(CountdownType.None, beatmap.Countdown);
|
||||||
Assert.AreEqual(0, beatmapInfo.CountdownOffset);
|
Assert.AreEqual(0, beatmap.CountdownOffset);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -101,7 +101,7 @@ namespace osu.Game.Tests.Beatmaps.Formats
|
|||||||
using (var resStream = TestResources.OpenResource("Soleily - Renatus (Gamu) [Insane].osu"))
|
using (var resStream = TestResources.OpenResource("Soleily - Renatus (Gamu) [Insane].osu"))
|
||||||
using (var stream = new LineBufferedReader(resStream))
|
using (var stream = new LineBufferedReader(resStream))
|
||||||
{
|
{
|
||||||
var beatmapInfo = decoder.Decode(stream).BeatmapInfo;
|
var beatmap = decoder.Decode(stream);
|
||||||
|
|
||||||
int[] expectedBookmarks =
|
int[] expectedBookmarks =
|
||||||
{
|
{
|
||||||
@ -109,13 +109,13 @@ namespace osu.Game.Tests.Beatmaps.Formats
|
|||||||
95901, 106450, 116999, 119637, 130186, 140735, 151285,
|
95901, 106450, 116999, 119637, 130186, 140735, 151285,
|
||||||
161834, 164471, 175020, 185570, 196119, 206669, 209306
|
161834, 164471, 175020, 185570, 196119, 206669, 209306
|
||||||
};
|
};
|
||||||
Assert.AreEqual(expectedBookmarks.Length, beatmapInfo.Bookmarks.Length);
|
Assert.AreEqual(expectedBookmarks.Length, beatmap.BeatmapInfo.Bookmarks.Length);
|
||||||
for (int i = 0; i < expectedBookmarks.Length; i++)
|
for (int i = 0; i < expectedBookmarks.Length; i++)
|
||||||
Assert.AreEqual(expectedBookmarks[i], beatmapInfo.Bookmarks[i]);
|
Assert.AreEqual(expectedBookmarks[i], beatmap.BeatmapInfo.Bookmarks[i]);
|
||||||
Assert.AreEqual(1.8, beatmapInfo.DistanceSpacing);
|
Assert.AreEqual(1.8, beatmap.DistanceSpacing);
|
||||||
Assert.AreEqual(4, beatmapInfo.BeatDivisor);
|
Assert.AreEqual(4, beatmap.BeatmapInfo.BeatDivisor);
|
||||||
Assert.AreEqual(4, beatmapInfo.GridSize);
|
Assert.AreEqual(4, beatmap.GridSize);
|
||||||
Assert.AreEqual(2, beatmapInfo.TimelineZoom);
|
Assert.AreEqual(2, beatmap.TimelineZoom);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -993,15 +993,15 @@ namespace osu.Game.Tests.Beatmaps.Formats
|
|||||||
|
|
||||||
Assert.Multiple(() =>
|
Assert.Multiple(() =>
|
||||||
{
|
{
|
||||||
Assert.That(decoded.BeatmapInfo.AudioLeadIn, Is.EqualTo(0));
|
Assert.That(decoded.AudioLeadIn, Is.EqualTo(0));
|
||||||
Assert.That(decoded.BeatmapInfo.StackLeniency, Is.EqualTo(0.7f));
|
Assert.That(decoded.StackLeniency, Is.EqualTo(0.7f));
|
||||||
Assert.That(decoded.BeatmapInfo.SpecialStyle, Is.False);
|
Assert.That(decoded.SpecialStyle, Is.False);
|
||||||
Assert.That(decoded.BeatmapInfo.LetterboxInBreaks, Is.False);
|
Assert.That(decoded.LetterboxInBreaks, Is.False);
|
||||||
Assert.That(decoded.BeatmapInfo.WidescreenStoryboard, Is.False);
|
Assert.That(decoded.WidescreenStoryboard, Is.False);
|
||||||
Assert.That(decoded.BeatmapInfo.EpilepsyWarning, Is.False);
|
Assert.That(decoded.EpilepsyWarning, Is.False);
|
||||||
Assert.That(decoded.BeatmapInfo.SamplesMatchPlaybackRate, Is.False);
|
Assert.That(decoded.SamplesMatchPlaybackRate, Is.False);
|
||||||
Assert.That(decoded.BeatmapInfo.Countdown, Is.EqualTo(CountdownType.None));
|
Assert.That(decoded.Countdown, Is.EqualTo(CountdownType.None));
|
||||||
Assert.That(decoded.BeatmapInfo.CountdownOffset, Is.EqualTo(0));
|
Assert.That(decoded.CountdownOffset, Is.EqualTo(0));
|
||||||
Assert.That(decoded.BeatmapInfo.Metadata.PreviewTime, Is.EqualTo(-1));
|
Assert.That(decoded.BeatmapInfo.Metadata.PreviewTime, Is.EqualTo(-1));
|
||||||
Assert.That(decoded.BeatmapInfo.Ruleset.OnlineID, Is.EqualTo(0));
|
Assert.That(decoded.BeatmapInfo.Ruleset.OnlineID, Is.EqualTo(0));
|
||||||
});
|
});
|
||||||
|
@ -51,14 +51,14 @@ namespace osu.Game.Tests.Beatmaps.Formats
|
|||||||
{
|
{
|
||||||
var beatmap = decodeAsJson(normal);
|
var beatmap = decodeAsJson(normal);
|
||||||
var beatmapInfo = beatmap.BeatmapInfo;
|
var beatmapInfo = beatmap.BeatmapInfo;
|
||||||
Assert.AreEqual(0, beatmapInfo.AudioLeadIn);
|
Assert.AreEqual(0, beatmap.AudioLeadIn);
|
||||||
Assert.AreEqual(0.7f, beatmapInfo.StackLeniency);
|
Assert.AreEqual(0.7f, beatmap.StackLeniency);
|
||||||
Assert.AreEqual(false, beatmapInfo.SpecialStyle);
|
Assert.AreEqual(false, beatmap.SpecialStyle);
|
||||||
Assert.IsTrue(beatmapInfo.Ruleset.OnlineID == 0);
|
Assert.IsTrue(beatmapInfo.Ruleset.OnlineID == 0);
|
||||||
Assert.AreEqual(false, beatmapInfo.LetterboxInBreaks);
|
Assert.AreEqual(false, beatmap.LetterboxInBreaks);
|
||||||
Assert.AreEqual(false, beatmapInfo.WidescreenStoryboard);
|
Assert.AreEqual(false, beatmap.WidescreenStoryboard);
|
||||||
Assert.AreEqual(CountdownType.None, beatmapInfo.Countdown);
|
Assert.AreEqual(CountdownType.None, beatmap.Countdown);
|
||||||
Assert.AreEqual(0, beatmapInfo.CountdownOffset);
|
Assert.AreEqual(0, beatmap.CountdownOffset);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@ -76,10 +76,10 @@ namespace osu.Game.Tests.Beatmaps.Formats
|
|||||||
Assert.AreEqual(expectedBookmarks.Length, beatmapInfo.Bookmarks.Length);
|
Assert.AreEqual(expectedBookmarks.Length, beatmapInfo.Bookmarks.Length);
|
||||||
for (int i = 0; i < expectedBookmarks.Length; i++)
|
for (int i = 0; i < expectedBookmarks.Length; i++)
|
||||||
Assert.AreEqual(expectedBookmarks[i], beatmapInfo.Bookmarks[i]);
|
Assert.AreEqual(expectedBookmarks[i], beatmapInfo.Bookmarks[i]);
|
||||||
Assert.AreEqual(1.8, beatmapInfo.DistanceSpacing);
|
Assert.AreEqual(1.8, beatmap.DistanceSpacing);
|
||||||
Assert.AreEqual(4, beatmapInfo.BeatDivisor);
|
Assert.AreEqual(4, beatmapInfo.BeatDivisor);
|
||||||
Assert.AreEqual(4, beatmapInfo.GridSize);
|
Assert.AreEqual(4, beatmap.GridSize);
|
||||||
Assert.AreEqual(2, beatmapInfo.TimelineZoom);
|
Assert.AreEqual(2, beatmap.TimelineZoom);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
@ -41,7 +41,7 @@ namespace osu.Game.Tests.Database
|
|||||||
Assert.That(lastChanges?.ModifiedIndices, Is.Empty);
|
Assert.That(lastChanges?.ModifiedIndices, Is.Empty);
|
||||||
Assert.That(lastChanges?.NewModifiedIndices, Is.Empty);
|
Assert.That(lastChanges?.NewModifiedIndices, Is.Empty);
|
||||||
|
|
||||||
realm.Write(r => r.All<BeatmapSetInfo>().First().Beatmaps.First().CountdownOffset = 5);
|
realm.Write(r => r.All<BeatmapSetInfo>().First().Beatmaps.First().EditorTimestamp = 5);
|
||||||
realm.Run(r => r.Refresh());
|
realm.Run(r => r.Refresh());
|
||||||
|
|
||||||
Assert.That(collectionChanges, Is.EqualTo(1));
|
Assert.That(collectionChanges, Is.EqualTo(1));
|
||||||
|
@ -56,7 +56,7 @@ namespace osu.Game.Tests.Visual.Editing
|
|||||||
{
|
{
|
||||||
AddStep("turn countdown off", () => designSection.EnableCountdown.Current.Value = false);
|
AddStep("turn countdown off", () => designSection.EnableCountdown.Current.Value = false);
|
||||||
|
|
||||||
AddAssert("beatmap has correct type", () => editorBeatmap.BeatmapInfo.Countdown == CountdownType.None);
|
AddAssert("beatmap has correct type", () => editorBeatmap.Countdown == CountdownType.None);
|
||||||
AddUntilStep("other controls hidden", () => !designSection.CountdownSettings.IsPresent);
|
AddUntilStep("other controls hidden", () => !designSection.CountdownSettings.IsPresent);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -65,12 +65,12 @@ namespace osu.Game.Tests.Visual.Editing
|
|||||||
{
|
{
|
||||||
AddStep("turn countdown on", () => designSection.EnableCountdown.Current.Value = true);
|
AddStep("turn countdown on", () => designSection.EnableCountdown.Current.Value = true);
|
||||||
|
|
||||||
AddAssert("beatmap has correct type", () => editorBeatmap.BeatmapInfo.Countdown == CountdownType.Normal);
|
AddAssert("beatmap has correct type", () => editorBeatmap.Countdown == CountdownType.Normal);
|
||||||
AddUntilStep("other controls shown", () => designSection.CountdownSettings.IsPresent);
|
AddUntilStep("other controls shown", () => designSection.CountdownSettings.IsPresent);
|
||||||
|
|
||||||
AddStep("change countdown speed", () => designSection.CountdownSpeed.Current.Value = CountdownType.DoubleSpeed);
|
AddStep("change countdown speed", () => designSection.CountdownSpeed.Current.Value = CountdownType.DoubleSpeed);
|
||||||
|
|
||||||
AddAssert("beatmap has correct type", () => editorBeatmap.BeatmapInfo.Countdown == CountdownType.DoubleSpeed);
|
AddAssert("beatmap has correct type", () => editorBeatmap.Countdown == CountdownType.DoubleSpeed);
|
||||||
AddUntilStep("other controls still shown", () => designSection.CountdownSettings.IsPresent);
|
AddUntilStep("other controls still shown", () => designSection.CountdownSettings.IsPresent);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -79,7 +79,7 @@ namespace osu.Game.Tests.Visual.Editing
|
|||||||
{
|
{
|
||||||
AddStep("turn countdown on", () => designSection.EnableCountdown.Current.Value = true);
|
AddStep("turn countdown on", () => designSection.EnableCountdown.Current.Value = true);
|
||||||
|
|
||||||
AddAssert("beatmap has correct type", () => editorBeatmap.BeatmapInfo.Countdown == CountdownType.Normal);
|
AddAssert("beatmap has correct type", () => editorBeatmap.Countdown == CountdownType.Normal);
|
||||||
|
|
||||||
checkOffsetAfter("1", 1);
|
checkOffsetAfter("1", 1);
|
||||||
checkOffsetAfter(string.Empty, 0);
|
checkOffsetAfter(string.Empty, 0);
|
||||||
@ -99,7 +99,7 @@ namespace osu.Game.Tests.Visual.Editing
|
|||||||
AddStep("commit text", () => InputManager.Key(Key.Enter));
|
AddStep("commit text", () => InputManager.Key(Key.Enter));
|
||||||
|
|
||||||
AddAssert($"displayed value is {expectedFinalValue}", () => designSection.CountdownOffset.Current.Value == expectedFinalValue.ToString(CultureInfo.InvariantCulture));
|
AddAssert($"displayed value is {expectedFinalValue}", () => designSection.CountdownOffset.Current.Value == expectedFinalValue.ToString(CultureInfo.InvariantCulture));
|
||||||
AddAssert($"beatmap value is {expectedFinalValue}", () => editorBeatmap.BeatmapInfo.CountdownOffset == expectedFinalValue);
|
AddAssert($"beatmap value is {expectedFinalValue}", () => editorBeatmap.CountdownOffset == expectedFinalValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
private partial class TestDesignSection : DesignSection
|
private partial class TestDesignSection : DesignSection
|
||||||
|
@ -70,7 +70,7 @@ namespace osu.Game.Tests.Visual.Editing
|
|||||||
AddStep("Set beat divisor", () => Editor.Dependencies.Get<BindableBeatDivisor>().Value = 16);
|
AddStep("Set beat divisor", () => Editor.Dependencies.Get<BindableBeatDivisor>().Value = 16);
|
||||||
AddStep("Set timeline zoom", () =>
|
AddStep("Set timeline zoom", () =>
|
||||||
{
|
{
|
||||||
originalTimelineZoom = EditorBeatmap.BeatmapInfo.TimelineZoom;
|
originalTimelineZoom = EditorBeatmap.TimelineZoom;
|
||||||
|
|
||||||
var timeline = Editor.ChildrenOfType<Timeline>().Single();
|
var timeline = Editor.ChildrenOfType<Timeline>().Single();
|
||||||
InputManager.MoveMouseTo(timeline);
|
InputManager.MoveMouseTo(timeline);
|
||||||
@ -81,19 +81,19 @@ namespace osu.Game.Tests.Visual.Editing
|
|||||||
|
|
||||||
AddAssert("Ensure timeline zoom changed", () =>
|
AddAssert("Ensure timeline zoom changed", () =>
|
||||||
{
|
{
|
||||||
changedTimelineZoom = EditorBeatmap.BeatmapInfo.TimelineZoom;
|
changedTimelineZoom = EditorBeatmap.TimelineZoom;
|
||||||
return !Precision.AlmostEquals(changedTimelineZoom, originalTimelineZoom);
|
return !Precision.AlmostEquals(changedTimelineZoom, originalTimelineZoom);
|
||||||
});
|
});
|
||||||
|
|
||||||
SaveEditor();
|
SaveEditor();
|
||||||
|
|
||||||
AddAssert("Beatmap has correct beat divisor", () => EditorBeatmap.BeatmapInfo.BeatDivisor == 16);
|
AddAssert("Beatmap has correct beat divisor", () => EditorBeatmap.BeatmapInfo.BeatDivisor == 16);
|
||||||
AddAssert("Beatmap has correct timeline zoom", () => EditorBeatmap.BeatmapInfo.TimelineZoom == changedTimelineZoom);
|
AddAssert("Beatmap has correct timeline zoom", () => EditorBeatmap.TimelineZoom == changedTimelineZoom);
|
||||||
|
|
||||||
ReloadEditorToSameBeatmap();
|
ReloadEditorToSameBeatmap();
|
||||||
|
|
||||||
AddAssert("Beatmap still has correct beat divisor", () => EditorBeatmap.BeatmapInfo.BeatDivisor == 16);
|
AddAssert("Beatmap still has correct beat divisor", () => EditorBeatmap.BeatmapInfo.BeatDivisor == 16);
|
||||||
AddAssert("Beatmap still has correct timeline zoom", () => EditorBeatmap.BeatmapInfo.TimelineZoom == changedTimelineZoom);
|
AddAssert("Beatmap still has correct timeline zoom", () => EditorBeatmap.TimelineZoom == changedTimelineZoom);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
@ -205,7 +205,7 @@ namespace osu.Game.Tests.Visual.Editing
|
|||||||
{
|
{
|
||||||
double originalSpacing = 0;
|
double originalSpacing = 0;
|
||||||
|
|
||||||
AddStep("retrieve original spacing", () => originalSpacing = editorBeatmap.BeatmapInfo.DistanceSpacing);
|
AddStep("retrieve original spacing", () => originalSpacing = editorBeatmap.DistanceSpacing);
|
||||||
|
|
||||||
AddStep("hold ctrl", () => InputManager.PressKey(Key.LControl));
|
AddStep("hold ctrl", () => InputManager.PressKey(Key.LControl));
|
||||||
AddStep("hold alt", () => InputManager.PressKey(Key.LAlt));
|
AddStep("hold alt", () => InputManager.PressKey(Key.LAlt));
|
||||||
@ -215,7 +215,7 @@ namespace osu.Game.Tests.Visual.Editing
|
|||||||
AddStep("release alt", () => InputManager.ReleaseKey(Key.LAlt));
|
AddStep("release alt", () => InputManager.ReleaseKey(Key.LAlt));
|
||||||
AddStep("release ctrl", () => InputManager.ReleaseKey(Key.LControl));
|
AddStep("release ctrl", () => InputManager.ReleaseKey(Key.LControl));
|
||||||
|
|
||||||
AddAssert("distance spacing increased by 0.5", () => editorBeatmap.BeatmapInfo.DistanceSpacing == originalSpacing + 0.5);
|
AddAssert("distance spacing increased by 0.5", () => editorBeatmap.DistanceSpacing == originalSpacing + 0.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
public partial class EditorBeatmapContainer : PopoverContainer
|
public partial class EditorBeatmapContainer : PopoverContainer
|
||||||
|
@ -32,7 +32,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
{
|
{
|
||||||
loadPlayerWithBeatmap(new TestBeatmap(new OsuRuleset().RulesetInfo)
|
loadPlayerWithBeatmap(new TestBeatmap(new OsuRuleset().RulesetInfo)
|
||||||
{
|
{
|
||||||
BeatmapInfo = { AudioLeadIn = leadIn }
|
AudioLeadIn = leadIn
|
||||||
});
|
});
|
||||||
|
|
||||||
checkFirstFrameTime(expectedStartTime);
|
checkFirstFrameTime(expectedStartTime);
|
||||||
@ -133,7 +133,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
{
|
{
|
||||||
Text = $"GameplayStartTime: {DrawableRuleset.GameplayStartTime} "
|
Text = $"GameplayStartTime: {DrawableRuleset.GameplayStartTime} "
|
||||||
+ $"FirstHitObjectTime: {FirstHitObjectTime} "
|
+ $"FirstHitObjectTime: {FirstHitObjectTime} "
|
||||||
+ $"LeadInTime: {Beatmap.Value.BeatmapInfo.AudioLeadIn} "
|
+ $"LeadInTime: {Beatmap.Value.Beatmap.AudioLeadIn} "
|
||||||
+ $"FirstFrameClockTime: {FirstFrameClockTime}"
|
+ $"FirstFrameClockTime: {FirstFrameClockTime}"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -136,10 +136,10 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
var workingBeatmap = CreateWorkingBeatmap(new OsuRuleset().RulesetInfo);
|
var workingBeatmap = CreateWorkingBeatmap(new OsuRuleset().RulesetInfo);
|
||||||
|
|
||||||
// Add intro time to test quick retry skipping (TestQuickRetry).
|
// Add intro time to test quick retry skipping (TestQuickRetry).
|
||||||
workingBeatmap.BeatmapInfo.AudioLeadIn = 60000;
|
workingBeatmap.Beatmap.AudioLeadIn = 60000;
|
||||||
|
|
||||||
// Set up data for testing disclaimer display.
|
// Set up data for testing disclaimer display.
|
||||||
workingBeatmap.BeatmapInfo.EpilepsyWarning = epilepsyWarning ?? false;
|
workingBeatmap.Beatmap.EpilepsyWarning = epilepsyWarning ?? false;
|
||||||
workingBeatmap.BeatmapInfo.Status = onlineStatus ?? BeatmapOnlineStatus.Ranked;
|
workingBeatmap.BeatmapInfo.Status = onlineStatus ?? BeatmapOnlineStatus.Ranked;
|
||||||
|
|
||||||
Beatmap.Value = workingBeatmap;
|
Beatmap.Value = workingBeatmap;
|
||||||
|
@ -63,7 +63,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
{
|
{
|
||||||
loadPlayerWithBeatmap(new TestBeatmap(new OsuRuleset().RulesetInfo)
|
loadPlayerWithBeatmap(new TestBeatmap(new OsuRuleset().RulesetInfo)
|
||||||
{
|
{
|
||||||
BeatmapInfo = { AudioLeadIn = 60000 }
|
AudioLeadIn = 60000
|
||||||
});
|
});
|
||||||
|
|
||||||
AddUntilStep("wait for skip overlay", () => Player.ChildrenOfType<SkipOverlay>().First().IsButtonVisible);
|
AddUntilStep("wait for skip overlay", () => Player.ChildrenOfType<SkipOverlay>().First().IsButtonVisible);
|
||||||
|
@ -53,7 +53,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
AddStep("load storyboard with only video", () =>
|
AddStep("load storyboard with only video", () =>
|
||||||
{
|
{
|
||||||
// LegacyStoryboardDecoder doesn't parse WidescreenStoryboard, so it is set manually
|
// LegacyStoryboardDecoder doesn't parse WidescreenStoryboard, so it is set manually
|
||||||
loadStoryboard("storyboard_only_video.osu", s => s.BeatmapInfo.WidescreenStoryboard = false);
|
loadStoryboard("storyboard_only_video.osu", s => s.Beatmap.WidescreenStoryboard = false);
|
||||||
});
|
});
|
||||||
|
|
||||||
AddAssert("storyboard is correct width", () => Precision.AlmostEquals(storyboard?.Width ?? 0f, 480 * 16 / 9f));
|
AddAssert("storyboard is correct width", () => Precision.AlmostEquals(storyboard?.Width ?? 0f, 480 * 16 / 9f));
|
||||||
|
@ -406,13 +406,13 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Tests spectating with a beatmap that has a high <see cref="BeatmapInfo.AudioLeadIn"/> value.
|
/// Tests spectating with a beatmap that has a high <see cref="IBeatmap.AudioLeadIn"/> value.
|
||||||
///
|
///
|
||||||
/// This test is not intended not to check the correct initial time value, but only to guard against
|
/// This test is not intended not to check the correct initial time value, but only to guard against
|
||||||
/// gameplay potentially getting stuck in a stopped state due to lead in time being present.
|
/// gameplay potentially getting stuck in a stopped state due to lead in time being present.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Test]
|
[Test]
|
||||||
public void TestAudioLeadIn() => testLeadIn(b => b.BeatmapInfo.AudioLeadIn = 2000);
|
public void TestAudioLeadIn() => testLeadIn(b => b.Beatmap.AudioLeadIn = 2000);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Tests spectating with a beatmap that has a storyboard element with a negative start time (i.e. intro storyboard element).
|
/// Tests spectating with a beatmap that has a storyboard element with a negative start time (i.e. intro storyboard element).
|
||||||
|
@ -115,6 +115,30 @@ namespace osu.Game.Beatmaps
|
|||||||
return mostCommon.beatLength;
|
return mostCommon.beatLength;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public double AudioLeadIn { get; set; }
|
||||||
|
|
||||||
|
public float StackLeniency { get; set; } = 0.7f;
|
||||||
|
|
||||||
|
public bool SpecialStyle { get; set; }
|
||||||
|
|
||||||
|
public bool LetterboxInBreaks { get; set; }
|
||||||
|
|
||||||
|
public bool WidescreenStoryboard { get; set; } = true;
|
||||||
|
|
||||||
|
public bool EpilepsyWarning { get; set; }
|
||||||
|
|
||||||
|
public bool SamplesMatchPlaybackRate { get; set; }
|
||||||
|
|
||||||
|
public double DistanceSpacing { get; set; } = 1.0;
|
||||||
|
|
||||||
|
public int GridSize { get; set; }
|
||||||
|
|
||||||
|
public double TimelineZoom { get; set; } = 1.0;
|
||||||
|
|
||||||
|
public CountdownType Countdown { get; set; } = CountdownType.None;
|
||||||
|
|
||||||
|
public int CountdownOffset { get; set; }
|
||||||
|
|
||||||
IBeatmap IBeatmap.Clone() => Clone();
|
IBeatmap IBeatmap.Clone() => Clone();
|
||||||
|
|
||||||
public Beatmap<T> Clone() => (Beatmap<T>)MemberwiseClone();
|
public Beatmap<T> Clone() => (Beatmap<T>)MemberwiseClone();
|
||||||
|
@ -73,6 +73,18 @@ namespace osu.Game.Beatmaps
|
|||||||
beatmap.HitObjects = convertHitObjects(original.HitObjects, original, cancellationToken).OrderBy(s => s.StartTime).ToList();
|
beatmap.HitObjects = convertHitObjects(original.HitObjects, original, cancellationToken).OrderBy(s => s.StartTime).ToList();
|
||||||
beatmap.Breaks = original.Breaks;
|
beatmap.Breaks = original.Breaks;
|
||||||
beatmap.UnhandledEventLines = original.UnhandledEventLines;
|
beatmap.UnhandledEventLines = original.UnhandledEventLines;
|
||||||
|
beatmap.AudioLeadIn = original.AudioLeadIn;
|
||||||
|
beatmap.StackLeniency = original.StackLeniency;
|
||||||
|
beatmap.SpecialStyle = original.SpecialStyle;
|
||||||
|
beatmap.LetterboxInBreaks = original.LetterboxInBreaks;
|
||||||
|
beatmap.WidescreenStoryboard = original.WidescreenStoryboard;
|
||||||
|
beatmap.EpilepsyWarning = original.EpilepsyWarning;
|
||||||
|
beatmap.SamplesMatchPlaybackRate = original.SamplesMatchPlaybackRate;
|
||||||
|
beatmap.DistanceSpacing = original.DistanceSpacing;
|
||||||
|
beatmap.GridSize = original.GridSize;
|
||||||
|
beatmap.TimelineZoom = original.TimelineZoom;
|
||||||
|
beatmap.Countdown = original.Countdown;
|
||||||
|
beatmap.CountdownOffset = original.CountdownOffset;
|
||||||
|
|
||||||
return beatmap;
|
return beatmap;
|
||||||
}
|
}
|
||||||
|
@ -428,17 +428,7 @@ namespace osu.Game.Beatmaps
|
|||||||
Hash = hash,
|
Hash = hash,
|
||||||
DifficultyName = decodedInfo.DifficultyName,
|
DifficultyName = decodedInfo.DifficultyName,
|
||||||
OnlineID = decodedInfo.OnlineID,
|
OnlineID = decodedInfo.OnlineID,
|
||||||
AudioLeadIn = decodedInfo.AudioLeadIn,
|
|
||||||
StackLeniency = decodedInfo.StackLeniency,
|
|
||||||
SpecialStyle = decodedInfo.SpecialStyle,
|
|
||||||
LetterboxInBreaks = decodedInfo.LetterboxInBreaks,
|
|
||||||
WidescreenStoryboard = decodedInfo.WidescreenStoryboard,
|
|
||||||
EpilepsyWarning = decodedInfo.EpilepsyWarning,
|
|
||||||
SamplesMatchPlaybackRate = decodedInfo.SamplesMatchPlaybackRate,
|
|
||||||
DistanceSpacing = decodedInfo.DistanceSpacing,
|
|
||||||
BeatDivisor = decodedInfo.BeatDivisor,
|
BeatDivisor = decodedInfo.BeatDivisor,
|
||||||
GridSize = decodedInfo.GridSize,
|
|
||||||
TimelineZoom = decodedInfo.TimelineZoom,
|
|
||||||
MD5Hash = memoryStream.ComputeMD5Hash(),
|
MD5Hash = memoryStream.ComputeMD5Hash(),
|
||||||
EndTimeObjectCount = decoded.HitObjects.Count(h => h is IHasDuration),
|
EndTimeObjectCount = decoded.HitObjects.Count(h => h is IHasDuration),
|
||||||
TotalObjectCount = decoded.HitObjects.Count
|
TotalObjectCount = decoded.HitObjects.Count
|
||||||
|
@ -6,14 +6,12 @@ using System.Diagnostics;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using osu.Game.Beatmaps.ControlPoints;
|
|
||||||
using osu.Game.Collections;
|
using osu.Game.Collections;
|
||||||
using osu.Game.Database;
|
using osu.Game.Database;
|
||||||
using osu.Game.Models;
|
using osu.Game.Models;
|
||||||
using osu.Game.Online.API.Requests.Responses;
|
using osu.Game.Online.API.Requests.Responses;
|
||||||
using osu.Game.Overlays.BeatmapSet.Scores;
|
using osu.Game.Overlays.BeatmapSet.Scores;
|
||||||
using osu.Game.Rulesets;
|
using osu.Game.Rulesets;
|
||||||
using osu.Game.Rulesets.Edit;
|
|
||||||
using osu.Game.Scoring;
|
using osu.Game.Scoring;
|
||||||
using Realms;
|
using Realms;
|
||||||
|
|
||||||
@ -136,60 +134,18 @@ namespace osu.Game.Beatmaps
|
|||||||
Status = BeatmapOnlineStatus.None;
|
Status = BeatmapOnlineStatus.None;
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Properties we may not want persisted (but also maybe no harm?)
|
|
||||||
|
|
||||||
public double AudioLeadIn { get; set; }
|
|
||||||
|
|
||||||
public float StackLeniency { get; set; } = 0.7f;
|
|
||||||
|
|
||||||
public bool SpecialStyle { get; set; }
|
|
||||||
|
|
||||||
public bool LetterboxInBreaks { get; set; }
|
|
||||||
|
|
||||||
public bool WidescreenStoryboard { get; set; } = true;
|
|
||||||
|
|
||||||
public bool EpilepsyWarning { get; set; }
|
|
||||||
|
|
||||||
public bool SamplesMatchPlaybackRate { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The time at which this beatmap was last played by the local user.
|
/// The time at which this beatmap was last played by the local user.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public DateTimeOffset? LastPlayed { get; set; }
|
public DateTimeOffset? LastPlayed { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The ratio of distance travelled per time unit.
|
|
||||||
/// Generally used to decouple the spacing between hit objects from the enforced "velocity" of the beatmap (see <see cref="DifficultyControlPoint.SliderVelocity"/>).
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// The most common method of understanding is that at a default value of 1.0, the time-to-distance ratio will match the slider velocity of the beatmap
|
|
||||||
/// at the current point in time. Increasing this value will make hit objects more spaced apart when compared to the cursor movement required to track a slider.
|
|
||||||
///
|
|
||||||
/// This is only a hint property, used by the editor in <see cref="IDistanceSnapProvider"/> implementations. It does not directly affect the beatmap or gameplay.
|
|
||||||
/// </remarks>
|
|
||||||
public double DistanceSpacing { get; set; } = 1.0;
|
|
||||||
|
|
||||||
public int BeatDivisor { get; set; } = 4;
|
public int BeatDivisor { get; set; } = 4;
|
||||||
|
|
||||||
public int GridSize { get; set; }
|
|
||||||
|
|
||||||
public double TimelineZoom { get; set; } = 1.0;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The time in milliseconds when last exiting the editor with this beatmap loaded.
|
/// The time in milliseconds when last exiting the editor with this beatmap loaded.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public double? EditorTimestamp { get; set; }
|
public double? EditorTimestamp { get; set; }
|
||||||
|
|
||||||
[Ignored]
|
|
||||||
public CountdownType Countdown { get; set; } = CountdownType.None;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The number of beats to move the countdown backwards (compared to its default location).
|
|
||||||
/// </summary>
|
|
||||||
public int CountdownOffset { get; set; }
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
public bool Equals(BeatmapInfo? other)
|
public bool Equals(BeatmapInfo? other)
|
||||||
{
|
{
|
||||||
if (ReferenceEquals(this, other)) return true;
|
if (ReferenceEquals(this, other)) return true;
|
||||||
|
@ -82,7 +82,7 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
this.beatmap.BeatmapInfo.BeatmapVersion = FormatVersion;
|
this.beatmap.BeatmapInfo.BeatmapVersion = FormatVersion;
|
||||||
parser = new ConvertHitObjectParser(getOffsetTime(), FormatVersion);
|
parser = new ConvertHitObjectParser(getOffsetTime(), FormatVersion);
|
||||||
|
|
||||||
applyLegacyDefaults(this.beatmap.BeatmapInfo);
|
ApplyLegacyDefaults(this.beatmap);
|
||||||
|
|
||||||
base.ParseStreamInto(stream, beatmap);
|
base.ParseStreamInto(stream, beatmap);
|
||||||
|
|
||||||
@ -190,9 +190,9 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
/// This method's intention is to restore those legacy defaults.
|
/// This method's intention is to restore those legacy defaults.
|
||||||
/// See also: https://osu.ppy.sh/wiki/en/Client/File_formats/Osu_%28file_format%29
|
/// See also: https://osu.ppy.sh/wiki/en/Client/File_formats/Osu_%28file_format%29
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private static void applyLegacyDefaults(BeatmapInfo beatmapInfo)
|
internal static void ApplyLegacyDefaults(Beatmap beatmap)
|
||||||
{
|
{
|
||||||
beatmapInfo.WidescreenStoryboard = false;
|
beatmap.WidescreenStoryboard = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void ParseLine(Beatmap beatmap, Section section, string line)
|
protected override void ParseLine(Beatmap beatmap, Section section, string line)
|
||||||
@ -244,7 +244,7 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case @"AudioLeadIn":
|
case @"AudioLeadIn":
|
||||||
beatmap.BeatmapInfo.AudioLeadIn = Parsing.ParseInt(pair.Value);
|
beatmap.AudioLeadIn = Parsing.ParseInt(pair.Value);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case @"PreviewTime":
|
case @"PreviewTime":
|
||||||
@ -261,7 +261,7 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case @"StackLeniency":
|
case @"StackLeniency":
|
||||||
beatmap.BeatmapInfo.StackLeniency = Parsing.ParseFloat(pair.Value);
|
beatmap.StackLeniency = Parsing.ParseFloat(pair.Value);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case @"Mode":
|
case @"Mode":
|
||||||
@ -269,31 +269,31 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case @"LetterboxInBreaks":
|
case @"LetterboxInBreaks":
|
||||||
beatmap.BeatmapInfo.LetterboxInBreaks = Parsing.ParseInt(pair.Value) == 1;
|
beatmap.LetterboxInBreaks = Parsing.ParseInt(pair.Value) == 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case @"SpecialStyle":
|
case @"SpecialStyle":
|
||||||
beatmap.BeatmapInfo.SpecialStyle = Parsing.ParseInt(pair.Value) == 1;
|
beatmap.SpecialStyle = Parsing.ParseInt(pair.Value) == 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case @"WidescreenStoryboard":
|
case @"WidescreenStoryboard":
|
||||||
beatmap.BeatmapInfo.WidescreenStoryboard = Parsing.ParseInt(pair.Value) == 1;
|
beatmap.WidescreenStoryboard = Parsing.ParseInt(pair.Value) == 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case @"EpilepsyWarning":
|
case @"EpilepsyWarning":
|
||||||
beatmap.BeatmapInfo.EpilepsyWarning = Parsing.ParseInt(pair.Value) == 1;
|
beatmap.EpilepsyWarning = Parsing.ParseInt(pair.Value) == 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case @"SamplesMatchPlaybackRate":
|
case @"SamplesMatchPlaybackRate":
|
||||||
beatmap.BeatmapInfo.SamplesMatchPlaybackRate = Parsing.ParseInt(pair.Value) == 1;
|
beatmap.SamplesMatchPlaybackRate = Parsing.ParseInt(pair.Value) == 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case @"Countdown":
|
case @"Countdown":
|
||||||
beatmap.BeatmapInfo.Countdown = Enum.Parse<CountdownType>(pair.Value);
|
beatmap.Countdown = Enum.Parse<CountdownType>(pair.Value);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case @"CountdownOffset":
|
case @"CountdownOffset":
|
||||||
beatmap.BeatmapInfo.CountdownOffset = Parsing.ParseInt(pair.Value);
|
beatmap.CountdownOffset = Parsing.ParseInt(pair.Value);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -313,7 +313,7 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case @"DistanceSpacing":
|
case @"DistanceSpacing":
|
||||||
beatmap.BeatmapInfo.DistanceSpacing = Math.Max(0, Parsing.ParseDouble(pair.Value));
|
beatmap.DistanceSpacing = Math.Max(0, Parsing.ParseDouble(pair.Value));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case @"BeatDivisor":
|
case @"BeatDivisor":
|
||||||
@ -321,11 +321,11 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case @"GridSize":
|
case @"GridSize":
|
||||||
beatmap.BeatmapInfo.GridSize = Parsing.ParseInt(pair.Value);
|
beatmap.GridSize = Parsing.ParseInt(pair.Value);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case @"TimelineZoom":
|
case @"TimelineZoom":
|
||||||
beatmap.BeatmapInfo.TimelineZoom = Math.Max(0, Parsing.ParseDouble(pair.Value));
|
beatmap.TimelineZoom = Math.Max(0, Parsing.ParseDouble(pair.Value));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -79,14 +79,14 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
writer.WriteLine("[General]");
|
writer.WriteLine("[General]");
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(beatmap.Metadata.AudioFile)) writer.WriteLine(FormattableString.Invariant($"AudioFilename: {Path.GetFileName(beatmap.Metadata.AudioFile)}"));
|
if (!string.IsNullOrEmpty(beatmap.Metadata.AudioFile)) writer.WriteLine(FormattableString.Invariant($"AudioFilename: {Path.GetFileName(beatmap.Metadata.AudioFile)}"));
|
||||||
writer.WriteLine(FormattableString.Invariant($"AudioLeadIn: {beatmap.BeatmapInfo.AudioLeadIn}"));
|
writer.WriteLine(FormattableString.Invariant($"AudioLeadIn: {beatmap.AudioLeadIn}"));
|
||||||
writer.WriteLine(FormattableString.Invariant($"PreviewTime: {beatmap.Metadata.PreviewTime}"));
|
writer.WriteLine(FormattableString.Invariant($"PreviewTime: {beatmap.Metadata.PreviewTime}"));
|
||||||
writer.WriteLine(FormattableString.Invariant($"Countdown: {(int)beatmap.BeatmapInfo.Countdown}"));
|
writer.WriteLine(FormattableString.Invariant($"Countdown: {(int)beatmap.Countdown}"));
|
||||||
writer.WriteLine(FormattableString.Invariant(
|
writer.WriteLine(FormattableString.Invariant(
|
||||||
$"SampleSet: {toLegacySampleBank(((beatmap.ControlPointInfo as LegacyControlPointInfo)?.SamplePoints.FirstOrDefault() ?? SampleControlPoint.DEFAULT).SampleBank)}"));
|
$"SampleSet: {toLegacySampleBank(((beatmap.ControlPointInfo as LegacyControlPointInfo)?.SamplePoints.FirstOrDefault() ?? SampleControlPoint.DEFAULT).SampleBank)}"));
|
||||||
writer.WriteLine(FormattableString.Invariant($"StackLeniency: {beatmap.BeatmapInfo.StackLeniency}"));
|
writer.WriteLine(FormattableString.Invariant($"StackLeniency: {beatmap.StackLeniency}"));
|
||||||
writer.WriteLine(FormattableString.Invariant($"Mode: {onlineRulesetID}"));
|
writer.WriteLine(FormattableString.Invariant($"Mode: {onlineRulesetID}"));
|
||||||
writer.WriteLine(FormattableString.Invariant($"LetterboxInBreaks: {(beatmap.BeatmapInfo.LetterboxInBreaks ? '1' : '0')}"));
|
writer.WriteLine(FormattableString.Invariant($"LetterboxInBreaks: {(beatmap.LetterboxInBreaks ? '1' : '0')}"));
|
||||||
// if (beatmap.BeatmapInfo.UseSkinSprites)
|
// if (beatmap.BeatmapInfo.UseSkinSprites)
|
||||||
// writer.WriteLine(@"UseSkinSprites: 1");
|
// writer.WriteLine(@"UseSkinSprites: 1");
|
||||||
// if (b.AlwaysShowPlayfield)
|
// if (b.AlwaysShowPlayfield)
|
||||||
@ -95,14 +95,14 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
// writer.WriteLine(@"OverlayPosition: " + b.OverlayPosition);
|
// writer.WriteLine(@"OverlayPosition: " + b.OverlayPosition);
|
||||||
// if (!string.IsNullOrEmpty(b.SkinPreference))
|
// if (!string.IsNullOrEmpty(b.SkinPreference))
|
||||||
// writer.WriteLine(@"SkinPreference:" + b.SkinPreference);
|
// writer.WriteLine(@"SkinPreference:" + b.SkinPreference);
|
||||||
if (beatmap.BeatmapInfo.EpilepsyWarning)
|
if (beatmap.EpilepsyWarning)
|
||||||
writer.WriteLine(@"EpilepsyWarning: 1");
|
writer.WriteLine(@"EpilepsyWarning: 1");
|
||||||
if (beatmap.BeatmapInfo.CountdownOffset > 0)
|
if (beatmap.CountdownOffset > 0)
|
||||||
writer.WriteLine(FormattableString.Invariant($@"CountdownOffset: {beatmap.BeatmapInfo.CountdownOffset}"));
|
writer.WriteLine(FormattableString.Invariant($@"CountdownOffset: {beatmap.CountdownOffset}"));
|
||||||
if (onlineRulesetID == 3)
|
if (onlineRulesetID == 3)
|
||||||
writer.WriteLine(FormattableString.Invariant($"SpecialStyle: {(beatmap.BeatmapInfo.SpecialStyle ? '1' : '0')}"));
|
writer.WriteLine(FormattableString.Invariant($"SpecialStyle: {(beatmap.SpecialStyle ? '1' : '0')}"));
|
||||||
writer.WriteLine(FormattableString.Invariant($"WidescreenStoryboard: {(beatmap.BeatmapInfo.WidescreenStoryboard ? '1' : '0')}"));
|
writer.WriteLine(FormattableString.Invariant($"WidescreenStoryboard: {(beatmap.WidescreenStoryboard ? '1' : '0')}"));
|
||||||
if (beatmap.BeatmapInfo.SamplesMatchPlaybackRate)
|
if (beatmap.SamplesMatchPlaybackRate)
|
||||||
writer.WriteLine(@"SamplesMatchPlaybackRate: 1");
|
writer.WriteLine(@"SamplesMatchPlaybackRate: 1");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -112,10 +112,10 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
|
|
||||||
if (beatmap.BeatmapInfo.Bookmarks.Length > 0)
|
if (beatmap.BeatmapInfo.Bookmarks.Length > 0)
|
||||||
writer.WriteLine(FormattableString.Invariant($"Bookmarks: {string.Join(',', beatmap.BeatmapInfo.Bookmarks)}"));
|
writer.WriteLine(FormattableString.Invariant($"Bookmarks: {string.Join(',', beatmap.BeatmapInfo.Bookmarks)}"));
|
||||||
writer.WriteLine(FormattableString.Invariant($"DistanceSpacing: {beatmap.BeatmapInfo.DistanceSpacing}"));
|
writer.WriteLine(FormattableString.Invariant($"DistanceSpacing: {beatmap.DistanceSpacing}"));
|
||||||
writer.WriteLine(FormattableString.Invariant($"BeatDivisor: {beatmap.BeatmapInfo.BeatDivisor}"));
|
writer.WriteLine(FormattableString.Invariant($"BeatDivisor: {beatmap.BeatmapInfo.BeatDivisor}"));
|
||||||
writer.WriteLine(FormattableString.Invariant($"GridSize: {beatmap.BeatmapInfo.GridSize}"));
|
writer.WriteLine(FormattableString.Invariant($"GridSize: {beatmap.GridSize}"));
|
||||||
writer.WriteLine(FormattableString.Invariant($"TimelineZoom: {beatmap.BeatmapInfo.TimelineZoom}"));
|
writer.WriteLine(FormattableString.Invariant($"TimelineZoom: {beatmap.TimelineZoom}"));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleMetadata(TextWriter writer)
|
private void handleMetadata(TextWriter writer)
|
||||||
|
@ -38,6 +38,17 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
SetFallbackDecoder<Storyboard>(() => new LegacyStoryboardDecoder());
|
SetFallbackDecoder<Storyboard>(() => new LegacyStoryboardDecoder());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override Storyboard CreateTemplateObject()
|
||||||
|
{
|
||||||
|
var sb = base.CreateTemplateObject();
|
||||||
|
|
||||||
|
var beatmap = new Beatmap();
|
||||||
|
LegacyBeatmapDecoder.ApplyLegacyDefaults(beatmap);
|
||||||
|
sb.Beatmap = beatmap;
|
||||||
|
|
||||||
|
return sb;
|
||||||
|
}
|
||||||
|
|
||||||
protected override void ParseStreamInto(LineBufferedReader stream, Storyboard storyboard)
|
protected override void ParseStreamInto(LineBufferedReader stream, Storyboard storyboard)
|
||||||
{
|
{
|
||||||
this.storyboard = storyboard;
|
this.storyboard = storyboard;
|
||||||
@ -73,6 +84,10 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
case "UseSkinSprites":
|
case "UseSkinSprites":
|
||||||
storyboard.UseSkinSprites = pair.Value == "1";
|
storyboard.UseSkinSprites = pair.Value == "1";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case @"WidescreenStoryboard":
|
||||||
|
storyboard.Beatmap.WidescreenStoryboard = Parsing.ParseInt(pair.Value) == 1;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@ using System.Linq;
|
|||||||
using osu.Framework.Lists;
|
using osu.Framework.Lists;
|
||||||
using osu.Game.Beatmaps.ControlPoints;
|
using osu.Game.Beatmaps.ControlPoints;
|
||||||
using osu.Game.Beatmaps.Timing;
|
using osu.Game.Beatmaps.Timing;
|
||||||
|
using osu.Game.Rulesets.Edit;
|
||||||
using osu.Game.Rulesets.Objects;
|
using osu.Game.Rulesets.Objects;
|
||||||
using osu.Game.Rulesets.Scoring;
|
using osu.Game.Rulesets.Scoring;
|
||||||
|
|
||||||
@ -69,6 +70,43 @@ namespace osu.Game.Beatmaps
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
double GetMostCommonBeatLength();
|
double GetMostCommonBeatLength();
|
||||||
|
|
||||||
|
double AudioLeadIn { get; internal set; }
|
||||||
|
|
||||||
|
float StackLeniency { get; internal set; }
|
||||||
|
|
||||||
|
bool SpecialStyle { get; internal set; }
|
||||||
|
|
||||||
|
bool LetterboxInBreaks { get; internal set; }
|
||||||
|
|
||||||
|
bool WidescreenStoryboard { get; internal set; }
|
||||||
|
|
||||||
|
bool EpilepsyWarning { get; internal set; }
|
||||||
|
|
||||||
|
bool SamplesMatchPlaybackRate { get; internal set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The ratio of distance travelled per time unit.
|
||||||
|
/// Generally used to decouple the spacing between hit objects from the enforced "velocity" of the beatmap (see <see cref="DifficultyControlPoint.SliderVelocity"/>).
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// The most common method of understanding is that at a default value of 1.0, the time-to-distance ratio will match the slider velocity of the beatmap
|
||||||
|
/// at the current point in time. Increasing this value will make hit objects more spaced apart when compared to the cursor movement required to track a slider.
|
||||||
|
///
|
||||||
|
/// This is only a hint property, used by the editor in <see cref="IDistanceSnapProvider"/> implementations. It does not directly affect the beatmap or gameplay.
|
||||||
|
/// </remarks>
|
||||||
|
double DistanceSpacing { get; internal set; }
|
||||||
|
|
||||||
|
int GridSize { get; internal set; }
|
||||||
|
|
||||||
|
double TimelineZoom { get; internal set; }
|
||||||
|
|
||||||
|
CountdownType Countdown { get; internal set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The number of beats to move the countdown backwards (compared to its default location).
|
||||||
|
/// </summary>
|
||||||
|
int CountdownOffset { get; internal set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a shallow-clone of this beatmap and returns it.
|
/// Creates a shallow-clone of this beatmap and returns it.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -62,7 +62,12 @@ namespace osu.Game.Beatmaps
|
|||||||
#region Resource getters
|
#region Resource getters
|
||||||
|
|
||||||
protected virtual Waveform GetWaveform() => new Waveform(null);
|
protected virtual Waveform GetWaveform() => new Waveform(null);
|
||||||
protected virtual Storyboard GetStoryboard() => new Storyboard { BeatmapInfo = BeatmapInfo };
|
|
||||||
|
protected virtual Storyboard GetStoryboard() => new Storyboard
|
||||||
|
{
|
||||||
|
BeatmapInfo = BeatmapInfo,
|
||||||
|
Beatmap = Beatmap,
|
||||||
|
};
|
||||||
|
|
||||||
protected abstract IBeatmap GetBeatmap();
|
protected abstract IBeatmap GetBeatmap();
|
||||||
public abstract Texture GetBackground();
|
public abstract Texture GetBackground();
|
||||||
|
@ -94,8 +94,9 @@ namespace osu.Game.Database
|
|||||||
/// 41 2024-04-17 Add ScoreInfo.TotalScoreWithoutMods for future mod multiplier rebalances.
|
/// 41 2024-04-17 Add ScoreInfo.TotalScoreWithoutMods for future mod multiplier rebalances.
|
||||||
/// 42 2024-08-07 Update mania key bindings to reflect changes to ManiaAction
|
/// 42 2024-08-07 Update mania key bindings to reflect changes to ManiaAction
|
||||||
/// 43 2024-10-14 Reset keybind for toggling FPS display to avoid conflict with "convert to stream" in the editor, if not already changed by user.
|
/// 43 2024-10-14 Reset keybind for toggling FPS display to avoid conflict with "convert to stream" in the editor, if not already changed by user.
|
||||||
|
/// 44 2024-11-22 Removed several properties from BeatmapInfo which did not need to be persisted to realm.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private const int schema_version = 43;
|
private const int schema_version = 44;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Lock object which is held during <see cref="BlockAllOperations"/> sections, blocking realm retrieval during blocking periods.
|
/// Lock object which is held during <see cref="BlockAllOperations"/> sections, blocking realm retrieval during blocking periods.
|
||||||
|
@ -341,6 +341,78 @@ namespace osu.Game.Rulesets.Difficulty
|
|||||||
public double GetMostCommonBeatLength() => baseBeatmap.GetMostCommonBeatLength();
|
public double GetMostCommonBeatLength() => baseBeatmap.GetMostCommonBeatLength();
|
||||||
public IBeatmap Clone() => new ProgressiveCalculationBeatmap(baseBeatmap.Clone());
|
public IBeatmap Clone() => new ProgressiveCalculationBeatmap(baseBeatmap.Clone());
|
||||||
|
|
||||||
|
public double AudioLeadIn
|
||||||
|
{
|
||||||
|
get => baseBeatmap.AudioLeadIn;
|
||||||
|
set => baseBeatmap.AudioLeadIn = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float StackLeniency
|
||||||
|
{
|
||||||
|
get => baseBeatmap.StackLeniency;
|
||||||
|
set => baseBeatmap.StackLeniency = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool SpecialStyle
|
||||||
|
{
|
||||||
|
get => baseBeatmap.SpecialStyle;
|
||||||
|
set => baseBeatmap.SpecialStyle = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool LetterboxInBreaks
|
||||||
|
{
|
||||||
|
get => baseBeatmap.LetterboxInBreaks;
|
||||||
|
set => baseBeatmap.LetterboxInBreaks = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool WidescreenStoryboard
|
||||||
|
{
|
||||||
|
get => baseBeatmap.WidescreenStoryboard;
|
||||||
|
set => baseBeatmap.WidescreenStoryboard = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool EpilepsyWarning
|
||||||
|
{
|
||||||
|
get => baseBeatmap.EpilepsyWarning;
|
||||||
|
set => baseBeatmap.EpilepsyWarning = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool SamplesMatchPlaybackRate
|
||||||
|
{
|
||||||
|
get => baseBeatmap.SamplesMatchPlaybackRate;
|
||||||
|
set => baseBeatmap.SamplesMatchPlaybackRate = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double DistanceSpacing
|
||||||
|
{
|
||||||
|
get => baseBeatmap.DistanceSpacing;
|
||||||
|
set => baseBeatmap.DistanceSpacing = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int GridSize
|
||||||
|
{
|
||||||
|
get => baseBeatmap.GridSize;
|
||||||
|
set => baseBeatmap.GridSize = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double TimelineZoom
|
||||||
|
{
|
||||||
|
get => baseBeatmap.TimelineZoom;
|
||||||
|
set => baseBeatmap.TimelineZoom = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CountdownType Countdown
|
||||||
|
{
|
||||||
|
get => baseBeatmap.Countdown;
|
||||||
|
set => baseBeatmap.Countdown = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int CountdownOffset
|
||||||
|
{
|
||||||
|
get => baseBeatmap.CountdownOffset;
|
||||||
|
set => baseBeatmap.CountdownOffset = value;
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -100,7 +100,7 @@ namespace osu.Game.Rulesets.Edit
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
DistanceSpacingMultiplier.Value = editorBeatmap.BeatmapInfo.DistanceSpacing;
|
DistanceSpacingMultiplier.Value = editorBeatmap.DistanceSpacing;
|
||||||
DistanceSpacingMultiplier.BindValueChanged(multiplier =>
|
DistanceSpacingMultiplier.BindValueChanged(multiplier =>
|
||||||
{
|
{
|
||||||
distanceSpacingSlider.ContractedLabelText = $"D. S. ({multiplier.NewValue:0.##x})";
|
distanceSpacingSlider.ContractedLabelText = $"D. S. ({multiplier.NewValue:0.##x})";
|
||||||
@ -109,7 +109,7 @@ namespace osu.Game.Rulesets.Edit
|
|||||||
if (multiplier.NewValue != multiplier.OldValue)
|
if (multiplier.NewValue != multiplier.OldValue)
|
||||||
onScreenDisplay?.Display(new DistanceSpacingToast(multiplier.NewValue.ToLocalisableString(@"0.##x"), multiplier));
|
onScreenDisplay?.Display(new DistanceSpacingToast(multiplier.NewValue.ToLocalisableString(@"0.##x"), multiplier));
|
||||||
|
|
||||||
editorBeatmap.BeatmapInfo.DistanceSpacing = multiplier.NewValue;
|
editorBeatmap.DistanceSpacing = multiplier.NewValue;
|
||||||
}, true);
|
}, true);
|
||||||
|
|
||||||
DistanceSpacingMultiplier.BindDisabledChanged(disabled => distanceSpacingSlider.Alpha = disabled ? 0 : 1, true);
|
DistanceSpacingMultiplier.BindDisabledChanged(disabled => distanceSpacingSlider.Alpha = disabled ? 0 : 1, true);
|
||||||
|
@ -18,7 +18,7 @@ namespace osu.Game.Rulesets.Edit
|
|||||||
/// A multiplier which changes the ratio of distance travelled per time unit.
|
/// A multiplier which changes the ratio of distance travelled per time unit.
|
||||||
/// Importantly, this is provided for manual usage, and not multiplied into any of the methods exposed by this interface.
|
/// Importantly, this is provided for manual usage, and not multiplied into any of the methods exposed by this interface.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <seealso cref="BeatmapInfo.DistanceSpacing"/>
|
/// <seealso cref="IBeatmap.DistanceSpacing"/>
|
||||||
Bindable<double> DistanceSpacingMultiplier { get; }
|
Bindable<double> DistanceSpacingMultiplier { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -157,7 +157,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
|||||||
Scheduler.AddOnce(applyVisualOffset, beatmap);
|
Scheduler.AddOnce(applyVisualOffset, beatmap);
|
||||||
}, true);
|
}, true);
|
||||||
|
|
||||||
Zoom = (float)(defaultTimelineZoom * editorBeatmap.BeatmapInfo.TimelineZoom);
|
Zoom = (float)(defaultTimelineZoom * editorBeatmap.TimelineZoom);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void applyVisualOffset(IBindable<WorkingBeatmap> beatmap)
|
private void applyVisualOffset(IBindable<WorkingBeatmap> beatmap)
|
||||||
@ -212,7 +212,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
|||||||
float minimumZoom = getZoomLevelForVisibleMilliseconds(10000);
|
float minimumZoom = getZoomLevelForVisibleMilliseconds(10000);
|
||||||
float maximumZoom = getZoomLevelForVisibleMilliseconds(500);
|
float maximumZoom = getZoomLevelForVisibleMilliseconds(500);
|
||||||
|
|
||||||
float initialZoom = (float)Math.Clamp(defaultTimelineZoom * (editorBeatmap.BeatmapInfo.TimelineZoom == 0 ? 1 : editorBeatmap.BeatmapInfo.TimelineZoom), minimumZoom, maximumZoom);
|
float initialZoom = (float)Math.Clamp(defaultTimelineZoom * (editorBeatmap.TimelineZoom == 0 ? 1 : editorBeatmap.TimelineZoom), minimumZoom, maximumZoom);
|
||||||
|
|
||||||
SetupZoom(initialZoom, minimumZoom, maximumZoom);
|
SetupZoom(initialZoom, minimumZoom, maximumZoom);
|
||||||
|
|
||||||
@ -234,7 +234,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
|||||||
protected override void OnZoomChanged()
|
protected override void OnZoomChanged()
|
||||||
{
|
{
|
||||||
base.OnZoomChanged();
|
base.OnZoomChanged();
|
||||||
editorBeatmap.BeatmapInfo.TimelineZoom = Zoom / defaultTimelineZoom;
|
editorBeatmap.TimelineZoom = Zoom / defaultTimelineZoom;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void UpdateAfterChildren()
|
protected override void UpdateAfterChildren()
|
||||||
|
@ -198,6 +198,78 @@ namespace osu.Game.Screens.Edit
|
|||||||
|
|
||||||
public double GetMostCommonBeatLength() => PlayableBeatmap.GetMostCommonBeatLength();
|
public double GetMostCommonBeatLength() => PlayableBeatmap.GetMostCommonBeatLength();
|
||||||
|
|
||||||
|
public double AudioLeadIn
|
||||||
|
{
|
||||||
|
get => PlayableBeatmap.AudioLeadIn;
|
||||||
|
set => PlayableBeatmap.AudioLeadIn = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float StackLeniency
|
||||||
|
{
|
||||||
|
get => PlayableBeatmap.StackLeniency;
|
||||||
|
set => PlayableBeatmap.StackLeniency = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool SpecialStyle
|
||||||
|
{
|
||||||
|
get => PlayableBeatmap.SpecialStyle;
|
||||||
|
set => PlayableBeatmap.SpecialStyle = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool LetterboxInBreaks
|
||||||
|
{
|
||||||
|
get => PlayableBeatmap.LetterboxInBreaks;
|
||||||
|
set => PlayableBeatmap.LetterboxInBreaks = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool WidescreenStoryboard
|
||||||
|
{
|
||||||
|
get => PlayableBeatmap.WidescreenStoryboard;
|
||||||
|
set => PlayableBeatmap.WidescreenStoryboard = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool EpilepsyWarning
|
||||||
|
{
|
||||||
|
get => PlayableBeatmap.EpilepsyWarning;
|
||||||
|
set => PlayableBeatmap.EpilepsyWarning = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool SamplesMatchPlaybackRate
|
||||||
|
{
|
||||||
|
get => PlayableBeatmap.SamplesMatchPlaybackRate;
|
||||||
|
set => PlayableBeatmap.SamplesMatchPlaybackRate = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double DistanceSpacing
|
||||||
|
{
|
||||||
|
get => PlayableBeatmap.DistanceSpacing;
|
||||||
|
set => PlayableBeatmap.DistanceSpacing = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int GridSize
|
||||||
|
{
|
||||||
|
get => PlayableBeatmap.GridSize;
|
||||||
|
set => PlayableBeatmap.GridSize = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double TimelineZoom
|
||||||
|
{
|
||||||
|
get => PlayableBeatmap.TimelineZoom;
|
||||||
|
set => PlayableBeatmap.TimelineZoom = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CountdownType Countdown
|
||||||
|
{
|
||||||
|
get => PlayableBeatmap.Countdown;
|
||||||
|
set => PlayableBeatmap.Countdown = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int CountdownOffset
|
||||||
|
{
|
||||||
|
get => PlayableBeatmap.CountdownOffset;
|
||||||
|
set => PlayableBeatmap.CountdownOffset = value;
|
||||||
|
}
|
||||||
|
|
||||||
public IBeatmap Clone() => (EditorBeatmap)MemberwiseClone();
|
public IBeatmap Clone() => (EditorBeatmap)MemberwiseClone();
|
||||||
|
|
||||||
private IList mutableHitObjects => (IList)PlayableBeatmap.HitObjects;
|
private IList mutableHitObjects => (IList)PlayableBeatmap.HitObjects;
|
||||||
|
@ -39,7 +39,7 @@ namespace osu.Game.Screens.Edit.Setup
|
|||||||
{
|
{
|
||||||
Caption = EditorSetupStrings.EnableCountdown,
|
Caption = EditorSetupStrings.EnableCountdown,
|
||||||
HintText = EditorSetupStrings.CountdownDescription,
|
HintText = EditorSetupStrings.CountdownDescription,
|
||||||
Current = { Value = Beatmap.BeatmapInfo.Countdown != CountdownType.None },
|
Current = { Value = Beatmap.Countdown != CountdownType.None },
|
||||||
},
|
},
|
||||||
CountdownSettings = new FillFlowContainer
|
CountdownSettings = new FillFlowContainer
|
||||||
{
|
{
|
||||||
@ -52,14 +52,14 @@ namespace osu.Game.Screens.Edit.Setup
|
|||||||
CountdownSpeed = new FormEnumDropdown<CountdownType>
|
CountdownSpeed = new FormEnumDropdown<CountdownType>
|
||||||
{
|
{
|
||||||
Caption = EditorSetupStrings.CountdownSpeed,
|
Caption = EditorSetupStrings.CountdownSpeed,
|
||||||
Current = { Value = Beatmap.BeatmapInfo.Countdown != CountdownType.None ? Beatmap.BeatmapInfo.Countdown : CountdownType.Normal },
|
Current = { Value = Beatmap.Countdown != CountdownType.None ? Beatmap.Countdown : CountdownType.Normal },
|
||||||
Items = Enum.GetValues<CountdownType>().Where(type => type != CountdownType.None)
|
Items = Enum.GetValues<CountdownType>().Where(type => type != CountdownType.None)
|
||||||
},
|
},
|
||||||
CountdownOffset = new FormNumberBox
|
CountdownOffset = new FormNumberBox
|
||||||
{
|
{
|
||||||
Caption = EditorSetupStrings.CountdownOffset,
|
Caption = EditorSetupStrings.CountdownOffset,
|
||||||
HintText = EditorSetupStrings.CountdownOffsetDescription,
|
HintText = EditorSetupStrings.CountdownOffsetDescription,
|
||||||
Current = { Value = Beatmap.BeatmapInfo.CountdownOffset.ToString() },
|
Current = { Value = Beatmap.CountdownOffset.ToString() },
|
||||||
TabbableContentContainer = this,
|
TabbableContentContainer = this,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -68,25 +68,25 @@ namespace osu.Game.Screens.Edit.Setup
|
|||||||
{
|
{
|
||||||
Caption = EditorSetupStrings.WidescreenSupport,
|
Caption = EditorSetupStrings.WidescreenSupport,
|
||||||
HintText = EditorSetupStrings.WidescreenSupportDescription,
|
HintText = EditorSetupStrings.WidescreenSupportDescription,
|
||||||
Current = { Value = Beatmap.BeatmapInfo.WidescreenStoryboard }
|
Current = { Value = Beatmap.WidescreenStoryboard }
|
||||||
},
|
},
|
||||||
epilepsyWarning = new FormCheckBox
|
epilepsyWarning = new FormCheckBox
|
||||||
{
|
{
|
||||||
Caption = EditorSetupStrings.EpilepsyWarning,
|
Caption = EditorSetupStrings.EpilepsyWarning,
|
||||||
HintText = EditorSetupStrings.EpilepsyWarningDescription,
|
HintText = EditorSetupStrings.EpilepsyWarningDescription,
|
||||||
Current = { Value = Beatmap.BeatmapInfo.EpilepsyWarning }
|
Current = { Value = Beatmap.EpilepsyWarning }
|
||||||
},
|
},
|
||||||
letterboxDuringBreaks = new FormCheckBox
|
letterboxDuringBreaks = new FormCheckBox
|
||||||
{
|
{
|
||||||
Caption = EditorSetupStrings.LetterboxDuringBreaks,
|
Caption = EditorSetupStrings.LetterboxDuringBreaks,
|
||||||
HintText = EditorSetupStrings.LetterboxDuringBreaksDescription,
|
HintText = EditorSetupStrings.LetterboxDuringBreaksDescription,
|
||||||
Current = { Value = Beatmap.BeatmapInfo.LetterboxInBreaks }
|
Current = { Value = Beatmap.LetterboxInBreaks }
|
||||||
},
|
},
|
||||||
samplesMatchPlaybackRate = new FormCheckBox
|
samplesMatchPlaybackRate = new FormCheckBox
|
||||||
{
|
{
|
||||||
Caption = EditorSetupStrings.SamplesMatchPlaybackRate,
|
Caption = EditorSetupStrings.SamplesMatchPlaybackRate,
|
||||||
HintText = EditorSetupStrings.SamplesMatchPlaybackRateDescription,
|
HintText = EditorSetupStrings.SamplesMatchPlaybackRateDescription,
|
||||||
Current = { Value = Beatmap.BeatmapInfo.SamplesMatchPlaybackRate }
|
Current = { Value = Beatmap.SamplesMatchPlaybackRate }
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -113,18 +113,18 @@ namespace osu.Game.Screens.Edit.Setup
|
|||||||
{
|
{
|
||||||
updateBeatmap();
|
updateBeatmap();
|
||||||
// update displayed text to ensure parsed value matches display (i.e. if empty string was provided).
|
// update displayed text to ensure parsed value matches display (i.e. if empty string was provided).
|
||||||
CountdownOffset.Current.Value = Beatmap.BeatmapInfo.CountdownOffset.ToString(CultureInfo.InvariantCulture);
|
CountdownOffset.Current.Value = Beatmap.CountdownOffset.ToString(CultureInfo.InvariantCulture);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateBeatmap()
|
private void updateBeatmap()
|
||||||
{
|
{
|
||||||
Beatmap.BeatmapInfo.Countdown = EnableCountdown.Current.Value ? CountdownSpeed.Current.Value : CountdownType.None;
|
Beatmap.Countdown = EnableCountdown.Current.Value ? CountdownSpeed.Current.Value : CountdownType.None;
|
||||||
Beatmap.BeatmapInfo.CountdownOffset = int.TryParse(CountdownOffset.Current.Value, NumberStyles.None, CultureInfo.InvariantCulture, out int offset) ? offset : 0;
|
Beatmap.CountdownOffset = int.TryParse(CountdownOffset.Current.Value, NumberStyles.None, CultureInfo.InvariantCulture, out int offset) ? offset : 0;
|
||||||
|
|
||||||
Beatmap.BeatmapInfo.WidescreenStoryboard = widescreenSupport.Current.Value;
|
Beatmap.WidescreenStoryboard = widescreenSupport.Current.Value;
|
||||||
Beatmap.BeatmapInfo.EpilepsyWarning = epilepsyWarning.Current.Value;
|
Beatmap.EpilepsyWarning = epilepsyWarning.Current.Value;
|
||||||
Beatmap.BeatmapInfo.LetterboxInBreaks = letterboxDuringBreaks.Current.Value;
|
Beatmap.LetterboxInBreaks = letterboxDuringBreaks.Current.Value;
|
||||||
Beatmap.BeatmapInfo.SamplesMatchPlaybackRate = samplesMatchPlaybackRate.Current.Value;
|
Beatmap.SamplesMatchPlaybackRate = samplesMatchPlaybackRate.Current.Value;
|
||||||
|
|
||||||
Beatmap.SaveState();
|
Beatmap.SaveState();
|
||||||
}
|
}
|
||||||
|
@ -95,8 +95,8 @@ namespace osu.Game.Screens.Play
|
|||||||
// some beatmaps specify a current lead-in time which should be used instead of the ruleset-provided value when available.
|
// some beatmaps specify a current lead-in time which should be used instead of the ruleset-provided value when available.
|
||||||
// this is not available as an option in the live editor but can still be applied via .osu editing.
|
// this is not available as an option in the live editor but can still be applied via .osu editing.
|
||||||
double firstHitObjectTime = beatmap.Beatmap.HitObjects.First().StartTime;
|
double firstHitObjectTime = beatmap.Beatmap.HitObjects.First().StartTime;
|
||||||
if (beatmap.BeatmapInfo.AudioLeadIn > 0)
|
if (beatmap.Beatmap.AudioLeadIn > 0)
|
||||||
time = Math.Min(time, firstHitObjectTime - beatmap.BeatmapInfo.AudioLeadIn);
|
time = Math.Min(time, firstHitObjectTime - beatmap.Beatmap.AudioLeadIn);
|
||||||
|
|
||||||
return time;
|
return time;
|
||||||
}
|
}
|
||||||
|
@ -457,7 +457,7 @@ namespace osu.Game.Screens.Play
|
|||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre
|
Origin = Anchor.Centre
|
||||||
},
|
},
|
||||||
BreakOverlay = new BreakOverlay(working.Beatmap.BeatmapInfo.LetterboxInBreaks, ScoreProcessor)
|
BreakOverlay = new BreakOverlay(working.Beatmap.LetterboxInBreaks, ScoreProcessor)
|
||||||
{
|
{
|
||||||
Clock = DrawableRuleset.FrameStableClock,
|
Clock = DrawableRuleset.FrameStableClock,
|
||||||
ProcessCustomClock = false,
|
ProcessCustomClock = false,
|
||||||
|
@ -242,7 +242,7 @@ namespace osu.Game.Screens.Play
|
|||||||
sampleRestart = new SkinnableSound(new SampleInfo(@"Gameplay/restart", @"pause-retry-click"))
|
sampleRestart = new SkinnableSound(new SampleInfo(@"Gameplay/restart", @"pause-retry-click"))
|
||||||
};
|
};
|
||||||
|
|
||||||
if (Beatmap.Value.BeatmapInfo.EpilepsyWarning)
|
if (Beatmap.Value.Beatmap.EpilepsyWarning)
|
||||||
{
|
{
|
||||||
disclaimers.Add(epilepsyWarning = new PlayerLoaderDisclaimer(PlayerLoaderStrings.EpilepsyWarningTitle, PlayerLoaderStrings.EpilepsyWarningContent));
|
disclaimers.Add(epilepsyWarning = new PlayerLoaderDisclaimer(PlayerLoaderStrings.EpilepsyWarningTitle, PlayerLoaderStrings.EpilepsyWarningContent));
|
||||||
}
|
}
|
||||||
|
@ -67,7 +67,7 @@ namespace osu.Game.Storyboards.Drawables
|
|||||||
|
|
||||||
bool onlyHasVideoElements = Storyboard.Layers.SelectMany(l => l.Elements).All(e => e is StoryboardVideo);
|
bool onlyHasVideoElements = Storyboard.Layers.SelectMany(l => l.Elements).All(e => e is StoryboardVideo);
|
||||||
|
|
||||||
Width = Height * (storyboard.BeatmapInfo.WidescreenStoryboard || onlyHasVideoElements ? 16 / 9f : 4 / 3f);
|
Width = Height * (storyboard.Beatmap.WidescreenStoryboard || onlyHasVideoElements ? 16 / 9f : 4 / 3f);
|
||||||
|
|
||||||
Anchor = Anchor.Centre;
|
Anchor = Anchor.Centre;
|
||||||
Origin = Anchor.Centre;
|
Origin = Anchor.Centre;
|
||||||
|
@ -17,6 +17,7 @@ namespace osu.Game.Storyboards
|
|||||||
public IEnumerable<StoryboardLayer> Layers => layers.Values;
|
public IEnumerable<StoryboardLayer> Layers => layers.Values;
|
||||||
|
|
||||||
public BeatmapInfo BeatmapInfo = new BeatmapInfo();
|
public BeatmapInfo BeatmapInfo = new BeatmapInfo();
|
||||||
|
public IBeatmap Beatmap { get; set; } = new Beatmap();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether the storyboard should prefer textures from the current skin before using local storyboard textures.
|
/// Whether the storyboard should prefer textures from the current skin before using local storyboard textures.
|
||||||
|
@ -27,6 +27,17 @@ namespace osu.Game.Tests.Beatmaps
|
|||||||
BeatmapInfo = baseBeatmap.BeatmapInfo;
|
BeatmapInfo = baseBeatmap.BeatmapInfo;
|
||||||
ControlPointInfo = baseBeatmap.ControlPointInfo;
|
ControlPointInfo = baseBeatmap.ControlPointInfo;
|
||||||
UnhandledEventLines = baseBeatmap.UnhandledEventLines;
|
UnhandledEventLines = baseBeatmap.UnhandledEventLines;
|
||||||
|
AudioLeadIn = baseBeatmap.AudioLeadIn;
|
||||||
|
StackLeniency = baseBeatmap.StackLeniency;
|
||||||
|
SpecialStyle = baseBeatmap.SpecialStyle;
|
||||||
|
LetterboxInBreaks = baseBeatmap.LetterboxInBreaks;
|
||||||
|
WidescreenStoryboard = baseBeatmap.WidescreenStoryboard;
|
||||||
|
EpilepsyWarning = baseBeatmap.EpilepsyWarning;
|
||||||
|
SamplesMatchPlaybackRate = baseBeatmap.SamplesMatchPlaybackRate;
|
||||||
|
DistanceSpacing = baseBeatmap.DistanceSpacing;
|
||||||
|
GridSize = baseBeatmap.GridSize;
|
||||||
|
TimelineZoom = baseBeatmap.TimelineZoom;
|
||||||
|
CountdownOffset = baseBeatmap.CountdownOffset;
|
||||||
|
|
||||||
if (withHitObjects)
|
if (withHitObjects)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user