From 003af19e3f039985ec73565cee3d3ad7345e0e9b Mon Sep 17 00:00:00 2001 From: iiSaLMaN Date: Wed, 9 Oct 2019 23:04:34 +0300 Subject: [PATCH 01/16] Introduce legacy skin configuration --- osu.Game/Skinning/LegacySkin.cs | 18 ++++++++++++++++-- osu.Game/Skinning/LegacySkinConfiguration.cs | 20 ++++++++++++++++++++ 2 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 osu.Game/Skinning/LegacySkinConfiguration.cs diff --git a/osu.Game/Skinning/LegacySkin.cs b/osu.Game/Skinning/LegacySkin.cs index fea15458e4..25703b30dc 100644 --- a/osu.Game/Skinning/LegacySkin.cs +++ b/osu.Game/Skinning/LegacySkin.cs @@ -26,6 +26,8 @@ namespace osu.Game.Skinning [CanBeNull] protected IResourceStore Samples; + protected new LegacySkinConfiguration Configuration => (LegacySkinConfiguration)base.Configuration; + public LegacySkin(SkinInfo skin, IResourceStore storage, AudioManager audioManager) : this(skin, new LegacySkinResourceStore(skin, storage), audioManager, "skin.ini") { @@ -37,9 +39,9 @@ namespace osu.Game.Skinning Stream stream = storage?.GetStream(filename); if (stream != null) using (LineBufferedReader reader = new LineBufferedReader(stream)) - Configuration = new LegacySkinDecoder().Decode(reader); + base.Configuration = new LegacySkinDecoder().Decode(reader); else - Configuration = new DefaultSkinConfiguration(); + base.Configuration = new LegacySkinConfiguration { LegacyVersion = LegacySkinConfiguration.LATEST_VERSION }; if (storage != null) { @@ -71,6 +73,18 @@ namespace osu.Game.Skinning case GlobalSkinColour colour: return SkinUtils.As(getCustomColour(colour.ToString())); + case LegacySkinConfigurations legacy: + switch (legacy) + { + case LegacySkinConfigurations.Version: + if (Configuration.LegacyVersion.HasValue) + return SkinUtils.As(new BindableDouble(Configuration.LegacyVersion.Value)); + + break; + } + + break; + case SkinCustomColourLookup customColour: return SkinUtils.As(getCustomColour(customColour.Lookup.ToString())); diff --git a/osu.Game/Skinning/LegacySkinConfiguration.cs b/osu.Game/Skinning/LegacySkinConfiguration.cs new file mode 100644 index 0000000000..022f613562 --- /dev/null +++ b/osu.Game/Skinning/LegacySkinConfiguration.cs @@ -0,0 +1,20 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +namespace osu.Game.Skinning +{ + public class LegacySkinConfiguration : DefaultSkinConfiguration + { + public const double LATEST_VERSION = 2.5; + + /// + /// Legacy version of this skin. + /// + public double? LegacyVersion { get; internal set; } + } + + public enum LegacySkinConfigurations + { + Version, + } +} From 7f6541672c9c3d3e30673e47c7d7a1b0ab630f1b Mon Sep 17 00:00:00 2001 From: iiSaLMaN Date: Wed, 9 Oct 2019 23:05:50 +0300 Subject: [PATCH 02/16] Parse legacy version of decoded skin to numerical --- osu.Game/Skinning/LegacySkinDecoder.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/osu.Game/Skinning/LegacySkinDecoder.cs b/osu.Game/Skinning/LegacySkinDecoder.cs index e97664e75e..75cd0a666d 100644 --- a/osu.Game/Skinning/LegacySkinDecoder.cs +++ b/osu.Game/Skinning/LegacySkinDecoder.cs @@ -5,14 +5,14 @@ using osu.Game.Beatmaps.Formats; namespace osu.Game.Skinning { - public class LegacySkinDecoder : LegacyDecoder + public class LegacySkinDecoder : LegacyDecoder { public LegacySkinDecoder() : base(1) { } - protected override void ParseLine(DefaultSkinConfiguration skin, Section section, string line) + protected override void ParseLine(LegacySkinConfiguration skin, Section section, string line) { if (section != Section.Colours) { @@ -32,6 +32,14 @@ namespace osu.Game.Skinning case @"Author": skin.SkinInfo.Creator = pair.Value; return; + + case @"Version": + if (pair.Value == "latest" || pair.Value == "User") + skin.LegacyVersion = LegacySkinConfiguration.LATEST_VERSION; + else if (double.TryParse(pair.Value, out var version)) + skin.LegacyVersion = version; + + return; } break; From 01ac19fdbb96cea3f36da3ce4b5ed39d1994658a Mon Sep 17 00:00:00 2001 From: iiSaLMaN Date: Wed, 9 Oct 2019 23:06:32 +0300 Subject: [PATCH 03/16] Set legacy version of osu!classic skin to 2.0 --- osu.Game/Skinning/DefaultLegacySkin.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.Game/Skinning/DefaultLegacySkin.cs b/osu.Game/Skinning/DefaultLegacySkin.cs index 4b6eea6b6e..4c68ee938f 100644 --- a/osu.Game/Skinning/DefaultLegacySkin.cs +++ b/osu.Game/Skinning/DefaultLegacySkin.cs @@ -20,6 +20,8 @@ namespace osu.Game.Skinning new Color4(18, 124, 255, 255), new Color4(242, 24, 57, 255), }); + + Configuration.LegacyVersion = 2.0; } public static SkinInfo Info { get; } = new SkinInfo From d15db378ce2598a66f5bdad3958d964dbd1b869b Mon Sep 17 00:00:00 2001 From: iiSaLMaN Date: Wed, 9 Oct 2019 23:06:53 +0300 Subject: [PATCH 04/16] Add tests for legacy skin decoding --- osu.Game.Tests/Resources/skin-20.ini | 2 ++ osu.Game.Tests/Resources/skin-latest.ini | 2 ++ osu.Game.Tests/Skins/LegacySkinDecoderTest.cs | 11 +++++++++++ 3 files changed, 15 insertions(+) create mode 100644 osu.Game.Tests/Resources/skin-20.ini create mode 100644 osu.Game.Tests/Resources/skin-latest.ini diff --git a/osu.Game.Tests/Resources/skin-20.ini b/osu.Game.Tests/Resources/skin-20.ini new file mode 100644 index 0000000000..947b56b2f9 --- /dev/null +++ b/osu.Game.Tests/Resources/skin-20.ini @@ -0,0 +1,2 @@ +[General] +Version: 2 \ No newline at end of file diff --git a/osu.Game.Tests/Resources/skin-latest.ini b/osu.Game.Tests/Resources/skin-latest.ini new file mode 100644 index 0000000000..32f500263f --- /dev/null +++ b/osu.Game.Tests/Resources/skin-latest.ini @@ -0,0 +1,2 @@ +[General] +Version: latest \ No newline at end of file diff --git a/osu.Game.Tests/Skins/LegacySkinDecoderTest.cs b/osu.Game.Tests/Skins/LegacySkinDecoderTest.cs index 0d96dd08da..8c85074456 100644 --- a/osu.Game.Tests/Skins/LegacySkinDecoderTest.cs +++ b/osu.Game.Tests/Skins/LegacySkinDecoderTest.cs @@ -56,5 +56,16 @@ namespace osu.Game.Tests.Skins Assert.AreEqual("TestValue", config.ConfigDictionary["TestLookup"]); } } + + [TestCase("skin-20.ini", 2.0)] + [TestCase("skin-latest.ini", LegacySkinConfiguration.LATEST_VERSION)] + [TestCase("skin-empty.ini", null)] + public void TestDecodeVersion(string filename, double? expected) + { + var decoder = new LegacySkinDecoder(); + using (var resStream = TestResources.OpenResource(filename)) + using (var stream = new LineBufferedReader(resStream)) + Assert.AreEqual(expected, decoder.Decode(stream).LegacyVersion); + } } } From 2cf17e0bf38455d465d2f59e7c9552255dde2766 Mon Sep 17 00:00:00 2001 From: iiSaLMaN Date: Wed, 9 Oct 2019 23:33:25 +0300 Subject: [PATCH 05/16] Use decimal data type instead --- osu.Game.Tests/Skins/LegacySkinDecoderTest.cs | 28 +++++++++++++++---- osu.Game/Skinning/DefaultLegacySkin.cs | 2 +- osu.Game/Skinning/LegacySkin.cs | 2 +- osu.Game/Skinning/LegacySkinConfiguration.cs | 4 +-- osu.Game/Skinning/LegacySkinDecoder.cs | 2 +- 5 files changed, 27 insertions(+), 11 deletions(-) diff --git a/osu.Game.Tests/Skins/LegacySkinDecoderTest.cs b/osu.Game.Tests/Skins/LegacySkinDecoderTest.cs index 8c85074456..4fee6942d0 100644 --- a/osu.Game.Tests/Skins/LegacySkinDecoderTest.cs +++ b/osu.Game.Tests/Skins/LegacySkinDecoderTest.cs @@ -57,15 +57,31 @@ namespace osu.Game.Tests.Skins } } - [TestCase("skin-20.ini", 2.0)] - [TestCase("skin-latest.ini", LegacySkinConfiguration.LATEST_VERSION)] - [TestCase("skin-empty.ini", null)] - public void TestDecodeVersion(string filename, double? expected) + [Test] + public void TestDecodeSpecifiedVersion() { var decoder = new LegacySkinDecoder(); - using (var resStream = TestResources.OpenResource(filename)) + using (var resStream = TestResources.OpenResource("skin-20.ini")) using (var stream = new LineBufferedReader(resStream)) - Assert.AreEqual(expected, decoder.Decode(stream).LegacyVersion); + Assert.AreEqual(2.0m, decoder.Decode(stream).LegacyVersion); + } + + [Test] + public void TestDecodeLatestVersion() + { + var decoder = new LegacySkinDecoder(); + using (var resStream = TestResources.OpenResource("skin-latest.ini")) + using (var stream = new LineBufferedReader(resStream)) + Assert.AreEqual(LegacySkinConfiguration.LATEST_VERSION, decoder.Decode(stream).LegacyVersion); + } + + [Test] + public void TestDecodeNoVersion() + { + var decoder = new LegacySkinDecoder(); + using (var resStream = TestResources.OpenResource("skin-empty.ini")) + using (var stream = new LineBufferedReader(resStream)) + Assert.IsNull(decoder.Decode(stream).LegacyVersion); } } } diff --git a/osu.Game/Skinning/DefaultLegacySkin.cs b/osu.Game/Skinning/DefaultLegacySkin.cs index 4c68ee938f..0caf2d19e9 100644 --- a/osu.Game/Skinning/DefaultLegacySkin.cs +++ b/osu.Game/Skinning/DefaultLegacySkin.cs @@ -21,7 +21,7 @@ namespace osu.Game.Skinning new Color4(242, 24, 57, 255), }); - Configuration.LegacyVersion = 2.0; + Configuration.LegacyVersion = 2.0m; } public static SkinInfo Info { get; } = new SkinInfo diff --git a/osu.Game/Skinning/LegacySkin.cs b/osu.Game/Skinning/LegacySkin.cs index 25703b30dc..f6a366b21d 100644 --- a/osu.Game/Skinning/LegacySkin.cs +++ b/osu.Game/Skinning/LegacySkin.cs @@ -78,7 +78,7 @@ namespace osu.Game.Skinning { case LegacySkinConfigurations.Version: if (Configuration.LegacyVersion.HasValue) - return SkinUtils.As(new BindableDouble(Configuration.LegacyVersion.Value)); + return SkinUtils.As(new Bindable(Configuration.LegacyVersion.Value)); break; } diff --git a/osu.Game/Skinning/LegacySkinConfiguration.cs b/osu.Game/Skinning/LegacySkinConfiguration.cs index 022f613562..051d10747b 100644 --- a/osu.Game/Skinning/LegacySkinConfiguration.cs +++ b/osu.Game/Skinning/LegacySkinConfiguration.cs @@ -5,12 +5,12 @@ namespace osu.Game.Skinning { public class LegacySkinConfiguration : DefaultSkinConfiguration { - public const double LATEST_VERSION = 2.5; + public const decimal LATEST_VERSION = 2.5m; /// /// Legacy version of this skin. /// - public double? LegacyVersion { get; internal set; } + public decimal? LegacyVersion { get; internal set; } } public enum LegacySkinConfigurations diff --git a/osu.Game/Skinning/LegacySkinDecoder.cs b/osu.Game/Skinning/LegacySkinDecoder.cs index 75cd0a666d..ea087353a0 100644 --- a/osu.Game/Skinning/LegacySkinDecoder.cs +++ b/osu.Game/Skinning/LegacySkinDecoder.cs @@ -36,7 +36,7 @@ namespace osu.Game.Skinning case @"Version": if (pair.Value == "latest" || pair.Value == "User") skin.LegacyVersion = LegacySkinConfiguration.LATEST_VERSION; - else if (double.TryParse(pair.Value, out var version)) + else if (decimal.TryParse(pair.Value, out var version)) skin.LegacyVersion = version; return; From 55230a36dd089d49513f074ddcfc8b3070db056e Mon Sep 17 00:00:00 2001 From: iiSaLMaN Date: Wed, 6 Nov 2019 19:58:07 +0300 Subject: [PATCH 06/16] Set correct legacy version --- osu.Game/Skinning/LegacySkinConfiguration.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Skinning/LegacySkinConfiguration.cs b/osu.Game/Skinning/LegacySkinConfiguration.cs index 051d10747b..f9bf78b8ad 100644 --- a/osu.Game/Skinning/LegacySkinConfiguration.cs +++ b/osu.Game/Skinning/LegacySkinConfiguration.cs @@ -5,7 +5,7 @@ namespace osu.Game.Skinning { public class LegacySkinConfiguration : DefaultSkinConfiguration { - public const decimal LATEST_VERSION = 2.5m; + public const decimal LATEST_VERSION = 2.7m; /// /// Legacy version of this skin. From 502dcc566978b9bc2420d102e76ecbf51260b875 Mon Sep 17 00:00:00 2001 From: iiSaLMaN Date: Wed, 6 Nov 2019 20:23:22 +0300 Subject: [PATCH 07/16] Fix incorrect skin version case --- osu.Game/Skinning/LegacySkinDecoder.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Skinning/LegacySkinDecoder.cs b/osu.Game/Skinning/LegacySkinDecoder.cs index ea087353a0..7dcb7ea3ac 100644 --- a/osu.Game/Skinning/LegacySkinDecoder.cs +++ b/osu.Game/Skinning/LegacySkinDecoder.cs @@ -34,7 +34,7 @@ namespace osu.Game.Skinning return; case @"Version": - if (pair.Value == "latest" || pair.Value == "User") + if (pair.Value == "latest") skin.LegacyVersion = LegacySkinConfiguration.LATEST_VERSION; else if (decimal.TryParse(pair.Value, out var version)) skin.LegacyVersion = version; From 947602f70afcc6b58d473f0f36ceb28bddfe41b7 Mon Sep 17 00:00:00 2001 From: iiSaLMaN Date: Wed, 6 Nov 2019 20:24:19 +0300 Subject: [PATCH 08/16] Specify why legacy version is nullable --- osu.Game/Skinning/LegacySkinConfiguration.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Skinning/LegacySkinConfiguration.cs b/osu.Game/Skinning/LegacySkinConfiguration.cs index f9bf78b8ad..33c29cd47c 100644 --- a/osu.Game/Skinning/LegacySkinConfiguration.cs +++ b/osu.Game/Skinning/LegacySkinConfiguration.cs @@ -8,7 +8,7 @@ namespace osu.Game.Skinning public const decimal LATEST_VERSION = 2.7m; /// - /// Legacy version of this skin. + /// Legacy version of this skin. Null if no version was set to allow fallback to a parent skin version. /// public decimal? LegacyVersion { get; internal set; } } From ba14345107fc46fc1e00656d58a96e89a69d2abd Mon Sep 17 00:00:00 2001 From: iiSaLMaN Date: Wed, 6 Nov 2019 20:27:55 +0300 Subject: [PATCH 09/16] Specify culture and number style --- osu.Game/Skinning/LegacySkinDecoder.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game/Skinning/LegacySkinDecoder.cs b/osu.Game/Skinning/LegacySkinDecoder.cs index 7dcb7ea3ac..88ba7b23b7 100644 --- a/osu.Game/Skinning/LegacySkinDecoder.cs +++ b/osu.Game/Skinning/LegacySkinDecoder.cs @@ -1,6 +1,7 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using System.Globalization; using osu.Game.Beatmaps.Formats; namespace osu.Game.Skinning @@ -36,7 +37,7 @@ namespace osu.Game.Skinning case @"Version": if (pair.Value == "latest") skin.LegacyVersion = LegacySkinConfiguration.LATEST_VERSION; - else if (decimal.TryParse(pair.Value, out var version)) + else if (decimal.TryParse(pair.Value, NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture, out var version)) skin.LegacyVersion = version; return; From 69d9a0ae1a0813db3f722df54abdf1fdb53c819d Mon Sep 17 00:00:00 2001 From: iiSaLMaN Date: Wed, 6 Nov 2019 20:30:26 +0300 Subject: [PATCH 10/16] Use null check and pattern matching --- osu.Game/Skinning/LegacySkin.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Skinning/LegacySkin.cs b/osu.Game/Skinning/LegacySkin.cs index f6a366b21d..c76a61084d 100644 --- a/osu.Game/Skinning/LegacySkin.cs +++ b/osu.Game/Skinning/LegacySkin.cs @@ -77,8 +77,8 @@ namespace osu.Game.Skinning switch (legacy) { case LegacySkinConfigurations.Version: - if (Configuration.LegacyVersion.HasValue) - return SkinUtils.As(new Bindable(Configuration.LegacyVersion.Value)); + if (Configuration.LegacyVersion != null) + return SkinUtils.As(new Bindable((decimal)Configuration.LegacyVersion)); break; } From 198a1750c3db0e2b6a2467478333a08d8a65e6db Mon Sep 17 00:00:00 2001 From: iiSaLMaN Date: Wed, 6 Nov 2019 20:46:02 +0300 Subject: [PATCH 11/16] Use `is` pattern matching --- osu.Game/Skinning/LegacySkin.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Skinning/LegacySkin.cs b/osu.Game/Skinning/LegacySkin.cs index c76a61084d..1730effc29 100644 --- a/osu.Game/Skinning/LegacySkin.cs +++ b/osu.Game/Skinning/LegacySkin.cs @@ -77,8 +77,8 @@ namespace osu.Game.Skinning switch (legacy) { case LegacySkinConfigurations.Version: - if (Configuration.LegacyVersion != null) - return SkinUtils.As(new Bindable((decimal)Configuration.LegacyVersion)); + if (Configuration.LegacyVersion is decimal version) + return SkinUtils.As(new Bindable(version)); break; } From 08b8cedfdf4766b4d29c2e36bd4ed33277c3cd33 Mon Sep 17 00:00:00 2001 From: iiSaLMaN Date: Wed, 20 Nov 2019 01:15:40 +0300 Subject: [PATCH 12/16] Add setter to legacy skin configuration access --- osu.Game/Skinning/LegacySkin.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/osu.Game/Skinning/LegacySkin.cs b/osu.Game/Skinning/LegacySkin.cs index 35aca3aa7b..0ee41e654e 100644 --- a/osu.Game/Skinning/LegacySkin.cs +++ b/osu.Game/Skinning/LegacySkin.cs @@ -26,7 +26,11 @@ namespace osu.Game.Skinning [CanBeNull] protected IResourceStore Samples; - protected new LegacySkinConfiguration Configuration => (LegacySkinConfiguration)base.Configuration; + protected new LegacySkinConfiguration Configuration + { + get => base.Configuration as LegacySkinConfiguration; + set => base.Configuration = value; + } public LegacySkin(SkinInfo skin, IResourceStore storage, AudioManager audioManager) : this(skin, new LegacySkinResourceStore(skin, storage), audioManager, "skin.ini") @@ -41,10 +45,10 @@ namespace osu.Game.Skinning if (stream != null) { using (LineBufferedReader reader = new LineBufferedReader(stream)) - base.Configuration = new LegacySkinDecoder().Decode(reader); + Configuration = new LegacySkinDecoder().Decode(reader); } else - base.Configuration = new LegacySkinConfiguration { LegacyVersion = LegacySkinConfiguration.LATEST_VERSION }; + Configuration = new LegacySkinConfiguration { LegacyVersion = LegacySkinConfiguration.LATEST_VERSION }; if (storage != null) { From bcb1504110f732679752f43254f2bdf1f9b0fd0b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 20 Nov 2019 15:40:35 +0900 Subject: [PATCH 13/16] Fix naming --- osu.Game/Skinning/LegacySkin.cs | 4 ++-- osu.Game/Skinning/LegacySkinConfiguration.cs | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/osu.Game/Skinning/LegacySkin.cs b/osu.Game/Skinning/LegacySkin.cs index 0ee41e654e..7ffed18d7b 100644 --- a/osu.Game/Skinning/LegacySkin.cs +++ b/osu.Game/Skinning/LegacySkin.cs @@ -80,10 +80,10 @@ namespace osu.Game.Skinning case GlobalSkinColour colour: return SkinUtils.As(getCustomColour(colour.ToString())); - case LegacySkinConfigurations legacy: + case LegacySkinConfiguration.LegacySetting legacy: switch (legacy) { - case LegacySkinConfigurations.Version: + case LegacySkinConfiguration.LegacySetting.Version: if (Configuration.LegacyVersion is decimal version) return SkinUtils.As(new Bindable(version)); diff --git a/osu.Game/Skinning/LegacySkinConfiguration.cs b/osu.Game/Skinning/LegacySkinConfiguration.cs index 33c29cd47c..6a667e69f4 100644 --- a/osu.Game/Skinning/LegacySkinConfiguration.cs +++ b/osu.Game/Skinning/LegacySkinConfiguration.cs @@ -11,10 +11,10 @@ namespace osu.Game.Skinning /// Legacy version of this skin. Null if no version was set to allow fallback to a parent skin version. /// public decimal? LegacyVersion { get; internal set; } - } - public enum LegacySkinConfigurations - { - Version, + public enum LegacySetting + { + Version, + } } } From 20a8a653c2f7f9fd8e64e6ef30c5116bb4c4be50 Mon Sep 17 00:00:00 2001 From: iiSaLMaN Date: Sun, 24 Nov 2019 04:10:04 +0300 Subject: [PATCH 14/16] Change LegacySkin.Configuration accessibility --- osu.Game/Skinning/LegacySkin.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Skinning/LegacySkin.cs b/osu.Game/Skinning/LegacySkin.cs index 7ffed18d7b..868e3921bb 100644 --- a/osu.Game/Skinning/LegacySkin.cs +++ b/osu.Game/Skinning/LegacySkin.cs @@ -26,7 +26,7 @@ namespace osu.Game.Skinning [CanBeNull] protected IResourceStore Samples; - protected new LegacySkinConfiguration Configuration + public new LegacySkinConfiguration Configuration { get => base.Configuration as LegacySkinConfiguration; set => base.Configuration = value; From 2437cfd28c008e9f9af01c7ca10ebca41246971d Mon Sep 17 00:00:00 2001 From: iiSaLMaN Date: Sun, 24 Nov 2019 04:36:16 +0300 Subject: [PATCH 15/16] Add test ensuring correct version lookup --- osu.Game.Tests/Skins/TestSceneSkinConfigurationLookup.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/osu.Game.Tests/Skins/TestSceneSkinConfigurationLookup.cs b/osu.Game.Tests/Skins/TestSceneSkinConfigurationLookup.cs index 578030748b..8b9c648442 100644 --- a/osu.Game.Tests/Skins/TestSceneSkinConfigurationLookup.cs +++ b/osu.Game.Tests/Skins/TestSceneSkinConfigurationLookup.cs @@ -116,6 +116,14 @@ namespace osu.Game.Tests.Skins }); } + [Test] + public void TestLegacyVersionLookup() + { + AddStep("Set source1 version 2.3", () => source1.Configuration.LegacyVersion = 2.3m); + AddStep("Set source2 version null", () => source2.Configuration.LegacyVersion = null); + AddAssert("Check legacy version lookup", () => requester.GetConfig(LegacySkinConfiguration.LegacySetting.Version)?.Value == 2.3m); + } + public enum LookupType { Test From b58afa3eb693c29d74d5aac93f7160f5f35dc639 Mon Sep 17 00:00:00 2001 From: iiSaLMaN Date: Sun, 24 Nov 2019 04:36:34 +0300 Subject: [PATCH 16/16] Remove unnecessary mentioning in xmldoc --- osu.Game/Skinning/LegacySkinConfiguration.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Skinning/LegacySkinConfiguration.cs b/osu.Game/Skinning/LegacySkinConfiguration.cs index 6a667e69f4..b1679bd464 100644 --- a/osu.Game/Skinning/LegacySkinConfiguration.cs +++ b/osu.Game/Skinning/LegacySkinConfiguration.cs @@ -8,7 +8,7 @@ namespace osu.Game.Skinning public const decimal LATEST_VERSION = 2.7m; /// - /// Legacy version of this skin. Null if no version was set to allow fallback to a parent skin version. + /// Legacy version of this skin. /// public decimal? LegacyVersion { get; internal set; }