mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 10:12:54 +08:00
Refactor UI and add drag support
This commit is contained in:
parent
40ff2d50dd
commit
161c54df1c
@ -13,7 +13,6 @@ using osu.Game.Graphics;
|
|||||||
using osuTK.Graphics;
|
using osuTK.Graphics;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using osu.Framework.Logging;
|
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Catch.UI
|
namespace osu.Game.Rulesets.Catch.UI
|
||||||
{
|
{
|
||||||
@ -174,8 +173,7 @@ namespace osu.Game.Rulesets.Catch.UI
|
|||||||
if (!trackedActions.ContainsKey(e.Touch.Source))
|
if (!trackedActions.ContainsKey(e.Touch.Source))
|
||||||
trackedActions.Add(e.Touch.Source, TouchCatchAction.None);
|
trackedActions.Add(e.Touch.Source, TouchCatchAction.None);
|
||||||
|
|
||||||
trackedActions[e.Touch.Source] = getTouchCatchActionFromInput(e.ScreenSpaceTouchDownPosition);
|
trackedActions[e.Touch.Source] = getTouchCatchActionFromInput(e.ScreenSpaceTouch.Position);
|
||||||
|
|
||||||
calculateActiveKeys();
|
calculateActiveKeys();
|
||||||
|
|
||||||
base.OnTouchMove(e);
|
base.OnTouchMove(e);
|
||||||
@ -183,7 +181,7 @@ namespace osu.Game.Rulesets.Catch.UI
|
|||||||
|
|
||||||
protected override bool OnTouchDown(TouchDownEvent e)
|
protected override bool OnTouchDown(TouchDownEvent e)
|
||||||
{
|
{
|
||||||
handleDown(e.Touch.Source, e.ScreenSpaceTouchDownPosition);
|
handleDown(e.Touch.Source, e.ScreenSpaceTouch.Position);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -241,10 +239,7 @@ namespace osu.Game.Rulesets.Catch.UI
|
|||||||
if (leftBox.Contains(inputPosition))
|
if (leftBox.Contains(inputPosition))
|
||||||
return TouchCatchAction.MoveLeft;
|
return TouchCatchAction.MoveLeft;
|
||||||
if (rightBox.Contains(inputPosition))
|
if (rightBox.Contains(inputPosition))
|
||||||
{
|
|
||||||
Logger.Log(inputPosition.ToString());
|
|
||||||
return TouchCatchAction.MoveRight;
|
return TouchCatchAction.MoveRight;
|
||||||
}
|
|
||||||
return TouchCatchAction.None;
|
return TouchCatchAction.None;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user