From f4b552cc84a135b122dfa52bb60e687cfa9c0fb9 Mon Sep 17 00:00:00 2001 From: andy840119 Date: Mon, 23 May 2022 19:13:04 +0800 Subject: [PATCH 1/3] Update osu.game to the latest and fix api broken. Damn lots of test error. --- .../Edit/KaraokeHitObjectComposer.cs | 4 ++-- .../Lyrics/Rows/Extends/TimeTags/TimeTagEditor.cs | 2 +- .../RearrangeableTextFlowListContainer.cs | 5 +++-- .../Graphics/UserInterfaceV2/LanguageSelector.cs | 11 ++++++----- .../osu.Game.Rulesets.Karaoke.csproj | 2 +- 5 files changed, 13 insertions(+), 11 deletions(-) diff --git a/osu.Game.Rulesets.Karaoke/Edit/KaraokeHitObjectComposer.cs b/osu.Game.Rulesets.Karaoke/Edit/KaraokeHitObjectComposer.cs index 038da1191..b215c5e15 100644 --- a/osu.Game.Rulesets.Karaoke/Edit/KaraokeHitObjectComposer.cs +++ b/osu.Game.Rulesets.Karaoke/Edit/KaraokeHitObjectComposer.cs @@ -111,9 +111,9 @@ protected override Playfield PlayfieldAtScreenSpacePosition(Vector2 screenSpaceP return null; } - public override SnapResult FindSnappedPositionAndTime(Vector2 screenSpacePosition) + public override SnapResult FindSnappedPositionAndTime(Vector2 screenSpacePosition, SnapType snapType = SnapType.All) { - var result = base.FindSnappedPositionAndTime(screenSpacePosition); + var result = base.FindSnappedPositionAndTime(screenSpacePosition, snapType); // should not affect x position and time if dragging object in note playfield. return result.Playfield is EditorNotePlayfield diff --git a/osu.Game.Rulesets.Karaoke/Edit/Lyrics/Rows/Extends/TimeTags/TimeTagEditor.cs b/osu.Game.Rulesets.Karaoke/Edit/Lyrics/Rows/Extends/TimeTags/TimeTagEditor.cs index 58af55221..5265c4bcf 100644 --- a/osu.Game.Rulesets.Karaoke/Edit/Lyrics/Rows/Extends/TimeTags/TimeTagEditor.cs +++ b/osu.Game.Rulesets.Karaoke/Edit/Lyrics/Rows/Extends/TimeTags/TimeTagEditor.cs @@ -100,7 +100,7 @@ protected override void OnUserScroll(float value, bool animated = true, double? public SnapResult FindSnappedPosition(Vector2 screenSpacePosition) => new(screenSpacePosition, null); - public SnapResult FindSnappedPositionAndTime(Vector2 screenSpacePosition) => + public SnapResult FindSnappedPositionAndTime(Vector2 screenSpacePosition, SnapType snapType = SnapType.All) => new(screenSpacePosition, getTimeFromPosition(Content.ToLocalSpace(screenSpacePosition))); private double getTimeFromPosition(Vector2 localPosition) => diff --git a/osu.Game.Rulesets.Karaoke/Graphics/UserInterface/RearrangeableTextFlowListContainer.cs b/osu.Game.Rulesets.Karaoke/Graphics/UserInterface/RearrangeableTextFlowListContainer.cs index a271417b8..a72627a6c 100644 --- a/osu.Game.Rulesets.Karaoke/Graphics/UserInterface/RearrangeableTextFlowListContainer.cs +++ b/osu.Game.Rulesets.Karaoke/Graphics/UserInterface/RearrangeableTextFlowListContainer.cs @@ -8,6 +8,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Input.Events; +using osu.Framework.Localisation; using osu.Game.Graphics; using osu.Game.Graphics.Containers; using osuTK; @@ -99,9 +100,9 @@ protected override bool OnClick(ClickEvent e) return true; } - public virtual IEnumerable FilterTerms => new[] + public virtual IEnumerable FilterTerms => new[] { - Model.ToString() + new LocalisableString(Model.ToString()) }; protected virtual void CreateDisplayContent(OsuTextFlowContainer textFlowContainer, TModel model) diff --git a/osu.Game.Rulesets.Karaoke/Graphics/UserInterfaceV2/LanguageSelector.cs b/osu.Game.Rulesets.Karaoke/Graphics/UserInterfaceV2/LanguageSelector.cs index 095e66df4..4ed6c38dc 100644 --- a/osu.Game.Rulesets.Karaoke/Graphics/UserInterfaceV2/LanguageSelector.cs +++ b/osu.Game.Rulesets.Karaoke/Graphics/UserInterfaceV2/LanguageSelector.cs @@ -6,6 +6,7 @@ using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using osu.Framework.Localisation; using osu.Game.Graphics.Containers; using osu.Game.Graphics.UserInterface; using osu.Game.Rulesets.Karaoke.Graphics.UserInterface; @@ -89,12 +90,12 @@ public DrawableLanguageListItem(CultureInfo item) Padding = new MarginPadding { Left = 5 }; } - public override IEnumerable FilterTerms => new[] + public override IEnumerable FilterTerms => new[] { - Model.Name, - Model.DisplayName, - Model.EnglishName, - Model.NativeName + new LocalisableString(Model.Name), + new LocalisableString(Model.DisplayName), + new LocalisableString(Model.EnglishName), + new LocalisableString(Model.NativeName) }; protected override void CreateDisplayContent(OsuTextFlowContainer textFlowContainer, CultureInfo model) diff --git a/osu.Game.Rulesets.Karaoke/osu.Game.Rulesets.Karaoke.csproj b/osu.Game.Rulesets.Karaoke/osu.Game.Rulesets.Karaoke.csproj index 66b7aa5a2..0063d9cbb 100644 --- a/osu.Game.Rulesets.Karaoke/osu.Game.Rulesets.Karaoke.csproj +++ b/osu.Game.Rulesets.Karaoke/osu.Game.Rulesets.Karaoke.csproj @@ -12,7 +12,7 @@ - + From 4f75e81d913cd903085d3787243e7090b46b1db0 Mon Sep 17 00:00:00 2001 From: andy840119 Date: Mon, 23 May 2022 19:17:33 +0800 Subject: [PATCH 2/3] update font and microphone package to the latest and fix the api change. All tests pass now. --- .../Edit/Lyrics/Rows/Components/EditorKaraokeSpriteText.cs | 6 +++--- osu.Game.Rulesets.Karaoke/osu.Game.Rulesets.Karaoke.csproj | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/osu.Game.Rulesets.Karaoke/Edit/Lyrics/Rows/Components/EditorKaraokeSpriteText.cs b/osu.Game.Rulesets.Karaoke/Edit/Lyrics/Rows/Components/EditorKaraokeSpriteText.cs index 363b76882..5be78d88b 100644 --- a/osu.Game.Rulesets.Karaoke/Edit/Lyrics/Rows/Components/EditorKaraokeSpriteText.cs +++ b/osu.Game.Rulesets.Karaoke/Edit/Lyrics/Rows/Components/EditorKaraokeSpriteText.cs @@ -164,14 +164,14 @@ static FontUsage getFont(float? charSize = null) public class EditorLyricSpriteText : LyricSpriteText { public RectangleF GetRubyTagPosition(RubyTag rubyTag) - => GetRubyTagPosition(TextTagUtils.ToPositionText(rubyTag)); + => GetRubyTagDrawRectangle(TextTagUtils.ToPositionText(rubyTag)); public RectangleF GetRomajiTagPosition(RomajiTag romajiTag) - => GetRomajiTagPosition(TextTagUtils.ToPositionText(romajiTag)); + => GetRomajiTagDrawRectangle(TextTagUtils.ToPositionText(romajiTag)); public Vector2 GetTimeTagPosition(TextIndex index) { - var drawRectangle = GetCharacterRectangle(index.Index); + var drawRectangle = GetCharacterDrawRectangle(index.Index); return TextIndexUtils.GetValueByState(index, drawRectangle.BottomLeft, drawRectangle.BottomRight); } } diff --git a/osu.Game.Rulesets.Karaoke/osu.Game.Rulesets.Karaoke.csproj b/osu.Game.Rulesets.Karaoke/osu.Game.Rulesets.Karaoke.csproj index 0063d9cbb..20a659f71 100644 --- a/osu.Game.Rulesets.Karaoke/osu.Game.Rulesets.Karaoke.csproj +++ b/osu.Game.Rulesets.Karaoke/osu.Game.Rulesets.Karaoke.csproj @@ -10,8 +10,8 @@ - - + + From 3c11483f6e7d58d824bf0d3413075b5a15955e28 Mon Sep 17 00:00:00 2001 From: andy840119 Date: Mon, 23 May 2022 19:18:31 +0800 Subject: [PATCH 3/3] update package in the test project to the latest. --- .../osu.Game.Rulesets.Karaoke.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Karaoke.Tests/osu.Game.Rulesets.Karaoke.Tests.csproj b/osu.Game.Rulesets.Karaoke.Tests/osu.Game.Rulesets.Karaoke.Tests.csproj index 3cfc24bc7..d41a893b2 100644 --- a/osu.Game.Rulesets.Karaoke.Tests/osu.Game.Rulesets.Karaoke.Tests.csproj +++ b/osu.Game.Rulesets.Karaoke.Tests/osu.Game.Rulesets.Karaoke.Tests.csproj @@ -13,7 +13,7 @@ - +