1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-08 22:02:56 +08:00

Add support for special column

This commit is contained in:
mcendu 2020-03-31 22:58:04 +08:00
parent c9a81e7f71
commit 44fcd2613f
No known key found for this signature in database
GPG Key ID: FBCD5D45163D6364
2 changed files with 19 additions and 7 deletions

View File

@ -5,6 +5,7 @@ using System;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Bindables; using osu.Framework.Bindables;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Game.Rulesets.Mania.Beatmaps;
using osu.Game.Rulesets.Mania.UI; using osu.Game.Rulesets.Mania.UI;
using osu.Game.Skinning; using osu.Game.Skinning;
@ -19,20 +20,30 @@ namespace osu.Game.Rulesets.Mania.Skinning
protected Column Column { get; private set; } protected Column Column { get; private set; }
/// <summary> /// <summary>
/// The column index to use for texture lookups, in the case of no user-provided configuration. /// The column type identifier to use for texture lookups, in the case of no user-provided configuration.
/// </summary> /// </summary>
protected int FallbackColumnIndex { get; private set; } protected string FallbackColumnIndex { get; private set; }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load() private void load()
{ {
if (Stage == null) if (Stage == null)
FallbackColumnIndex = Column.Index % 2 + 1; FallbackColumnIndex = (Column.Index % 2 + 1).ToString();
else else
{ switch (Column.ColumnType)
int dist = Math.Min(Column.Index, Stage.Columns.Count - Column.Index - 1); {
FallbackColumnIndex = dist % 2 + 1; case ColumnType.Special:
} FallbackColumnIndex = "S";
break;
case ColumnType.Odd:
FallbackColumnIndex = "1";
break;
case ColumnType.Even:
FallbackColumnIndex = "2";
break;
}
} }
protected override IBindable<T> GetManiaSkinConfig<T>(ISkin skin, LegacyManiaSkinConfigurationLookups lookup, int? index = null) protected override IBindable<T> GetManiaSkinConfig<T>(ISkin skin, LegacyManiaSkinConfigurationLookups lookup, int? index = null)

View File

@ -3,6 +3,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Shapes;