From d0ea1739b4767427c6ccd1b8de425a5fa4059be3 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 23 Mar 2022 14:53:00 +0900 Subject: [PATCH] Remove skin configuration stream logic as it is no longer required --- osu.Game/Skinning/LegacySkin.cs | 14 +------------- osu.Game/Skinning/Skin.cs | 6 +++--- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/osu.Game/Skinning/LegacySkin.cs b/osu.Game/Skinning/LegacySkin.cs index 1559b9af53..6752851ca6 100644 --- a/osu.Game/Skinning/LegacySkin.cs +++ b/osu.Game/Skinning/LegacySkin.cs @@ -58,19 +58,7 @@ public LegacySkin(SkinInfo skin, IStorageResourceProvider resources) /// Access to raw game resources. /// The user-facing filename of the configuration file to be parsed. Can accept an .osu or skin.ini file. protected LegacySkin(SkinInfo skin, [CanBeNull] IResourceStore storage, [CanBeNull] IStorageResourceProvider resources, string configurationFilename) - : this(skin, storage, resources, string.IsNullOrEmpty(configurationFilename) ? null : storage?.GetStream(configurationFilename)) - { - } - - /// - /// Construct a new legacy skin instance. - /// - /// The model for this skin. - /// An optional store which will be used for looking up skin resources. If null, one will be created from realm pattern. - /// Access to raw game resources. - /// An optional stream containing the contents of a skin.ini file. - protected LegacySkin(SkinInfo skin, [CanBeNull] IResourceStore storage, [CanBeNull] IStorageResourceProvider resources, [CanBeNull] Stream configurationStream) - : base(skin, resources, storage, configurationStream) + : base(skin, resources, storage, configurationFilename) { // todo: this shouldn't really be duplicated here (from ManiaLegacySkinTransformer). we need to come up with a better solution. hasKeyTexture = new Lazy(() => this.GetAnimation( diff --git a/osu.Game/Skinning/Skin.cs b/osu.Game/Skinning/Skin.cs index 4c2b58bbc2..72bbca4903 100644 --- a/osu.Game/Skinning/Skin.cs +++ b/osu.Game/Skinning/Skin.cs @@ -58,8 +58,8 @@ public abstract class Skin : IDisposable, ISkin /// The skin's metadata. Usually a live realm object. /// Access to game-wide resources. /// An optional store which will be used for looking up skin resources. If null, one will be created from realm pattern. - /// An optional stream which will be used to read the skin configuration. If null, the configuration will be retrieved from the storage using "skin.ini". - protected Skin(SkinInfo skin, [CanBeNull] IStorageResourceProvider resources, [CanBeNull] IResourceStore storage = null, [CanBeNull] Stream configurationStream = null) + /// An optional filename to read the skin configuration from. If not provided, the configuration will be retrieved from the storage using "skin.ini". + protected Skin(SkinInfo skin, [CanBeNull] IStorageResourceProvider resources, [CanBeNull] IResourceStore storage = null, [CanBeNull] string configurationFilename = "skin.ini") { if (resources != null) { @@ -77,7 +77,7 @@ protected Skin(SkinInfo skin, [CanBeNull] IStorageResourceProvider resources, [C Textures = new TextureStore(resources.CreateTextureLoaderStore(storage)); } - configurationStream ??= storage?.GetStream(@"skin.ini"); + var configurationStream = storage?.GetStream(configurationFilename); if (configurationStream != null) // stream will be closed after use by LineBufferedReader.