1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 12:33:01 +08:00

Use input events rather than scene graph traversals

This commit is contained in:
smoogipoo 2018-11-30 15:47:55 +09:00
parent e83f6707bf
commit bc3fcb87b7

View File

@ -163,10 +163,10 @@ namespace osu.Game.Screens.Edit
switch (e.Key)
{
case Key.Left:
seek(-1);
seek(e, -1);
return true;
case Key.Right:
seek(1);
seek(e, 1);
return true;
}
@ -184,9 +184,9 @@ namespace osu.Game.Screens.Edit
while (Math.Abs(scrollAccumulation) > precision)
{
if (scrollAccumulation > 0)
seek(-1);
seek(e, -1);
else
seek(1);
seek(e, 1);
scrollAccumulation = scrollAccumulation < 0 ? Math.Min(0, scrollAccumulation + precision) : Math.Max(0, scrollAccumulation - precision);
}
@ -241,9 +241,9 @@ namespace osu.Game.Screens.Edit
LoadComponentAsync(currentScreen, screenContainer.Add);
}
private void seek(int direction)
private void seek(UIEvent e, int direction)
{
double amount = GetContainingInputManager().CurrentState.Keyboard.ShiftPressed ? 2 : 1;
double amount = e.ShiftPressed ? 2 : 1;
if (direction < 1)
clock.SeekBackward(!clock.IsRunning, amount);