diff --git a/osu.Game.Rulesets.Karaoke/Beatmaps/Formats/KaraokeLegacyBeatmapDecoder.cs b/osu.Game.Rulesets.Karaoke/Beatmaps/Formats/KaraokeLegacyBeatmapDecoder.cs index caf28113e..98076d0ac 100644 --- a/osu.Game.Rulesets.Karaoke/Beatmaps/Formats/KaraokeLegacyBeatmapDecoder.cs +++ b/osu.Game.Rulesets.Karaoke/Beatmaps/Formats/KaraokeLegacyBeatmapDecoder.cs @@ -39,6 +39,13 @@ protected override void ParseLine(Beatmap beatmap, Section section, string line) { if (section != Section.HitObjects) { + // should not let base.ParseLine read the line like "Mode: 111" + if (line.StartsWith("Mode", StringComparison.Ordinal)) + { + beatmap.BeatmapInfo.Ruleset = new KaraokeRuleset().RulesetInfo; + return; + } + base.ParseLine(beatmap, section, line); return; } diff --git a/osu.Game.Rulesets.Karaoke/Edit/Components/Containers/EditorScrollContainer.cs b/osu.Game.Rulesets.Karaoke/Edit/Components/Containers/EditorScrollContainer.cs index 8704ea7a5..e19a46cb5 100644 --- a/osu.Game.Rulesets.Karaoke/Edit/Components/Containers/EditorScrollContainer.cs +++ b/osu.Game.Rulesets.Karaoke/Edit/Components/Containers/EditorScrollContainer.cs @@ -3,6 +3,7 @@ #nullable disable +using System; using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Framework.Input.Events; @@ -27,7 +28,10 @@ protected EditorScrollContainer() void assignZoomRange(float _) { // we should make sure that will not cause error while assigning the size. - SetupZoom(BindableZoom.Value, BindableZoom.MinValue, BindableZoom.MaxValue); + float initial = Math.Clamp(BindableZoom.Value, BindableZoom.MinValue, BindableZoom.MaxValue); + float minimum = BindableZoom.MinValue; + float maximum = BindableZoom.MaxValue; + SetupZoom(initial, minimum, maximum); } BindableZoom.BindValueChanged(e => diff --git a/osu.Game.Rulesets.Karaoke/KaraokeRuleset.cs b/osu.Game.Rulesets.Karaoke/KaraokeRuleset.cs index ef4415da0..41b3b6e1e 100644 --- a/osu.Game.Rulesets.Karaoke/KaraokeRuleset.cs +++ b/osu.Game.Rulesets.Karaoke/KaraokeRuleset.cs @@ -191,7 +191,11 @@ public override IResourceStore CreateResourceStore() public override string PlayingVerb => "Singing karaoke"; - public override ISkin CreateLegacySkinProvider(ISkin skin, IBeatmap beatmap) => new KaraokeLegacySkinTransformer(skin, beatmap); + public override ISkin CreateSkinTransformer(ISkin skin, IBeatmap beatmap) + { + // always return the legacy skin for now until have skin for karaoke. + return new KaraokeLegacySkinTransformer(skin, beatmap); + } public override IConvertibleReplayFrame CreateConvertibleReplayFrame() => new KaraokeReplayFrame(); diff --git a/osu.Game.Rulesets.Karaoke/Skinning/KaraokeBeatmapSkin.cs b/osu.Game.Rulesets.Karaoke/Skinning/KaraokeBeatmapSkin.cs index 4f10506cc..5b25b0279 100644 --- a/osu.Game.Rulesets.Karaoke/Skinning/KaraokeBeatmapSkin.cs +++ b/osu.Game.Rulesets.Karaoke/Skinning/KaraokeBeatmapSkin.cs @@ -7,6 +7,7 @@ using System.Linq; using Newtonsoft.Json; using osu.Framework.Bindables; +using osu.Framework.IO.Serialization; using osu.Framework.IO.Stores; using osu.Framework.Logging; using osu.Game.IO; @@ -33,7 +34,7 @@ public KaraokeBeatmapSkin(SkinInfo skin, IStorageResourceProvider? resources, IR { SkinInfo.PerformRead(s => { - var globalSetting = CreateJsonSerializerSettings(new KaraokeSkinElementConvertor()); + var globalSetting = CreateJsonSerializerSettings(new KaraokeSkinElementConvertor(), new ShaderConvertor(), new Vector2Converter(), new ColourConvertor()); // we may want to move this to some kind of async operation in the future. foreach (ElementType skinnableTarget in Enum.GetValues(typeof(ElementType))) diff --git a/osu.Game.Rulesets.Karaoke/Skinning/KaraokeSkin.cs b/osu.Game.Rulesets.Karaoke/Skinning/KaraokeSkin.cs index ad831af58..536a90cfe 100644 --- a/osu.Game.Rulesets.Karaoke/Skinning/KaraokeSkin.cs +++ b/osu.Game.Rulesets.Karaoke/Skinning/KaraokeSkin.cs @@ -10,6 +10,7 @@ using osu.Framework.Audio.Sample; using osu.Framework.Bindables; using osu.Framework.Graphics.Textures; +using osu.Framework.IO.Serialization; using osu.Framework.IO.Stores; using osu.Framework.Logging; using osu.Game.Audio; @@ -58,7 +59,7 @@ public KaraokeSkin(SkinInfo skin, IStorageResourceProvider? resources, IResource if (string.IsNullOrEmpty(jsonContent)) return; - var globalSetting = CreateJsonSerializerSettings(new KaraokeSkinElementConvertor()); + var globalSetting = CreateJsonSerializerSettings(new KaraokeSkinElementConvertor(), new ShaderConvertor(), new Vector2Converter(), new ColourConvertor()); var deserializedContent = JsonConvert.DeserializeObject(jsonContent, globalSetting); if (deserializedContent == null) diff --git a/osu.Game.Rulesets.Karaoke/osu.Game.Rulesets.Karaoke.csproj b/osu.Game.Rulesets.Karaoke/osu.Game.Rulesets.Karaoke.csproj index 726d253e1..8e7119ed6 100644 --- a/osu.Game.Rulesets.Karaoke/osu.Game.Rulesets.Karaoke.csproj +++ b/osu.Game.Rulesets.Karaoke/osu.Game.Rulesets.Karaoke.csproj @@ -11,14 +11,14 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - +