mirror of
https://github.com/ppy/osu.git
synced 2024-11-15 15:17:44 +08:00
alt left/right or scroll to seek to neighbouring hit objects
This commit is contained in:
parent
00f7a34139
commit
98610f4f6d
@ -593,7 +593,7 @@ namespace osu.Game.Screens.Edit
|
|||||||
|
|
||||||
protected override bool OnKeyDown(KeyDownEvent e)
|
protected override bool OnKeyDown(KeyDownEvent e)
|
||||||
{
|
{
|
||||||
if (e.ControlPressed || e.AltPressed || e.SuperPressed) return false;
|
if (e.ControlPressed || e.SuperPressed) return false;
|
||||||
|
|
||||||
switch (e.Key)
|
switch (e.Key)
|
||||||
{
|
{
|
||||||
@ -674,7 +674,7 @@ namespace osu.Game.Screens.Edit
|
|||||||
|
|
||||||
protected override bool OnScroll(ScrollEvent e)
|
protected override bool OnScroll(ScrollEvent e)
|
||||||
{
|
{
|
||||||
if (e.ControlPressed || e.AltPressed || e.SuperPressed)
|
if (e.ControlPressed || e.SuperPressed)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
const double precision = 1;
|
const double precision = 1;
|
||||||
@ -1064,8 +1064,24 @@ namespace osu.Game.Screens.Edit
|
|||||||
clock.Seek(found.Time);
|
clock.Seek(found.Time);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void seekHitObject(int direction)
|
||||||
|
{
|
||||||
|
var found = direction < 1
|
||||||
|
? editorBeatmap.HitObjects.LastOrDefault(p => p.StartTime < clock.CurrentTimeAccurate)
|
||||||
|
: editorBeatmap.HitObjects.FirstOrDefault(p => p.StartTime > clock.CurrentTimeAccurate);
|
||||||
|
|
||||||
|
if (found != null)
|
||||||
|
clock.SeekSmoothlyTo(found.StartTime);
|
||||||
|
}
|
||||||
|
|
||||||
private void seek(UIEvent e, int direction)
|
private void seek(UIEvent e, int direction)
|
||||||
{
|
{
|
||||||
|
if (e.AltPressed)
|
||||||
|
{
|
||||||
|
seekHitObject(direction);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
double amount = e.ShiftPressed ? 4 : 1;
|
double amount = e.ShiftPressed ? 4 : 1;
|
||||||
|
|
||||||
bool trackPlaying = clock.IsRunning;
|
bool trackPlaying = clock.IsRunning;
|
||||||
|
Loading…
Reference in New Issue
Block a user