From 5166c02e1b208461c19538dfe734c098e71305d7 Mon Sep 17 00:00:00 2001 From: andy840119 Date: Sun, 8 Dec 2024 20:42:23 +0800 Subject: [PATCH 1/4] Upgrade osu.game 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 c700a5e47..78b50b179 100644 --- a/osu.Game.Rulesets.Karaoke/osu.Game.Rulesets.Karaoke.csproj +++ b/osu.Game.Rulesets.Karaoke/osu.Game.Rulesets.Karaoke.csproj @@ -17,7 +17,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + From cbcd71e8a1aaf705f8f3ec83b6806b0fedc706bc Mon Sep 17 00:00:00 2001 From: andy840119 Date: Sun, 8 Dec 2024 20:42:43 +0800 Subject: [PATCH 2/4] Fix API breaking change. See: https://github.com/ppy/osu/pull/30863/files --- osu.Game.Rulesets.Karaoke/Screens/Edit/GenericEditor.cs | 2 +- .../Screens/Edit/Import/Lyrics/LyricImporter.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game.Rulesets.Karaoke/Screens/Edit/GenericEditor.cs b/osu.Game.Rulesets.Karaoke/Screens/Edit/GenericEditor.cs index 654f9b531..26bfc344c 100644 --- a/osu.Game.Rulesets.Karaoke/Screens/Edit/GenericEditor.cs +++ b/osu.Game.Rulesets.Karaoke/Screens/Edit/GenericEditor.cs @@ -27,7 +27,7 @@ public abstract partial class GenericEditor : ScreenWithBeatmapBack { public override float BackgroundParallaxAmount => 0.1f; - public override bool AllowBackButton => false; + public override bool AllowUserExit => false; public override bool HideOverlaysOnEnter => true; diff --git a/osu.Game.Rulesets.Karaoke/Screens/Edit/Import/Lyrics/LyricImporter.cs b/osu.Game.Rulesets.Karaoke/Screens/Edit/Import/Lyrics/LyricImporter.cs index 3055aa59a..503c35117 100644 --- a/osu.Game.Rulesets.Karaoke/Screens/Edit/Import/Lyrics/LyricImporter.cs +++ b/osu.Game.Rulesets.Karaoke/Screens/Edit/Import/Lyrics/LyricImporter.cs @@ -12,7 +12,7 @@ public partial class LyricImporter : ScreenWithBeatmapBackground { private readonly ImportLyricOverlay importLyricOverlay; - public override bool AllowBackButton => false; + public override bool AllowUserExit => false; public override bool HideOverlaysOnEnter => true; From 2a45783831fc501a9db626f8461ff5e24545e2f2 Mon Sep 17 00:00:00 2001 From: andy840119 Date: Sun, 8 Dec 2024 20:46:14 +0800 Subject: [PATCH 3/4] Fix the interface change in the mod test. see: https://github.com/ppy/osu/pull/30819/files --- .../Mods/KaraokeModStageTestScene.cs | 4 ++-- .../Mods/TestSceneKaraokeModAutoplay.cs | 2 +- .../Mods/TestSceneKaraokeModAutoplayBySinger.cs | 2 +- .../Mods/TestSceneKaraokeModDisableNote.cs | 2 +- .../Mods/TestSceneKaraokeModFlashlight.cs | 2 +- .../Mods/TestSceneKaraokeModFun.cs | 4 ++-- .../Mods/TestSceneKaraokeModLyricConfiguration.cs | 2 +- .../Mods/TestSceneKaraokeModPractice.cs | 2 +- .../Mods/TestSceneKaraokeModSuddenDeath.cs | 4 ++-- .../Mods/TestSceneKaraokeModTranslation.cs | 2 +- 10 files changed, 13 insertions(+), 13 deletions(-) diff --git a/osu.Game.Rulesets.Karaoke.Tests/Mods/KaraokeModStageTestScene.cs b/osu.Game.Rulesets.Karaoke.Tests/Mods/KaraokeModStageTestScene.cs index b6996ea07..fa3537807 100644 --- a/osu.Game.Rulesets.Karaoke.Tests/Mods/KaraokeModStageTestScene.cs +++ b/osu.Game.Rulesets.Karaoke.Tests/Mods/KaraokeModStageTestScene.cs @@ -21,7 +21,7 @@ public void TestCreateModWithStage() CreateModTest(new ModTestData { Mod = new TModStage(), - Beatmap = new TestKaraokeBeatmap(Ruleset.Value), + CreateBeatmap = () => new TestKaraokeBeatmap(Ruleset.Value), PassCondition = () => true, }); } @@ -33,7 +33,7 @@ public void TestCreateModWithoutStage() { Mod = new TModStage(), // todo: add the stage info to beatmap. - Beatmap = new TestKaraokeBeatmap(Ruleset.Value), + CreateBeatmap = () => new TestKaraokeBeatmap(Ruleset.Value), PassCondition = () => true, }); } diff --git a/osu.Game.Rulesets.Karaoke.Tests/Mods/TestSceneKaraokeModAutoplay.cs b/osu.Game.Rulesets.Karaoke.Tests/Mods/TestSceneKaraokeModAutoplay.cs index a689278fc..9b5c86eda 100644 --- a/osu.Game.Rulesets.Karaoke.Tests/Mods/TestSceneKaraokeModAutoplay.cs +++ b/osu.Game.Rulesets.Karaoke.Tests/Mods/TestSceneKaraokeModAutoplay.cs @@ -14,7 +14,7 @@ public void TestMod() => CreateModTest(new ModTestData { Mod = new KaraokeModAutoplay(), Autoplay = true, - Beatmap = new TestKaraokeBeatmap(Ruleset.Value), + CreateBeatmap = () => new TestKaraokeBeatmap(Ruleset.Value), PassCondition = () => true, }); } diff --git a/osu.Game.Rulesets.Karaoke.Tests/Mods/TestSceneKaraokeModAutoplayBySinger.cs b/osu.Game.Rulesets.Karaoke.Tests/Mods/TestSceneKaraokeModAutoplayBySinger.cs index a472141c6..29fda4fd4 100644 --- a/osu.Game.Rulesets.Karaoke.Tests/Mods/TestSceneKaraokeModAutoplayBySinger.cs +++ b/osu.Game.Rulesets.Karaoke.Tests/Mods/TestSceneKaraokeModAutoplayBySinger.cs @@ -14,7 +14,7 @@ public void TestMod() => CreateModTest(new ModTestData { Mod = new KaraokeModAutoplayBySinger(), Autoplay = true, - Beatmap = new TestKaraokeBeatmap(Ruleset.Value), + CreateBeatmap = () => new TestKaraokeBeatmap(Ruleset.Value), PassCondition = () => true, }); } diff --git a/osu.Game.Rulesets.Karaoke.Tests/Mods/TestSceneKaraokeModDisableNote.cs b/osu.Game.Rulesets.Karaoke.Tests/Mods/TestSceneKaraokeModDisableNote.cs index 486effd40..deeb4bf41 100644 --- a/osu.Game.Rulesets.Karaoke.Tests/Mods/TestSceneKaraokeModDisableNote.cs +++ b/osu.Game.Rulesets.Karaoke.Tests/Mods/TestSceneKaraokeModDisableNote.cs @@ -16,7 +16,7 @@ public void TestCheckNoteExistInPlayfield() => CreateModTest(new ModTestData { Mod = new KaraokeModDisableNote(), Autoplay = true, - Beatmap = new TestKaraokeBeatmap(Ruleset.Value), + CreateBeatmap = () => new TestKaraokeBeatmap(Ruleset.Value), PassCondition = () => { var lyricPlayfield = Player.GetLyricPlayfield(); diff --git a/osu.Game.Rulesets.Karaoke.Tests/Mods/TestSceneKaraokeModFlashlight.cs b/osu.Game.Rulesets.Karaoke.Tests/Mods/TestSceneKaraokeModFlashlight.cs index 1c370f989..e268769d8 100644 --- a/osu.Game.Rulesets.Karaoke.Tests/Mods/TestSceneKaraokeModFlashlight.cs +++ b/osu.Game.Rulesets.Karaoke.Tests/Mods/TestSceneKaraokeModFlashlight.cs @@ -17,7 +17,7 @@ public void TestFlashlightExist() => CreateModTest(new ModTestData { Mod = new KaraokeModFlashlight(), Autoplay = true, - Beatmap = new TestKaraokeBeatmap(Ruleset.Value), + CreateBeatmap = () => new TestKaraokeBeatmap(Ruleset.Value), PassCondition = () => { var drawableRuleset = Player.GetDrawableRuleset(); diff --git a/osu.Game.Rulesets.Karaoke.Tests/Mods/TestSceneKaraokeModFun.cs b/osu.Game.Rulesets.Karaoke.Tests/Mods/TestSceneKaraokeModFun.cs index 3a6d4f459..250bd60b7 100644 --- a/osu.Game.Rulesets.Karaoke.Tests/Mods/TestSceneKaraokeModFun.cs +++ b/osu.Game.Rulesets.Karaoke.Tests/Mods/TestSceneKaraokeModFun.cs @@ -14,7 +14,7 @@ public void TestSnowMod() => CreateModTest(new ModTestData { Mod = new KaraokeModSnow(), Autoplay = false, - Beatmap = new TestKaraokeBeatmap(Ruleset.Value), + CreateBeatmap = () => new TestKaraokeBeatmap(Ruleset.Value), PassCondition = () => true, }); @@ -23,7 +23,7 @@ public void TestWindowsUpdateMod() => CreateModTest(new ModTestData { Mod = new KaraokeModWindowsUpdate(), Autoplay = false, - Beatmap = new TestKaraokeBeatmap(Ruleset.Value), + CreateBeatmap = () => new TestKaraokeBeatmap(Ruleset.Value), PassCondition = () => true, }); } diff --git a/osu.Game.Rulesets.Karaoke.Tests/Mods/TestSceneKaraokeModLyricConfiguration.cs b/osu.Game.Rulesets.Karaoke.Tests/Mods/TestSceneKaraokeModLyricConfiguration.cs index 0ec0868aa..b5baf23f8 100644 --- a/osu.Game.Rulesets.Karaoke.Tests/Mods/TestSceneKaraokeModLyricConfiguration.cs +++ b/osu.Game.Rulesets.Karaoke.Tests/Mods/TestSceneKaraokeModLyricConfiguration.cs @@ -14,7 +14,7 @@ public void TestAllPanelExist() => CreateModTest(new ModTestData { Mod = new KaraokeModLyricConfiguration(), Autoplay = false, - Beatmap = new TestKaraokeBeatmap(new RulesetInfo()), + CreateBeatmap = () => new TestKaraokeBeatmap(new RulesetInfo()), PassCondition = () => true, }); } diff --git a/osu.Game.Rulesets.Karaoke.Tests/Mods/TestSceneKaraokeModPractice.cs b/osu.Game.Rulesets.Karaoke.Tests/Mods/TestSceneKaraokeModPractice.cs index cd12a718e..248d42dab 100644 --- a/osu.Game.Rulesets.Karaoke.Tests/Mods/TestSceneKaraokeModPractice.cs +++ b/osu.Game.Rulesets.Karaoke.Tests/Mods/TestSceneKaraokeModPractice.cs @@ -17,7 +17,7 @@ public void TestAllPanelExist() => CreateModTest(new ModTestData { Mod = new KaraokeModPractice(), Autoplay = false, - Beatmap = new TestKaraokeBeatmap(new RulesetInfo()), + CreateBeatmap = () => new TestKaraokeBeatmap(new RulesetInfo()), PassCondition = () => { // just need to check has setting button display area. diff --git a/osu.Game.Rulesets.Karaoke.Tests/Mods/TestSceneKaraokeModSuddenDeath.cs b/osu.Game.Rulesets.Karaoke.Tests/Mods/TestSceneKaraokeModSuddenDeath.cs index 00c478ef2..488a53bbb 100644 --- a/osu.Game.Rulesets.Karaoke.Tests/Mods/TestSceneKaraokeModSuddenDeath.cs +++ b/osu.Game.Rulesets.Karaoke.Tests/Mods/TestSceneKaraokeModSuddenDeath.cs @@ -32,7 +32,7 @@ public void TestGreatHit() => CreateModTest(new ModTestData Mod = new KaraokeModSuddenDeath(), PassCondition = () => ((ModFailConditionTestPlayer)Player).CheckFailed(false), Autoplay = false, - Beatmap = new Beatmap + CreateBeatmap = () => new Beatmap { HitObjects = new List { @@ -57,7 +57,7 @@ public void TestBreakOnHoldNote() => CreateModTest(new ModTestData Mod = new KaraokeModSuddenDeath(), PassCondition = () => ((ModFailConditionTestPlayer)Player).CheckFailed(true) && Player.Results.Count == 2, Autoplay = false, - Beatmap = new Beatmap + CreateBeatmap = () => new Beatmap { HitObjects = new List { diff --git a/osu.Game.Rulesets.Karaoke.Tests/Mods/TestSceneKaraokeModTranslation.cs b/osu.Game.Rulesets.Karaoke.Tests/Mods/TestSceneKaraokeModTranslation.cs index fe8c4579b..9ba91beec 100644 --- a/osu.Game.Rulesets.Karaoke.Tests/Mods/TestSceneKaraokeModTranslation.cs +++ b/osu.Game.Rulesets.Karaoke.Tests/Mods/TestSceneKaraokeModTranslation.cs @@ -14,7 +14,7 @@ public void TestAllPanelExist() => CreateModTest(new ModTestData { Mod = new KaraokeModTranslation(), Autoplay = false, - Beatmap = new TestKaraokeBeatmap(new RulesetInfo()), + CreateBeatmap = () => new TestKaraokeBeatmap(new RulesetInfo()), PassCondition = () => true, }); } From b165c408a3dd059fbd120fc8a71023798d098447 Mon Sep 17 00:00:00 2001 From: andy840119 Date: Sun, 8 Dec 2024 20:48:53 +0800 Subject: [PATCH 4/4] Fix the test broken in the previous PR. --- .../IO/Serialization/Converters/StageInfoConverterTest.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game.Rulesets.Karaoke.Tests/IO/Serialization/Converters/StageInfoConverterTest.cs b/osu.Game.Rulesets.Karaoke.Tests/IO/Serialization/Converters/StageInfoConverterTest.cs index b777a1358..4ca34b377 100644 --- a/osu.Game.Rulesets.Karaoke.Tests/IO/Serialization/Converters/StageInfoConverterTest.cs +++ b/osu.Game.Rulesets.Karaoke.Tests/IO/Serialization/Converters/StageInfoConverterTest.cs @@ -19,7 +19,7 @@ public void TestClassicStageInfoSerializer() var stageInfo = new ClassicStageInfo(); const string expected = - "{\"$type\":\"classic\",\"style_category\":{},\"stage_definition\":{\"border_width\":25.0,\"border_height\":25.0,\"fade_in_time\":150.0,\"fade_out_time\":150.0,\"fade_in_easing\":22,\"fade_out_easing\":22,\"lyric_scale\":2.0,\"line_height\":72.0,\"first_lyric_start_time_offset\":1000.0,\"lyric_end_time_offset\":300.0,\"last_lyric_end_time_offset\":10000.0},\"lyric_layout_category\":{},\"lyric_timing_info\":{\"timings\":[],\"mappings\":{}}}"; + "{\"$type\":\"classic\",\"stage_definition\":{\"border_width\":25.0,\"border_height\":25.0,\"fade_in_time\":150.0,\"fade_out_time\":150.0,\"fade_in_easing\":22,\"fade_out_easing\":22,\"lyric_scale\":2.0,\"line_height\":72.0,\"first_lyric_start_time_offset\":1000.0,\"lyric_end_time_offset\":300.0,\"last_lyric_end_time_offset\":10000.0},\"style_category\":{},\"lyric_layout_category\":{},\"lyric_timing_info\":{\"timings\":[],\"mappings\":{}}}"; string actual = JsonConvert.SerializeObject(stageInfo, CreateSettings()); Assert.AreEqual(expected, actual); } @@ -29,7 +29,7 @@ public void TestClassicStageInfoSerializer() public void TestClassicStageInfoDeserializer() { const string json = - "{\"$type\":\"classic\",\"style_category\":{},\"stage_definition\":{\"border_width\":25.0,\"border_height\":25.0,\"fade_in_time\":150.0,\"fade_out_time\":150.0,\"fade_in_easing\":22,\"fade_out_easing\":22,\"lyric_scale\":2.0,\"line_height\":72.0,\"first_lyric_start_time_offset\":1000.0,\"lyric_end_time_offset\":300.0,\"last_lyric_end_time_offset\":10000.0},\"lyric_layout_category\":{},\"lyric_timing_info\":{\"timings\":[],\"mappings\":{}}}"; + "{\"$type\":\"classic\",\"stage_definition\":{\"border_width\":25.0,\"border_height\":25.0,\"fade_in_time\":150.0,\"fade_out_time\":150.0,\"fade_in_easing\":22,\"fade_out_easing\":22,\"lyric_scale\":2.0,\"line_height\":72.0,\"first_lyric_start_time_offset\":1000.0,\"lyric_end_time_offset\":300.0,\"last_lyric_end_time_offset\":10000.0},\"style_category\":{},\"lyric_layout_category\":{},\"lyric_timing_info\":{\"timings\":[],\"mappings\":{}}}"; var expected = new ClassicStageInfo(); var actual = (ClassicStageInfo)JsonConvert.DeserializeObject(json, CreateSettings())!;