mirror of
https://github.com/ppy/osu.git
synced 2025-02-20 04:23:14 +08:00
Fix :
1. This (along with OnJudgement above) should be done in the following three steps: 2. How about giving the stages an Inverted BindableBool, and having them decide their scale?
This commit is contained in:
parent
f7a908fbfa
commit
d07636a105
@ -81,8 +81,9 @@ namespace osu.Game.Rulesets.Mania.UI
|
||||
{
|
||||
var drawableStage = new ManiaStage();
|
||||
drawableStage.VisibleTimeRange.BindTo(VisibleTimeRange);
|
||||
drawableStage.Inverted.BindTo(Inverted);
|
||||
drawableStage.ColumnStartIndex = stageIndex;
|
||||
|
||||
|
||||
stages.Add(drawableStage);
|
||||
AddNested(drawableStage);
|
||||
|
||||
@ -100,19 +101,6 @@ namespace osu.Game.Rulesets.Mania.UI
|
||||
|
||||
stageIndex = stageIndex + stage.Columns;
|
||||
}
|
||||
|
||||
Inverted.ValueChanged += invertedChanged;
|
||||
Inverted.TriggerChange();
|
||||
}
|
||||
|
||||
private void invertedChanged(bool newValue)
|
||||
{
|
||||
Scale = new Vector2(1, newValue ? -1 : 1);
|
||||
|
||||
foreach (var single in stages)
|
||||
{
|
||||
single.Judgements.Scale = Scale;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnJudgement(DrawableHitObject judgedObject, Judgement judgement)
|
||||
|
@ -5,6 +5,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
@ -25,6 +26,11 @@ namespace osu.Game.Rulesets.Mania.UI
|
||||
{
|
||||
public const float HIT_TARGET_POSITION = 50;
|
||||
|
||||
/// <summary>
|
||||
/// Whether this playfield should be inverted. This flips everything inside the playfield.
|
||||
/// </summary>
|
||||
public readonly Bindable<bool> Inverted = new Bindable<bool>(true);
|
||||
|
||||
private SpecialColumnPosition specialColumnPosition;
|
||||
|
||||
/// <summary>
|
||||
@ -61,8 +67,8 @@ namespace osu.Game.Rulesets.Mania.UI
|
||||
: base(ScrollingDirection.Up)
|
||||
{
|
||||
Name = "Playfield elements";
|
||||
Anchor = Anchor.TopCentre;
|
||||
Origin = Anchor.TopCentre;
|
||||
Anchor = Anchor.Centre;
|
||||
Origin = Anchor.Centre;
|
||||
//RelativeSizeAxes = Axes.Y;
|
||||
//AutoSizeAxes = Axes.X;
|
||||
InternalChildren = new Drawable[]
|
||||
@ -130,6 +136,15 @@ namespace osu.Game.Rulesets.Mania.UI
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Inverted.ValueChanged += invertedChanged;
|
||||
Inverted.TriggerChange();
|
||||
}
|
||||
|
||||
private void invertedChanged(bool newValue)
|
||||
{
|
||||
Scale = new Vector2(1, newValue ? -1 : 1);
|
||||
Judgements.Scale = Scale;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -166,15 +181,15 @@ namespace osu.Game.Rulesets.Mania.UI
|
||||
|
||||
public override void Add(DrawableHitObject h)
|
||||
{
|
||||
int index = ((ManiaHitObject)h.HitObject).Column - ColumnStartIndex;
|
||||
Columns.ElementAt(index).Add(h);
|
||||
int columnIndex = ((ManiaHitObject)h.HitObject).Column - ColumnStartIndex;
|
||||
Columns.ElementAt(columnIndex).Add(h);
|
||||
}
|
||||
|
||||
public void AddJudgement(DrawableHitObject judgedObject, Judgement judgement)
|
||||
{
|
||||
var maniaObject = (ManiaHitObject)judgedObject.HitObject;
|
||||
int column = maniaObject.Column - ColumnStartIndex;
|
||||
columns[column].OnJudgement(judgedObject, judgement);
|
||||
int columnIndex = maniaObject.Column - ColumnStartIndex;
|
||||
columns[columnIndex].OnJudgement(judgedObject, judgement);
|
||||
|
||||
judgements.Clear();
|
||||
judgements.Add(new DrawableManiaJudgement(judgement)
|
||||
|
Loading…
Reference in New Issue
Block a user