diff --git a/osu.Game/Overlays/Settings/Sections/SkinSection.cs b/osu.Game/Overlays/Settings/Sections/SkinSection.cs index 2c24a5b277d2..befa81c56f15 100644 --- a/osu.Game/Overlays/Settings/Sections/SkinSection.cs +++ b/osu.Game/Overlays/Settings/Sections/SkinSection.cs @@ -130,6 +130,7 @@ private void skinsChanged(IRealmCollection sender, ChangeSet changes) dropdownItems.Add(sender.Single(s => s.ID == SkinInfo.ARGON_PRO_SKIN).ToLive(realm)); dropdownItems.Add(sender.Single(s => s.ID == SkinInfo.TRIANGLES_SKIN).ToLive(realm)); dropdownItems.Add(sender.Single(s => s.ID == SkinInfo.CLASSIC_SKIN).ToLive(realm)); + dropdownItems.Add(sender.Single(s => s.ID == SkinInfo.STREAM_SKIN).ToLive(realm)); dropdownItems.Add(sender.Single(s => s.ID == SkinInfo.RETRO_SKIN).ToLive(realm)); dropdownItems.Add(random_skin_info); diff --git a/osu.Game/Skinning/SkinInfo.cs b/osu.Game/Skinning/SkinInfo.cs index 4c9c16e72115..aed56354d386 100644 --- a/osu.Game/Skinning/SkinInfo.cs +++ b/osu.Game/Skinning/SkinInfo.cs @@ -21,6 +21,7 @@ public class SkinInfo : RealmObject, IHasRealmFiles, IEquatable, IHasG internal static readonly Guid ARGON_PRO_SKIN = new Guid("9FC9CF5D-0F16-4C71-8256-98868321AC43"); internal static readonly Guid CLASSIC_SKIN = new Guid("81F02CD3-EEC6-4865-AC23-FAE26A386187"); internal static readonly Guid RETRO_SKIN = new Guid("0555C76A-CC6B-4BB4-9548-DF76BA72EF25"); + internal static readonly Guid STREAM_SKIN = new Guid("E8D8675A-CD82-4E34-84FA-2FD7AE0C270C"); internal static readonly Guid RANDOM_SKIN = new Guid("D39DFEFB-477C-4372-B1EA-2BCEA5FB8908"); [PrimaryKey] diff --git a/osu.Game/Skinning/SkinManager.cs b/osu.Game/Skinning/SkinManager.cs index e92d0d3d49a9..0bd4d8b3b082 100644 --- a/osu.Game/Skinning/SkinManager.cs +++ b/osu.Game/Skinning/SkinManager.cs @@ -66,6 +66,8 @@ public class SkinManager : ModelManager, ISkinSource, IStorageResource private Skin retroSkin { get; } + private Skin streamSkin { get; } + public override bool PauseImports { get => base.PauseImports; @@ -94,6 +96,7 @@ public SkinManager(Storage storage, RealmAccess realm, GameHost host, IResourceS var defaultSkins = new[] { retroSkin = new RetroSkin(this), + streamSkin = new StreamSkin(this), DefaultClassicSkin = new DefaultLegacySkin(this), trianglesSkin = new TrianglesSkin(this), argonSkin = new ArgonSkin(this), @@ -375,6 +378,9 @@ public void SetSkinFromConfiguration(string guidString) if (guid == SkinInfo.RETRO_SKIN) skinInfo = retroSkin.SkinInfo; + + if (guid == SkinInfo.STREAM_SKIN) + skinInfo = streamSkin.SkinInfo; } CurrentSkinInfo.Value = skinInfo ?? trianglesSkin.SkinInfo; diff --git a/osu.Game/Skinning/StreamSkin.cs b/osu.Game/Skinning/StreamSkin.cs new file mode 100644 index 000000000000..4a3d9d29674e --- /dev/null +++ b/osu.Game/Skinning/StreamSkin.cs @@ -0,0 +1,43 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using JetBrains.Annotations; +using osu.Framework.IO.Stores; +using osu.Game.Extensions; +using osu.Game.IO; + +namespace osu.Game.Skinning +{ + /// + /// The skin from osu!stream. + /// + /// + /// The assets were taken from the osu!stream GitHub repository: https://github.com/ppy/osu-stream/tree/master/Artwork, https://github.com/ppy/osu-stream/tree/master/osu!stream/Skins/Default + /// + public class StreamSkin : LegacySkin + { + public static SkinInfo CreateInfo() => new SkinInfo + { + ID = Skinning.SkinInfo.STREAM_SKIN, + Name = "osu! \"stream\" (2011)", + Creator = "team osu!", + Protected = true, + InstantiationInfo = typeof(StreamSkin).GetInvariantInstantiationInfo(), + }; + + public StreamSkin(IStorageResourceProvider resources) + : this(CreateInfo(), resources) + { + } + + [UsedImplicitly(ImplicitUseKindFlags.InstantiatedWithFixedConstructorSignature)] + public StreamSkin(SkinInfo skin, IStorageResourceProvider resources) + : base( + skin, + resources, + new NamespacedResourceStore(resources.Resources, "Skins/Stream") + ) + { + } + } +}