mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 15:47:26 +08:00
Code formatting
This commit is contained in:
parent
848b005097
commit
ac17c047f6
@ -37,7 +37,8 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
|
|
||||||
private Container visibleComponents;
|
private Container visibleComponents;
|
||||||
|
|
||||||
public DrumTouchInputArea() {
|
public DrumTouchInputArea()
|
||||||
|
{
|
||||||
RelativeSizeAxes = Axes.Both;
|
RelativeSizeAxes = Axes.Both;
|
||||||
RelativePositionAxes = Axes.Both;
|
RelativePositionAxes = Axes.Both;
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
@ -102,7 +103,6 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
TaikoAction taikoAction = getTaikoActionFromInput(e.ScreenSpaceTouchDownPosition);
|
TaikoAction taikoAction = getTaikoActionFromInput(e.ScreenSpaceTouchDownPosition);
|
||||||
touchActions.Add(e.Touch.Source, taikoAction);
|
touchActions.Add(e.Touch.Source, taikoAction);
|
||||||
keyBindingContainer?.TriggerPressed(touchActions[e.Touch.Source]);
|
keyBindingContainer?.TriggerPressed(touchActions[e.Touch.Source]);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -119,15 +119,18 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ShowTouchControls() {
|
public void ShowTouchControls()
|
||||||
|
{
|
||||||
visibleComponents.Animate(components => components.FadeIn(500, Easing.OutQuint));
|
visibleComponents.Animate(components => components.FadeIn(500, Easing.OutQuint));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void HideTouchControls() {
|
public void HideTouchControls()
|
||||||
|
{
|
||||||
visibleComponents.Animate(components => components.FadeOut(2000, Easing.OutQuint));
|
visibleComponents.Animate(components => components.FadeOut(2000, Easing.OutQuint));
|
||||||
}
|
}
|
||||||
|
|
||||||
private TaikoAction getTaikoActionFromInput(Vector2 inputPosition) {
|
private TaikoAction getTaikoActionFromInput(Vector2 inputPosition)
|
||||||
|
{
|
||||||
bool centreHit = inputIsCenterHit(inputPosition);
|
bool centreHit = inputIsCenterHit(inputPosition);
|
||||||
bool leftSide = inputIsOnLeftSide(inputPosition);
|
bool leftSide = inputIsOnLeftSide(inputPosition);
|
||||||
|
|
||||||
@ -136,12 +139,14 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
(leftSide ? TaikoAction.LeftRim : TaikoAction.RightRim);
|
(leftSide ? TaikoAction.LeftRim : TaikoAction.RightRim);
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool inputIsOnLeftSide(Vector2 inputPosition) {
|
private bool inputIsOnLeftSide(Vector2 inputPosition)
|
||||||
|
{
|
||||||
Vector2 inputPositionToDrumCentreDelta = touchInputDrum.ToLocalSpace(inputPosition) - touchInputDrum.OriginPosition;
|
Vector2 inputPositionToDrumCentreDelta = touchInputDrum.ToLocalSpace(inputPosition) - touchInputDrum.OriginPosition;
|
||||||
return inputPositionToDrumCentreDelta.X < 0f;
|
return inputPositionToDrumCentreDelta.X < 0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool inputIsCenterHit(Vector2 inputPosition) {
|
private bool inputIsCenterHit(Vector2 inputPosition)
|
||||||
|
{
|
||||||
Vector2 inputPositionToDrumCentreDelta = touchInputDrum.ToLocalSpace(inputPosition) - touchInputDrum.OriginPosition;
|
Vector2 inputPositionToDrumCentreDelta = touchInputDrum.ToLocalSpace(inputPosition) - touchInputDrum.OriginPosition;
|
||||||
|
|
||||||
float inputDrumRadius = Math.Max(touchInputDrum.Width, touchInputDrum.DrawHeight) / 2f;
|
float inputDrumRadius = Math.Max(touchInputDrum.Width, touchInputDrum.DrawHeight) / 2f;
|
||||||
|
Loading…
Reference in New Issue
Block a user