From c192dc4087d327437f93cad4c0cc11b40b30b858 Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 7 Dec 2021 10:51:40 +0800 Subject: [PATCH 1/2] update package. --- 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 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 @@ - + From f894cfa49c328e8c8c6283e9d0830b87a8d49733 Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 7 Dec 2021 10:52:06 +0800 Subject: [PATCH 2/2] Fix skin GUID issue. And notice that GUID is create by https://www.famkruithof.net/uuid/uuidgen It's just for identify purpose with no special meaning. --- .../Screens/KaraokeSkinEditorScreenTestScene.cs | 6 ++---- .../Screens/TestSceneKaraokeSkinEditor.cs | 6 ++---- .../Edit/Lyrics/KaraokeLyricEditorSkin.cs | 2 +- osu.Game.Rulesets.Karaoke/Skinning/DefaultKaraokeSkin.cs | 3 ++- .../Skinning/Legacy/KaraokeLegacySkinTransformer.cs | 2 +- 5 files changed, 8 insertions(+), 11 deletions(-) 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();