mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 03:22:57 +08:00
Remove existing per-column touch input
This commit is contained in:
parent
1fd5d737da
commit
4f6777a0a1
@ -93,8 +93,7 @@ namespace osu.Game.Rulesets.Mania.UI
|
|||||||
// For input purposes, the background is added at the highest depth, but is then proxied back below all other elements externally
|
// For input purposes, the background is added at the highest depth, but is then proxied back below all other elements externally
|
||||||
// (see `Stage.columnBackgrounds`).
|
// (see `Stage.columnBackgrounds`).
|
||||||
BackgroundContainer,
|
BackgroundContainer,
|
||||||
TopLevelContainer,
|
TopLevelContainer
|
||||||
new ColumnTouchInputArea(this)
|
|
||||||
};
|
};
|
||||||
|
|
||||||
var background = new SkinnableDrawable(new ManiaSkinComponentLookup(ManiaSkinComponents.ColumnBackground), _ => new DefaultColumnBackground())
|
var background = new SkinnableDrawable(new ManiaSkinComponentLookup(ManiaSkinComponents.ColumnBackground), _ => new DefaultColumnBackground())
|
||||||
@ -181,38 +180,5 @@ namespace osu.Game.Rulesets.Mania.UI
|
|||||||
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos)
|
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos)
|
||||||
// This probably shouldn't exist as is, but the columns in the stage are separated by a 1px border
|
// This probably shouldn't exist as is, but the columns in the stage are separated by a 1px border
|
||||||
=> DrawRectangle.Inflate(new Vector2(Stage.COLUMN_SPACING / 2, 0)).Contains(ToLocalSpace(screenSpacePos));
|
=> DrawRectangle.Inflate(new Vector2(Stage.COLUMN_SPACING / 2, 0)).Contains(ToLocalSpace(screenSpacePos));
|
||||||
|
|
||||||
public partial class ColumnTouchInputArea : Drawable
|
|
||||||
{
|
|
||||||
private readonly Column column;
|
|
||||||
|
|
||||||
[Resolved(canBeNull: true)]
|
|
||||||
private ManiaInputManager maniaInputManager { get; set; }
|
|
||||||
|
|
||||||
private KeyBindingContainer<ManiaAction> keyBindingContainer;
|
|
||||||
|
|
||||||
public ColumnTouchInputArea(Column column)
|
|
||||||
{
|
|
||||||
RelativeSizeAxes = Axes.Both;
|
|
||||||
|
|
||||||
this.column = column;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void LoadComplete()
|
|
||||||
{
|
|
||||||
keyBindingContainer = maniaInputManager?.KeyBindingContainer;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override bool OnTouchDown(TouchDownEvent e)
|
|
||||||
{
|
|
||||||
keyBindingContainer?.TriggerPressed(column.Action.Value);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void OnTouchUp(TouchUpEvent e)
|
|
||||||
{
|
|
||||||
keyBindingContainer?.TriggerReleased(column.Action.Value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user