Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove initialize working time in the lyric. #1763

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion osu.Game.Rulesets.Karaoke/Beatmaps/Formats/LrcDecoder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ protected override void ParseStreamInto(LineBufferedReader stream, Beatmap outpu
TimeTags = TimeTagsUtils.Sort(lrcTimeTags.Concat(lrcRubyTimeTags)),
RubyTags = lrcRubies
};
lyric.InitialWorkingTime();
output.HitObjects.Add(lyric);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

using System.Collections.Generic;
using System.Linq;
using osu.Framework.Extensions.IEnumerableExtensions;
using osu.Game.Rulesets.Karaoke.Objects;

namespace osu.Game.Rulesets.Karaoke.Beatmaps.Patterns
Expand All @@ -25,9 +24,6 @@ public void Generate(IEnumerable<Lyric> hitObjects)

private void assignLyricTime(IList<Lyric> lyrics)
{
// Reset working time
lyrics.ForEach(h => h.InitialWorkingTime());

// Apply start time
for (int i = 0; i < lyrics.Count; i++)
{
Expand All @@ -37,12 +33,12 @@ private void assignLyricTime(IList<Lyric> lyrics)
if (lastLyric == null)
continue;

// Adjust start time and end time
double lyricEndTime = lyric.EndTime;
lyric.StartTime = lastLyric.EndTime + 1000;
double lyricEndTime = lyric.LyricEndTime;
double lyricStartTime = lastLyric.EndTime + 1000;

// Should re-assign duration here
lyric.Duration = lyricEndTime - lyric.StartTime;
// Adjust start time and end time
lyric.StartTime = lyricStartTime;
lyric.Duration = lyricEndTime - lyricStartTime;
}
}
}
Expand Down
10 changes: 0 additions & 10 deletions osu.Game.Rulesets.Karaoke/Objects/Lyric.cs
Original file line number Diff line number Diff line change
Expand Up @@ -266,16 +266,6 @@ protected override void ApplyDefaultsToSelf(ControlPointInfo controlPointInfo, I

// Add because it will cause error on exit then enter gameplay.
StartTimeBindable.UnbindAll();

// Initial working start and end time.
// todo: should be removed eventually because start time and duration will be calculated by KaraokeBeatmapProcessor
InitialWorkingTime();
}

public void InitialWorkingTime()
{
StartTime = LyricStartTime;
Duration = LyricDuration;
}

protected override HitWindows CreateHitWindows() => new KaraokeLyricHitWindows();
Expand Down