Skip to content

Commit

Permalink
Remove existing per-column touch input
Browse files Browse the repository at this point in the history
  • Loading branch information
smoogipoo authored and peppy committed May 14, 2024
1 parent 1fd5d73 commit 4f6777a
Showing 1 changed file with 1 addition and 35 deletions.
36 changes: 1 addition & 35 deletions osu.Game.Rulesets.Mania/UI/Column.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@ private void load(GameHost host)
// For input purposes, the background is added at the highest depth, but is then proxied back below all other elements externally
// (see `Stage.columnBackgrounds`).
BackgroundContainer,
TopLevelContainer,
new ColumnTouchInputArea(this)
TopLevelContainer
};

var background = new SkinnableDrawable(new ManiaSkinComponentLookup(ManiaSkinComponents.ColumnBackground), _ => new DefaultColumnBackground())
Expand Down Expand Up @@ -181,38 +180,5 @@ public void OnReleased(KeyBindingReleaseEvent<ManiaAction> e)
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
=> 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);
}
}
}
}

0 comments on commit 4f6777a

Please sign in to comment.