mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 07:33:55 +09:00
Code quality, read position offsets
This commit is contained in:
@ -14,6 +14,7 @@ using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Timing;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Beatmaps.Legacy;
|
||||
using osu.Game.Configuration;
|
||||
using osu.Game.Rulesets.Mods;
|
||||
|
||||
@ -117,15 +118,12 @@ namespace osu.Game.Screens.Play
|
||||
startTime = Math.Min(startTime, firstHitObjectTime - beatmap.BeatmapInfo.AudioLeadIn);
|
||||
|
||||
// some beatmaps have no AudioLeadIn but the video starts before the first object
|
||||
var videoLayer = beatmap.Storyboard.GetLayer("Video");
|
||||
var videoLayer = beatmap.Storyboard.GetLayer(LegacyStoryLayer.Video);
|
||||
|
||||
if (videoLayer.Elements.Any())
|
||||
{
|
||||
var videoOffset = videoLayer.Elements.First().StartTime;
|
||||
var videoOffset = videoLayer.Elements.SingleOrDefault()?.StartTime;
|
||||
|
||||
if (videoOffset != 0)
|
||||
startTime = Math.Min(startTime, videoOffset);
|
||||
}
|
||||
if (videoOffset != null)
|
||||
startTime = Math.Min(startTime, videoOffset.GetValueOrDefault());
|
||||
|
||||
Seek(startTime);
|
||||
|
||||
|
Reference in New Issue
Block a user