mirror of
https://github.com/ppy/osu.git
synced 2025-01-26 16:12:54 +08:00
extract superclass for all mania skinning elements
This commit is contained in:
parent
977e1a3bfe
commit
ecc305bb63
@ -14,12 +14,8 @@ namespace osu.Game.Rulesets.Mania.Skinning
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A <see cref="CompositeDrawable"/> which is placed somewhere within a <see cref="Column"/>.
|
/// A <see cref="CompositeDrawable"/> which is placed somewhere within a <see cref="Column"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class LegacyManiaColumnElement : CompositeDrawable
|
public class LegacyManiaColumnElement : LegacyManiaElement
|
||||||
{
|
{
|
||||||
[Resolved(CanBeNull = true)]
|
|
||||||
[CanBeNull]
|
|
||||||
protected ManiaStage Stage { get; private set; }
|
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
protected Column Column { get; private set; }
|
protected Column Column { get; private set; }
|
||||||
|
|
||||||
@ -40,16 +36,6 @@ namespace osu.Game.Rulesets.Mania.Skinning
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Retrieve a per-column-count skin configuration.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="skin">The skin from which configuration is retrieved.</param>
|
|
||||||
/// <param name="lookup">The value to retrieve.</param>
|
|
||||||
/// <param name="index">If not null, denotes the index of the column to which the entry applies.</param>
|
|
||||||
protected IBindable<T> GetManiaSkinConfig<T>(ISkin skin, LegacyManiaSkinConfigurationLookups lookup, int? index = null)
|
|
||||||
=> skin.GetConfig<LegacyManiaSkinConfigurationLookup, T>(
|
|
||||||
new LegacyManiaSkinConfigurationLookup(Stage?.Columns.Count ?? 4, lookup, index));
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Retrieve a per-column skin configuration.
|
/// Retrieve a per-column skin configuration.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
32
osu.Game.Rulesets.Mania/Skinning/LegacyManiaElement.cs
Normal file
32
osu.Game.Rulesets.Mania/Skinning/LegacyManiaElement.cs
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using JetBrains.Annotations;
|
||||||
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Bindables;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Game.Rulesets.Mania.UI;
|
||||||
|
using osu.Game.Skinning;
|
||||||
|
|
||||||
|
namespace osu.Game.Rulesets.Mania.Skinning
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// A mania legacy skin element.
|
||||||
|
/// </summary>
|
||||||
|
public class LegacyManiaElement : CompositeDrawable
|
||||||
|
{
|
||||||
|
[Resolved(CanBeNull = true)]
|
||||||
|
[CanBeNull]
|
||||||
|
protected ManiaStage Stage { get; private set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Retrieve a per-column-count skin configuration.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="skin">The skin from which configuration is retrieved.</param>
|
||||||
|
/// <param name="lookup">The value to retrieve.</param>
|
||||||
|
/// <param name="index">If not null, denotes the index of the column to which the entry applies.</param>
|
||||||
|
protected virtual IBindable<T> GetManiaSkinConfig<T>(ISkin skin, LegacyManiaSkinConfigurationLookups lookup, int? index = null)
|
||||||
|
=> skin.GetConfig<LegacyManiaSkinConfigurationLookup, T>(
|
||||||
|
new LegacyManiaSkinConfigurationLookup(Stage?.Columns.Count ?? 4, lookup, index));
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user