mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 12:57:36 +08:00
Change some BeatmapInfo
defaults in a backwards compatible manner
This commit is contained in:
parent
7dc3940dee
commit
1b8136e3e0
@ -99,11 +99,11 @@ namespace osu.Game.Beatmaps
|
||||
|
||||
public bool LetterboxInBreaks { get; set; }
|
||||
|
||||
public bool WidescreenStoryboard { get; set; }
|
||||
public bool WidescreenStoryboard { get; set; } = true;
|
||||
|
||||
public bool EpilepsyWarning { get; set; }
|
||||
|
||||
public bool SamplesMatchPlaybackRate { get; set; }
|
||||
public bool SamplesMatchPlaybackRate { get; set; } = true;
|
||||
|
||||
public double DistanceSpacing { get; set; }
|
||||
|
||||
|
@ -90,14 +90,7 @@ namespace osu.Game.Beatmaps
|
||||
{
|
||||
Beatmaps =
|
||||
{
|
||||
new BeatmapInfo
|
||||
{
|
||||
Difficulty = new BeatmapDifficulty(),
|
||||
Ruleset = ruleset,
|
||||
Metadata = metadata,
|
||||
WidescreenStoryboard = true,
|
||||
SamplesMatchPlaybackRate = true,
|
||||
}
|
||||
new BeatmapInfo(ruleset, new BeatmapDifficulty(), metadata)
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -56,6 +56,8 @@ namespace osu.Game.Beatmaps.Formats
|
||||
this.beatmap = beatmap;
|
||||
this.beatmap.BeatmapInfo.BeatmapVersion = FormatVersion;
|
||||
|
||||
applyLegacyDefaults(this.beatmap.BeatmapInfo);
|
||||
|
||||
base.ParseStreamInto(stream, beatmap);
|
||||
|
||||
flushPendingPoints();
|
||||
@ -70,6 +72,19 @@ namespace osu.Game.Beatmaps.Formats
|
||||
hitObject.ApplyDefaults(this.beatmap.ControlPointInfo, this.beatmap.Difficulty);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Some `BeatmapInfo` members have default values that differ from the default values used by stable.
|
||||
/// In addition, legacy beatmaps will sometimes not contain some configuration keys, in which case
|
||||
/// the legacy default values should be used.
|
||||
/// 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
|
||||
/// </summary>
|
||||
private void applyLegacyDefaults(BeatmapInfo beatmapInfo)
|
||||
{
|
||||
beatmapInfo.WidescreenStoryboard = false;
|
||||
beatmapInfo.SamplesMatchPlaybackRate = false;
|
||||
}
|
||||
|
||||
protected override bool ShouldSkipLine(string line) => base.ShouldSkipLine(line) || line.StartsWith(' ') || line.StartsWith('_');
|
||||
|
||||
protected override void ParseLine(Beatmap beatmap, Section section, string line)
|
||||
|
Loading…
Reference in New Issue
Block a user