From 94431e078bbf4b383778712097831e0ab18d8be4 Mon Sep 17 00:00:00 2001 From: andy840119 Date: Sun, 24 Sep 2023 12:42:09 +0800 Subject: [PATCH 1/2] Upgrade the package to the latest and fix the breaking change. Here's the breaking change in the IScrollingInfo: https://github.com/ppy/osu/pull/24550 And should remove the LegacyBpmMultiplier: https://github.com/ppy/osu/pull/24738 --- .../Skinning/KaraokeSkinnableColumnTestScene.cs | 2 +- .../Edit/Utils/HitObjectWritableUtils.cs | 2 -- .../Screens/Edit/Beatmaps/Lyrics/LyricEditor.cs | 2 +- .../Settings/Previews/Gameplay/NotePlayfieldPreview.cs | 2 +- .../Screens/Skin/Style/NoteStylePreview.cs | 2 +- .../UI/Components/VoiceVisualization.cs | 10 +++++----- .../osu.Game.Rulesets.Karaoke.csproj | 2 +- 7 files changed, 10 insertions(+), 12 deletions(-) diff --git a/osu.Game.Rulesets.Karaoke.Tests/Skinning/KaraokeSkinnableColumnTestScene.cs b/osu.Game.Rulesets.Karaoke.Tests/Skinning/KaraokeSkinnableColumnTestScene.cs index ea55c54c5..2103865c5 100644 --- a/osu.Game.Rulesets.Karaoke.Tests/Skinning/KaraokeSkinnableColumnTestScene.cs +++ b/osu.Game.Rulesets.Karaoke.Tests/Skinning/KaraokeSkinnableColumnTestScene.cs @@ -73,7 +73,7 @@ private class TestScrollingInfo : IScrollingInfo IBindable IScrollingInfo.Direction => Direction; IBindable IScrollingInfo.TimeRange { get; } = new Bindable(1000); - IScrollAlgorithm IScrollingInfo.Algorithm { get; } = new ZeroScrollAlgorithm(); + IBindable IScrollingInfo.Algorithm { get; } = new Bindable(new ZeroScrollAlgorithm()); } private class ZeroScrollAlgorithm : IScrollAlgorithm diff --git a/osu.Game.Rulesets.Karaoke/Edit/Utils/HitObjectWritableUtils.cs b/osu.Game.Rulesets.Karaoke/Edit/Utils/HitObjectWritableUtils.cs index c7ce1710d..8f691630d 100644 --- a/osu.Game.Rulesets.Karaoke/Edit/Utils/HitObjectWritableUtils.cs +++ b/osu.Game.Rulesets.Karaoke/Edit/Utils/HitObjectWritableUtils.cs @@ -89,7 +89,6 @@ private static bool isWriteLyricPropertyLockedByState(LockState lockState, strin nameof(Lyric.ReferenceLyricConfig) => lockState > LockState.Partial, // base class nameof(Lyric.Samples) => false, - nameof(Lyric.LegacyBpmMultiplier) => false, _ => throw new NotSupportedException(), }; } @@ -117,7 +116,6 @@ private static bool isWriteLyricPropertyLockedByConfig(IReferenceLyricPropertyCo nameof(Lyric.ReferenceLyricConfig) => false, // base class nameof(Lyric.Samples) => false, - nameof(Lyric.LegacyBpmMultiplier) => false, _ => throw new NotSupportedException(), }, null => false, diff --git a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/LyricEditor.cs b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/LyricEditor.cs index f8ebe2558..b5846e759 100644 --- a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/LyricEditor.cs +++ b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/LyricEditor.cs @@ -479,6 +479,6 @@ private class LocalScrollingInfo : IScrollingInfo MaxValue = 10000, }; - public IScrollAlgorithm Algorithm { get; } = new SequentialScrollAlgorithm(new List()); + public IBindable Algorithm { get; } = new Bindable(new SequentialScrollAlgorithm(new List())); } } diff --git a/osu.Game.Rulesets.Karaoke/Screens/Settings/Previews/Gameplay/NotePlayfieldPreview.cs b/osu.Game.Rulesets.Karaoke/Screens/Settings/Previews/Gameplay/NotePlayfieldPreview.cs index 712c2f6fd..70ded605c 100644 --- a/osu.Game.Rulesets.Karaoke/Screens/Settings/Previews/Gameplay/NotePlayfieldPreview.cs +++ b/osu.Game.Rulesets.Karaoke/Screens/Settings/Previews/Gameplay/NotePlayfieldPreview.cs @@ -112,7 +112,7 @@ private class LocalScrollingInfo : IScrollingInfo public IBindable TimeRange { get; } = new BindableDouble(1500); - public IScrollAlgorithm Algorithm { get; } = new SequentialScrollAlgorithm(new SortedList(Comparer.Default)); + public IBindable Algorithm { get; } = new Bindable(new SequentialScrollAlgorithm(new SortedList(Comparer.Default))); } private class PreviewNotePositionInfo : INotePositionInfo diff --git a/osu.Game.Rulesets.Karaoke/Screens/Skin/Style/NoteStylePreview.cs b/osu.Game.Rulesets.Karaoke/Screens/Skin/Style/NoteStylePreview.cs index fe3d1d1a8..6778361b2 100644 --- a/osu.Game.Rulesets.Karaoke/Screens/Skin/Style/NoteStylePreview.cs +++ b/osu.Game.Rulesets.Karaoke/Screens/Skin/Style/NoteStylePreview.cs @@ -72,7 +72,7 @@ public class PreviewScrollingInfo : IScrollingInfo public IBindable TimeRange { get; } = new BindableDouble(); - public IScrollAlgorithm Algorithm { get; } = new ZeroScrollAlgorithm(); + public IBindable Algorithm { get; } = new Bindable(new ZeroScrollAlgorithm()); private class ZeroScrollAlgorithm : IScrollAlgorithm { diff --git a/osu.Game.Rulesets.Karaoke/UI/Components/VoiceVisualization.cs b/osu.Game.Rulesets.Karaoke/UI/Components/VoiceVisualization.cs index ce8a6defb..3b1e8001d 100644 --- a/osu.Game.Rulesets.Karaoke/UI/Components/VoiceVisualization.cs +++ b/osu.Game.Rulesets.Karaoke/UI/Components/VoiceVisualization.cs @@ -94,7 +94,7 @@ protected override void Update() if (!initialStateCache.IsValid) { // Reset scroll info - scrollingInfo.Algorithm.Reset(); + scrollingInfo.Algorithm.Value.Reset(); foreach (var cached in pathInitialStateCache.Values) cached.Invalidate(); @@ -132,8 +132,8 @@ private void computeLifetime(ScoringPath path) _ => 0.0f, }; - path.LifetimeStart = scrollingInfo.Algorithm.GetDisplayStartTime(startTime, originAdjustment, timeRange.Value, scrollLength); - path.LifetimeEnd = scrollingInfo.Algorithm.TimeAt(scrollLength * safe_lifetime_end_multiplier, endTime, timeRange.Value, scrollLength); + path.LifetimeStart = scrollingInfo.Algorithm.Value.GetDisplayStartTime(startTime, originAdjustment, timeRange.Value, scrollLength); + path.LifetimeEnd = scrollingInfo.Algorithm.Value.TimeAt(scrollLength * safe_lifetime_end_multiplier, endTime, timeRange.Value, scrollLength); } // Cant use AddOnce() since the delegate is re-constructed every invocation @@ -161,7 +161,7 @@ private void computePath(ScoringPath path) => path.Schedule(() => foreach (var frame in frameList) { - float x = scrollingInfo.Algorithm.GetLength(startTime, GetTime(frame), timeRange.Value, scrollLength); + float x = scrollingInfo.Algorithm.Value.GetLength(startTime, GetTime(frame), timeRange.Value, scrollLength); path.AddVertex(new Vector2(left ? x : -x, GetPosition(frame))); } }); @@ -194,7 +194,7 @@ private void updatePosition(ScoringPath path, double currentTime) double startTime = GetTime(firstFrameInPath); int multiple = direction.Value == ScrollingDirection.Left ? 1 : -1; - float x = scrollingInfo.Algorithm.PositionAt(startTime, currentTime, timeRange.Value, scrollLength); + float x = scrollingInfo.Algorithm.Value.PositionAt(startTime, currentTime, timeRange.Value, scrollLength); path.X = (x + Offset) * multiple; } diff --git a/osu.Game.Rulesets.Karaoke/osu.Game.Rulesets.Karaoke.csproj b/osu.Game.Rulesets.Karaoke/osu.Game.Rulesets.Karaoke.csproj index bc4d33174..fd373405f 100644 --- a/osu.Game.Rulesets.Karaoke/osu.Game.Rulesets.Karaoke.csproj +++ b/osu.Game.Rulesets.Karaoke/osu.Game.Rulesets.Karaoke.csproj @@ -18,7 +18,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + From ca72928f0724e21c36501d1e3af3bbbe1572d008 Mon Sep 17 00:00:00 2001 From: andy840119 Date: Sun, 24 Sep 2023 13:34:57 +0800 Subject: [PATCH 2/2] Upgrade octokit to the latest. --- osu.Game.Rulesets.Karaoke/osu.Game.Rulesets.Karaoke.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Karaoke/osu.Game.Rulesets.Karaoke.csproj b/osu.Game.Rulesets.Karaoke/osu.Game.Rulesets.Karaoke.csproj index fd373405f..9e9644b7f 100644 --- a/osu.Game.Rulesets.Karaoke/osu.Game.Rulesets.Karaoke.csproj +++ b/osu.Game.Rulesets.Karaoke/osu.Game.Rulesets.Karaoke.csproj @@ -11,7 +11,7 @@ - +