1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 12:57:36 +08:00
1. Instead of this property, turn SpecialColumnPosition into a
2. special column does not display
This commit is contained in:
ANDY840119-PC\andy840119 2018-01-14 20:44:17 +09:00
parent 5ecfc3a57c
commit 2d266a8604
3 changed files with 27 additions and 46 deletions

View File

@ -121,9 +121,9 @@ namespace osu.Game.Rulesets.Mania.Tests
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
SpecialColumnPosition = specialPos
});
playfield.SpecialColumnPosition.Value = specialPos;
playfield.Inverted.Value = inverted;
return playfield;

View File

@ -32,17 +32,7 @@ namespace osu.Game.Rulesets.Mania.UI
/// <summary>
/// The style to use for the special column.
/// </summary>
public SpecialColumnPosition SpecialColumnPosition
{
get => stages.FirstOrDefault()?.SpecialColumnPosition ?? SpecialColumnPosition.Normal;
set
{
foreach (var singleStage in stages)
{
singleStage.SpecialColumnPosition = value;
}
}
}
public Bindable<SpecialColumnPosition> SpecialColumnPosition = new Bindable<UI.SpecialColumnPosition>();
public List<Column> Columns => stages.SelectMany(x => x.Columns).ToList();

View File

@ -31,21 +31,7 @@ namespace osu.Game.Rulesets.Mania.UI
/// </summary>
public readonly Bindable<bool> Inverted = new Bindable<bool>(true);
private SpecialColumnPosition specialColumnPosition;
/// <summary>
/// The style to use for the special column.
/// </summary>
public SpecialColumnPosition SpecialColumnPosition
{
get { return specialColumnPosition; }
set
{
if (IsLoaded)
throw new InvalidOperationException($"Setting {nameof(SpecialColumnPosition)} after the playfield is loaded requires re-creating the playfield.");
specialColumnPosition = value;
}
}
public readonly Bindable<SpecialColumnPosition> SpecialColumn = new Bindable<SpecialColumnPosition>();
public IEnumerable<Column> Columns => columns.Children;
private readonly FillFlowContainer<Column> columns;
@ -147,25 +133,6 @@ namespace osu.Game.Rulesets.Mania.UI
Judgements.Scale = Scale;
}
/// <summary>
/// Whether the column index is a special column for this playfield.
/// </summary>
/// <param name="column">The 0-based column index.</param>
/// <returns>Whether the column is a special column.</returns>
private bool isSpecialColumn(int column)
{
switch (SpecialColumnPosition)
{
default:
case SpecialColumnPosition.Normal:
return columns.Count % 2 == 1 && column == columns.Count / 2;
case SpecialColumnPosition.Left:
return column == 0;
case SpecialColumnPosition.Right:
return column == columns.Count - 1;
}
}
public void AddColumn(Column c)
{
c.VisibleTimeRange.BindTo(VisibleTimeRange);
@ -180,6 +147,25 @@ namespace osu.Game.Rulesets.Mania.UI
};
}
/// <summary>
/// Whether the column index is a special column for this playfield.
/// </summary>
/// <param name="column">The 0-based column index.</param>
/// <returns>Whether the column is a special column.</returns>
private bool isSpecialColumn(int column)
{
switch (SpecialColumn.Value)
{
default:
case SpecialColumnPosition.Normal:
return columns.Count % 2 == 1 && column == columns.Count / 2;
case SpecialColumnPosition.Left:
return column == 0;
case SpecialColumnPosition.Right:
return column == columns.Count - 1;
}
}
public override void Add(DrawableHitObject h)
{
int columnIndex = ((ManiaHitObject)h.HitObject).Column - ColumnStartIndex;
@ -203,6 +189,11 @@ namespace osu.Game.Rulesets.Mania.UI
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
for (int i = 0; i < columns.Count; i++)
{
columns[i].IsSpecial = isSpecialColumn(i);
}
normalColumnColours = new List<Color4>
{
colours.RedDark,