diff --git a/osu.Game/Skinning/Skin.cs b/osu.Game/Skinning/Skin.cs index 5ae4852288..ccf49d722f 100644 --- a/osu.Game/Skinning/Skin.cs +++ b/osu.Game/Skinning/Skin.cs @@ -105,7 +105,14 @@ namespace osu.Game.Skinning Debug.Assert(Configuration != null); } else - Configuration = new SkinConfiguration(); + { + Configuration = new SkinConfiguration + { + // generally won't be hit as we always write a `skin.ini` on import, but best be safe than sorry. + // see https://github.com/peppy/osu-stable-reference/blob/1531237b63392e82c003c712faa028406073aa8f/osu!/Graphics/Skinning/SkinManager.cs#L297-L298 + LegacyVersion = SkinConfiguration.LATEST_VERSION, + }; + } // skininfo files may be null for default skin. foreach (SkinComponentsContainerLookup.TargetArea skinnableTarget in Enum.GetValues()) diff --git a/osu.Game/Skinning/SkinImporter.cs b/osu.Game/Skinning/SkinImporter.cs index f2103a45c4..1b6fa7f4ed 100644 --- a/osu.Game/Skinning/SkinImporter.cs +++ b/osu.Game/Skinning/SkinImporter.cs @@ -118,7 +118,7 @@ namespace osu.Game.Skinning string nameLine = @$"Name: {item.Name}"; string authorLine = @$"Author: {item.Creator}"; - string[] newLines = + List newLines = new List { @"// The following content was automatically added by osu! during import, based on filename / folder metadata.", @"[General]", @@ -130,6 +130,10 @@ namespace osu.Game.Skinning if (existingFile == null) { + // skins without a skin.ini are supposed to import using the "latest version" spec. + // see https://github.com/peppy/osu-stable-reference/blob/1531237b63392e82c003c712faa028406073aa8f/osu!/Graphics/Skinning/SkinManager.cs#L297-L298 + newLines.Add($"Version: {SkinConfiguration.LATEST_VERSION}"); + // In the case a skin doesn't have a skin.ini yet, let's create one. writeNewSkinIni(); }