mirror of
https://github.com/ppy/osu.git
synced 2024-11-14 14:27:25 +08:00
Fix WidescreenStoryboard
breakage after moving out of BeatmapInfo
This commit is contained in:
parent
d707e29ff7
commit
1d4d806362
@ -80,7 +80,7 @@ namespace osu.Game.Beatmaps.Formats
|
||||
this.beatmap = beatmap;
|
||||
this.beatmap.BeatmapInfo.BeatmapVersion = FormatVersion;
|
||||
|
||||
applyLegacyDefaults(this.beatmap);
|
||||
ApplyLegacyDefaults(this.beatmap);
|
||||
|
||||
base.ParseStreamInto(stream, beatmap);
|
||||
|
||||
@ -186,7 +186,7 @@ namespace osu.Game.Beatmaps.Formats
|
||||
/// 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 static void applyLegacyDefaults(Beatmap beatmap)
|
||||
internal static void ApplyLegacyDefaults(Beatmap beatmap)
|
||||
{
|
||||
beatmap.WidescreenStoryboard = false;
|
||||
beatmap.SamplesMatchPlaybackRate = false;
|
||||
|
@ -37,6 +37,17 @@ namespace osu.Game.Beatmaps.Formats
|
||||
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)
|
||||
{
|
||||
this.storyboard = storyboard;
|
||||
@ -72,6 +83,10 @@ namespace osu.Game.Beatmaps.Formats
|
||||
case "UseSkinSprites":
|
||||
storyboard.UseSkinSprites = pair.Value == "1";
|
||||
break;
|
||||
|
||||
case @"WidescreenStoryboard":
|
||||
storyboard.Beatmap.WidescreenStoryboard = Parsing.ParseInt(pair.Value) == 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -62,7 +62,12 @@ namespace osu.Game.Beatmaps
|
||||
#region Resource getters
|
||||
|
||||
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();
|
||||
public abstract Texture GetBackground();
|
||||
|
Loading…
Reference in New Issue
Block a user