diff --git a/osu.Game.Rulesets.Karaoke.Tests/Screens/KaraokeSkinEditorScreenTestScene.cs b/osu.Game.Rulesets.Karaoke.Tests/Screens/KaraokeSkinEditorScreenTestScene.cs index 516501b7c..dd889a3de 100644 --- a/osu.Game.Rulesets.Karaoke.Tests/Screens/KaraokeSkinEditorScreenTestScene.cs +++ b/osu.Game.Rulesets.Karaoke.Tests/Screens/KaraokeSkinEditorScreenTestScene.cs @@ -5,6 +5,7 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using osu.Game.Database; using osu.Game.Overlays; using osu.Game.Rulesets.Karaoke.Screens.Skin; using osu.Game.Rulesets.Karaoke.Skinning; @@ -23,10 +24,7 @@ public abstract class KaraokeSkinEditorScreenTestScene : EditorClockTestScene [BackgroundDependencyLoader] private void load(SkinManager skinManager) { - // because skin is compared by id, so should change id to let skin manager info knows that skin has been changed. - var defaultSkin = DefaultKaraokeSkin.Default; - defaultSkin.ID = 100; - skinManager.CurrentSkinInfo.Value = defaultSkin; + skinManager.CurrentSkinInfo.Value = DefaultKaraokeSkin.Default.ToLive(); karaokeSkin = skinManager.CurrentSkin.Value as KaraokeSkin; } diff --git a/osu.Game.Rulesets.Karaoke.Tests/Screens/TestSceneKaraokeSkinEditor.cs b/osu.Game.Rulesets.Karaoke.Tests/Screens/TestSceneKaraokeSkinEditor.cs index a18696181..6aae5e0a5 100644 --- a/osu.Game.Rulesets.Karaoke.Tests/Screens/TestSceneKaraokeSkinEditor.cs +++ b/osu.Game.Rulesets.Karaoke.Tests/Screens/TestSceneKaraokeSkinEditor.cs @@ -2,6 +2,7 @@ // See the LICENCE file in the repository root for full licence text. using osu.Framework.Allocation; +using osu.Game.Database; using osu.Game.Rulesets.Karaoke.Beatmaps; using osu.Game.Rulesets.Karaoke.Screens.Skin; using osu.Game.Rulesets.Karaoke.Skinning; @@ -24,10 +25,7 @@ private void load(SkinManager skinManager) // todo: karaoke skin editor might not need editor click eventually? Dependencies.Cache(new EditorClock()); - // because skin is compared by id, so should change id to let skin manager info knows that skin has been changed. - var defaultSkin = DefaultKaraokeSkin.Default; - defaultSkin.ID = 100; - skinManager.CurrentSkinInfo.Value = defaultSkin; + skinManager.CurrentSkinInfo.Value = DefaultKaraokeSkin.Default.ToLive(); karaokeSkin = skinManager.CurrentSkin.Value as KaraokeSkin; } diff --git a/osu.Game.Rulesets.Karaoke/Edit/Lyrics/KaraokeLyricEditorSkin.cs b/osu.Game.Rulesets.Karaoke/Edit/Lyrics/KaraokeLyricEditorSkin.cs index b6c48e687..c9a13590c 100644 --- a/osu.Game.Rulesets.Karaoke/Edit/Lyrics/KaraokeLyricEditorSkin.cs +++ b/osu.Game.Rulesets.Karaoke/Edit/Lyrics/KaraokeLyricEditorSkin.cs @@ -22,7 +22,7 @@ public class KaraokeLyricEditorSkin : KaraokeSkin public const int MIN_FONT_SIZE = 10; public const int MAX_FONT_SIZE = 45; - internal const int DEFAULT_SKIN = 0; + internal static readonly Guid DEFAULT_SKIN = new("FEC5A290-5709-11EC-9F10-0800200C9A66"); public static SkinInfo Default { get; } = new() { diff --git a/osu.Game.Rulesets.Karaoke/Skinning/DefaultKaraokeSkin.cs b/osu.Game.Rulesets.Karaoke/Skinning/DefaultKaraokeSkin.cs index 150075409..90ada4aa8 100644 --- a/osu.Game.Rulesets.Karaoke/Skinning/DefaultKaraokeSkin.cs +++ b/osu.Game.Rulesets.Karaoke/Skinning/DefaultKaraokeSkin.cs @@ -1,6 +1,7 @@ // Copyright (c) andy840119 . Licensed under the GPL Licence. // See the LICENCE file in the repository root for full licence text. +using System; using System.Linq; using System.Reflection; using JetBrains.Annotations; @@ -15,7 +16,7 @@ namespace osu.Game.Rulesets.Karaoke.Skinning { public class DefaultKaraokeSkin : KaraokeSkin { - internal const int DEFAULT_SKIN = 0; + internal static readonly Guid DEFAULT_SKIN = new("FEC5A291-5709-11EC-9F10-0800200C9A66"); public static SkinInfo Default { get; } = new() { diff --git a/osu.Game.Rulesets.Karaoke/Skinning/Legacy/KaraokeLegacySkinTransformer.cs b/osu.Game.Rulesets.Karaoke/Skinning/Legacy/KaraokeLegacySkinTransformer.cs index 1f6b2d04c..374b6a035 100644 --- a/osu.Game.Rulesets.Karaoke/Skinning/Legacy/KaraokeLegacySkinTransformer.cs +++ b/osu.Game.Rulesets.Karaoke/Skinning/Legacy/KaraokeLegacySkinTransformer.cs @@ -89,7 +89,7 @@ SkinnableTargetComponentsContainer getTargetComponentsContainerFromOtherPlace() switch (Skin) { case LegacySkin legacySkin: - return new TempLegacySkin(legacySkin.SkinInfo).GetDrawableComponent(component) as SkinnableTargetComponentsContainer; + return new TempLegacySkin(legacySkin.SkinInfo.Value).GetDrawableComponent(component) as SkinnableTargetComponentsContainer; default: throw new InvalidCastException(); diff --git a/osu.Game.Rulesets.Karaoke/osu.Game.Rulesets.Karaoke.csproj b/osu.Game.Rulesets.Karaoke/osu.Game.Rulesets.Karaoke.csproj index 81fe124cb..a293e5ac8 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 @@ - +