mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 11:37:28 +08:00
Add support for special column
This commit is contained in:
parent
c9a81e7f71
commit
44fcd2613f
@ -5,6 +5,7 @@ using System;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Rulesets.Mania.Beatmaps;
|
||||
using osu.Game.Rulesets.Mania.UI;
|
||||
using osu.Game.Skinning;
|
||||
|
||||
@ -19,20 +20,30 @@ namespace osu.Game.Rulesets.Mania.Skinning
|
||||
protected Column Column { get; private set; }
|
||||
|
||||
/// <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>
|
||||
protected int FallbackColumnIndex { get; private set; }
|
||||
protected string FallbackColumnIndex { get; private set; }
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
if (Stage == null)
|
||||
FallbackColumnIndex = Column.Index % 2 + 1;
|
||||
FallbackColumnIndex = (Column.Index % 2 + 1).ToString();
|
||||
else
|
||||
{
|
||||
int dist = Math.Min(Column.Index, Stage.Columns.Count - Column.Index - 1);
|
||||
FallbackColumnIndex = dist % 2 + 1;
|
||||
}
|
||||
switch (Column.ColumnType)
|
||||
{
|
||||
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)
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
|
Loading…
Reference in New Issue
Block a user