-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Because need to read the config from the karaoke skin. So use tricky way to fix the test case broken. Technically, should be better to use the skin transformer ;_;
- Loading branch information
1 parent
37cc22f
commit 2f92d07
Showing
4 changed files
with
76 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,16 @@ | ||
// Copyright (c) andy840119 <[email protected]>. Licensed under the GPL Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
using System; | ||
using JetBrains.Annotations; | ||
using osu.Framework.Allocation; | ||
using osu.Game.Database; | ||
using osu.Game.IO; | ||
using osu.Game.Rulesets.Karaoke.Beatmaps; | ||
using osu.Game.Rulesets.Karaoke.Extensions; | ||
using osu.Game.Rulesets.Karaoke.Screens.Skin; | ||
using osu.Game.Rulesets.Karaoke.Skinning; | ||
using osu.Game.Rulesets.Karaoke.Skinning.Elements; | ||
using osu.Game.Screens.Edit; | ||
using osu.Game.Skinning; | ||
|
||
|
@@ -28,11 +33,43 @@ public class TestSceneKaraokeSkinEditor : ScreenTestScene<KaraokeSkinEditor> | |
[BackgroundDependencyLoader] | ||
private void load(SkinManager skinManager) | ||
{ | ||
skinManager.CurrentSkinInfo.Value = DefaultKaraokeSkin.CreateInfo().ToLiveUnmanaged(); | ||
skinManager.CurrentSkinInfo.Value = TestingSkin.CreateInfo().ToLiveUnmanaged(); | ||
|
||
karaokeSkin = skinManager.CurrentSkin.Value as KaraokeSkin; | ||
} | ||
|
||
protected override KaraokeSkinEditor CreateScreen() => new(karaokeSkin); | ||
|
||
/// <summary> | ||
/// todo: it's a tricky way to create ruleset's own skin class. | ||
/// should use generic skin like <see cref="LegacySkin"/> eventually. | ||
/// </summary> | ||
public class TestingSkin : KaraokeSkin | ||
{ | ||
internal static readonly Guid DEFAULT_SKIN = new("FEC5A291-5709-11EC-9F10-0800200C9A66"); | ||
|
||
public static SkinInfo CreateInfo() => new() | ||
{ | ||
ID = DEFAULT_SKIN, | ||
Name = "karaoke! (default skin)", | ||
Creator = "team karaoke!", | ||
Protected = true, | ||
InstantiationInfo = typeof(TestingSkin).GetInvariantInstantiationInfo() | ||
}; | ||
|
||
public TestingSkin(IStorageResourceProvider? resources) | ||
: this(CreateInfo(), resources) | ||
{ | ||
} | ||
|
||
[UsedImplicitly(ImplicitUseKindFlags.InstantiatedWithFixedConstructorSignature)] | ||
public TestingSkin(SkinInfo skin, IStorageResourceProvider? resources) | ||
: base(skin, resources) | ||
{ | ||
DefaultElement[ElementType.LyricConfig] = LyricConfig.CreateDefault(); | ||
DefaultElement[ElementType.LyricStyle] = LyricStyle.CreateDefault(); | ||
DefaultElement[ElementType.NoteStyle] = NoteStyle.CreateDefault(); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.