mirror of
https://github.com/osukey/osukey.git
synced 2025-07-22 19:00:05 +09: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:
@ -81,8 +81,9 @@ namespace osu.Game.Rulesets.Mania.UI
|
|||||||
{
|
{
|
||||||
var drawableStage = new ManiaStage();
|
var drawableStage = new ManiaStage();
|
||||||
drawableStage.VisibleTimeRange.BindTo(VisibleTimeRange);
|
drawableStage.VisibleTimeRange.BindTo(VisibleTimeRange);
|
||||||
|
drawableStage.Inverted.BindTo(Inverted);
|
||||||
drawableStage.ColumnStartIndex = stageIndex;
|
drawableStage.ColumnStartIndex = stageIndex;
|
||||||
|
|
||||||
stages.Add(drawableStage);
|
stages.Add(drawableStage);
|
||||||
AddNested(drawableStage);
|
AddNested(drawableStage);
|
||||||
|
|
||||||
@ -100,19 +101,6 @@ namespace osu.Game.Rulesets.Mania.UI
|
|||||||
|
|
||||||
stageIndex = stageIndex + stage.Columns;
|
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)
|
public override void OnJudgement(DrawableHitObject judgedObject, Judgement judgement)
|
||||||
|
@ -5,6 +5,7 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Configuration;
|
||||||
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;
|
||||||
@ -25,6 +26,11 @@ namespace osu.Game.Rulesets.Mania.UI
|
|||||||
{
|
{
|
||||||
public const float HIT_TARGET_POSITION = 50;
|
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;
|
private SpecialColumnPosition specialColumnPosition;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -61,8 +67,8 @@ namespace osu.Game.Rulesets.Mania.UI
|
|||||||
: base(ScrollingDirection.Up)
|
: base(ScrollingDirection.Up)
|
||||||
{
|
{
|
||||||
Name = "Playfield elements";
|
Name = "Playfield elements";
|
||||||
Anchor = Anchor.TopCentre;
|
Anchor = Anchor.Centre;
|
||||||
Origin = Anchor.TopCentre;
|
Origin = Anchor.Centre;
|
||||||
//RelativeSizeAxes = Axes.Y;
|
//RelativeSizeAxes = Axes.Y;
|
||||||
//AutoSizeAxes = Axes.X;
|
//AutoSizeAxes = Axes.X;
|
||||||
InternalChildren = new Drawable[]
|
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>
|
/// <summary>
|
||||||
@ -166,15 +181,15 @@ namespace osu.Game.Rulesets.Mania.UI
|
|||||||
|
|
||||||
public override void Add(DrawableHitObject h)
|
public override void Add(DrawableHitObject h)
|
||||||
{
|
{
|
||||||
int index = ((ManiaHitObject)h.HitObject).Column - ColumnStartIndex;
|
int columnIndex = ((ManiaHitObject)h.HitObject).Column - ColumnStartIndex;
|
||||||
Columns.ElementAt(index).Add(h);
|
Columns.ElementAt(columnIndex).Add(h);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddJudgement(DrawableHitObject judgedObject, Judgement judgement)
|
public void AddJudgement(DrawableHitObject judgedObject, Judgement judgement)
|
||||||
{
|
{
|
||||||
var maniaObject = (ManiaHitObject)judgedObject.HitObject;
|
var maniaObject = (ManiaHitObject)judgedObject.HitObject;
|
||||||
int column = maniaObject.Column - ColumnStartIndex;
|
int columnIndex = maniaObject.Column - ColumnStartIndex;
|
||||||
columns[column].OnJudgement(judgedObject, judgement);
|
columns[columnIndex].OnJudgement(judgedObject, judgement);
|
||||||
|
|
||||||
judgements.Clear();
|
judgements.Clear();
|
||||||
judgements.Add(new DrawableManiaJudgement(judgement)
|
judgements.Add(new DrawableManiaJudgement(judgement)
|
||||||
|
Reference in New Issue
Block a user