From ab487b80d5f7385ee5460e2f0b97bcaad18990ff Mon Sep 17 00:00:00 2001 From: andy840119 Date: Sat, 29 Apr 2023 22:02:11 +0800 Subject: [PATCH 1/3] Apply NRT in the karaoke ruleset. --- .../Configuration/KaraokeRulesetConfigManager.cs | 2 +- osu.Game.Rulesets.Karaoke/KaraokeRuleset.cs | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/osu.Game.Rulesets.Karaoke/Configuration/KaraokeRulesetConfigManager.cs b/osu.Game.Rulesets.Karaoke/Configuration/KaraokeRulesetConfigManager.cs index 0c458aee9..a0a10de65 100644 --- a/osu.Game.Rulesets.Karaoke/Configuration/KaraokeRulesetConfigManager.cs +++ b/osu.Game.Rulesets.Karaoke/Configuration/KaraokeRulesetConfigManager.cs @@ -16,7 +16,7 @@ namespace osu.Game.Rulesets.Karaoke.Configuration { public class KaraokeRulesetConfigManager : RulesetConfigManager { - public KaraokeRulesetConfigManager(SettingsStore settings, RulesetInfo ruleset, int? variant = null) + public KaraokeRulesetConfigManager(SettingsStore? settings, RulesetInfo ruleset, int? variant = null) : base(settings, ruleset, variant) { } diff --git a/osu.Game.Rulesets.Karaoke/KaraokeRuleset.cs b/osu.Game.Rulesets.Karaoke/KaraokeRuleset.cs index 42a7d1c52..cc8f2739a 100644 --- a/osu.Game.Rulesets.Karaoke/KaraokeRuleset.cs +++ b/osu.Game.Rulesets.Karaoke/KaraokeRuleset.cs @@ -1,8 +1,6 @@ // Copyright (c) andy840119 . Licensed under the GPL Licence. // See the LICENCE file in the repository root for full licence text. -#nullable disable - using System; using System.Collections.Generic; using osu.Framework.Allocation; @@ -51,7 +49,7 @@ namespace osu.Game.Rulesets.Karaoke [ExcludeFromDynamicCompile] public partial class KaraokeRuleset : Ruleset { - public override DrawableRuleset CreateDrawableRulesetWith(IBeatmap beatmap, IReadOnlyList mods = null) => new DrawableKaraokeRuleset(this, beatmap, mods); + public override DrawableRuleset CreateDrawableRulesetWith(IBeatmap beatmap, IReadOnlyList? mods = null) => new DrawableKaraokeRuleset(this, beatmap, mods); public override ScoreProcessor CreateScoreProcessor() => new KaraokeScoreProcessor(); public override IBeatmapConverter CreateBeatmapConverter(IBeatmap beatmap) => new KaraokeBeatmapConverter(beatmap, this); public override IBeatmapProcessor CreateBeatmapProcessor(IBeatmap beatmap) => new KaraokeBeatmapProcessor(beatmap); @@ -200,7 +198,7 @@ public override IResourceStore CreateResourceStore() public override string PlayingVerb => "Singing karaoke"; - public override ISkin CreateSkinTransformer(ISkin skin, IBeatmap beatmap) + public override ISkin? CreateSkinTransformer(ISkin skin, IBeatmap beatmap) { return skin switch { @@ -214,7 +212,7 @@ public override ISkin CreateSkinTransformer(ISkin skin, IBeatmap beatmap) public override IConvertibleReplayFrame CreateConvertibleReplayFrame() => new KaraokeReplayFrame(); - public override IRulesetConfigManager CreateConfig(SettingsStore settings) => new KaraokeRulesetConfigManager(settings, RulesetInfo); + public override IRulesetConfigManager CreateConfig(SettingsStore? settings) => new KaraokeRulesetConfigManager(settings, RulesetInfo); public override RulesetSettingsSubsection CreateSettings() => new KaraokeSettingsSubsection(this); From 77a5b4d08e6531c953c9fb9208ff3bb7fb1c09c7 Mon Sep 17 00:00:00 2001 From: andy840119 Date: Sat, 29 Apr 2023 22:02:32 +0800 Subject: [PATCH 2/3] Remove the method. --- .../Beatmaps/Stages/Preview/PreviewLyricLayoutCategory.cs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/osu.Game.Rulesets.Karaoke/Beatmaps/Stages/Preview/PreviewLyricLayoutCategory.cs b/osu.Game.Rulesets.Karaoke/Beatmaps/Stages/Preview/PreviewLyricLayoutCategory.cs index 88644cd9c..61caa772d 100644 --- a/osu.Game.Rulesets.Karaoke/Beatmaps/Stages/Preview/PreviewLyricLayoutCategory.cs +++ b/osu.Game.Rulesets.Karaoke/Beatmaps/Stages/Preview/PreviewLyricLayoutCategory.cs @@ -8,9 +8,4 @@ namespace osu.Game.Rulesets.Karaoke.Beatmaps.Stages.Preview; public class PreviewLyricLayoutCategory : StageElementCategory { protected override PreviewLyricLayout CreateElement(int id) => new(id); - - public void ReCalculate() - { - // todo: do something. - } } From c8384a5832cc845398d06bd67b4025d497be375e Mon Sep 17 00:00:00 2001 From: andy840119 Date: Sat, 29 Apr 2023 22:09:58 +0800 Subject: [PATCH 3/3] Custom ruleset should handle every skin because we should get the config in the skin transformer. --- osu.Game.Rulesets.Karaoke/KaraokeRuleset.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game.Rulesets.Karaoke/KaraokeRuleset.cs b/osu.Game.Rulesets.Karaoke/KaraokeRuleset.cs index cc8f2739a..bb5e0d0aa 100644 --- a/osu.Game.Rulesets.Karaoke/KaraokeRuleset.cs +++ b/osu.Game.Rulesets.Karaoke/KaraokeRuleset.cs @@ -198,7 +198,7 @@ public override IResourceStore CreateResourceStore() public override string PlayingVerb => "Singing karaoke"; - public override ISkin? CreateSkinTransformer(ISkin skin, IBeatmap beatmap) + public override ISkin CreateSkinTransformer(ISkin skin, IBeatmap beatmap) { return skin switch { @@ -206,7 +206,7 @@ public override IResourceStore CreateResourceStore() ArgonSkin => new KaraokeArgonSkinTransformer(skin, beatmap), DefaultLegacySkin => new KaraokeClassicSkinTransformer(skin, beatmap), LegacySkin => new KaraokeLegacySkinTransformer(skin, beatmap), - _ => null + _ => throw new InvalidOperationException(), }; }