mirror of
https://github.com/ppy/osu.git
synced 2024-11-13 18:47:27 +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 LetterboxInBreaks { get; set; }
|
||||||
|
|
||||||
public bool WidescreenStoryboard { get; set; }
|
public bool WidescreenStoryboard { get; set; } = true;
|
||||||
|
|
||||||
public bool EpilepsyWarning { get; set; }
|
public bool EpilepsyWarning { get; set; }
|
||||||
|
|
||||||
public bool SamplesMatchPlaybackRate { get; set; }
|
public bool SamplesMatchPlaybackRate { get; set; } = true;
|
||||||
|
|
||||||
public double DistanceSpacing { get; set; }
|
public double DistanceSpacing { get; set; }
|
||||||
|
|
||||||
|
@ -90,14 +90,7 @@ namespace osu.Game.Beatmaps
|
|||||||
{
|
{
|
||||||
Beatmaps =
|
Beatmaps =
|
||||||
{
|
{
|
||||||
new BeatmapInfo
|
new BeatmapInfo(ruleset, new BeatmapDifficulty(), metadata)
|
||||||
{
|
|
||||||
Difficulty = new BeatmapDifficulty(),
|
|
||||||
Ruleset = ruleset,
|
|
||||||
Metadata = metadata,
|
|
||||||
WidescreenStoryboard = true,
|
|
||||||
SamplesMatchPlaybackRate = true,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -56,6 +56,8 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
this.beatmap = beatmap;
|
this.beatmap = beatmap;
|
||||||
this.beatmap.BeatmapInfo.BeatmapVersion = FormatVersion;
|
this.beatmap.BeatmapInfo.BeatmapVersion = FormatVersion;
|
||||||
|
|
||||||
|
applyLegacyDefaults(this.beatmap.BeatmapInfo);
|
||||||
|
|
||||||
base.ParseStreamInto(stream, beatmap);
|
base.ParseStreamInto(stream, beatmap);
|
||||||
|
|
||||||
flushPendingPoints();
|
flushPendingPoints();
|
||||||
@ -70,6 +72,19 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
hitObject.ApplyDefaults(this.beatmap.ControlPointInfo, this.beatmap.Difficulty);
|
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 bool ShouldSkipLine(string line) => base.ShouldSkipLine(line) || line.StartsWith(' ') || line.StartsWith('_');
|
||||||
|
|
||||||
protected override void ParseLine(Beatmap beatmap, Section section, string line)
|
protected override void ParseLine(Beatmap beatmap, Section section, string line)
|
||||||
|
Loading…
Reference in New Issue
Block a user