mirror of
https://github.com/osukey/osukey.git
synced 2025-08-06 16:13:57 +09:00
Read UseSkinSprites when decoding storyboards
This commit is contained in:
@ -48,6 +48,10 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
|
|
||||||
switch (section)
|
switch (section)
|
||||||
{
|
{
|
||||||
|
case Section.General:
|
||||||
|
handleGeneral(storyboard, line);
|
||||||
|
return;
|
||||||
|
|
||||||
case Section.Events:
|
case Section.Events:
|
||||||
handleEvents(line);
|
handleEvents(line);
|
||||||
return;
|
return;
|
||||||
@ -60,6 +64,18 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
base.ParseLine(storyboard, section, line);
|
base.ParseLine(storyboard, section, line);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void handleGeneral(Storyboard storyboard, string line)
|
||||||
|
{
|
||||||
|
var pair = SplitKeyVal(line);
|
||||||
|
|
||||||
|
switch (pair.Key)
|
||||||
|
{
|
||||||
|
case "UseSkinSprites":
|
||||||
|
storyboard.UseSkinSprites = pair.Value == "1";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void handleEvents(string line)
|
private void handleEvents(string line)
|
||||||
{
|
{
|
||||||
var depth = 0;
|
var depth = 0;
|
||||||
|
@ -15,6 +15,11 @@ namespace osu.Game.Storyboards
|
|||||||
|
|
||||||
public BeatmapInfo BeatmapInfo = new BeatmapInfo();
|
public BeatmapInfo BeatmapInfo = new BeatmapInfo();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Whether the storyboard can fall back to skin sprites in case no matching storyboard sprites are found.
|
||||||
|
/// </summary>
|
||||||
|
public bool UseSkinSprites { get; set; }
|
||||||
|
|
||||||
public bool HasDrawable => Layers.Any(l => l.Elements.Any(e => e.IsDrawable));
|
public bool HasDrawable => Layers.Any(l => l.Elements.Any(e => e.IsDrawable));
|
||||||
|
|
||||||
public double FirstEventTime => Layers.Min(l => l.Elements.FirstOrDefault()?.StartTime ?? 0);
|
public double FirstEventTime => Layers.Min(l => l.Elements.FirstOrDefault()?.StartTime ?? 0);
|
||||||
|
Reference in New Issue
Block a user