Skip to content

Commit

Permalink
Ensure the previous selection timer is cancelled if the random button…
Browse files Browse the repository at this point in the history
… was released
  • Loading branch information
Rian8337 committed Aug 20, 2023
1 parent 821c12e commit 412e213
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/ru/nsu/ccfit/zuev/osu/menu/SongMenu.java
Original file line number Diff line number Diff line change
Expand Up @@ -533,11 +533,7 @@ public void run() {

@Override
public boolean cancel() {
if (previousSelectionTimer != null) {
previousSelectionTimer.cancel();
previousSelectionTimer = null;
}

previousSelectionTimer = null;
return super.cancel();
}
}, previousSelectionInterval, previousSelectionInterval);
Expand All @@ -547,14 +543,15 @@ public boolean cancel() {
}
if (pSceneTouchEvent.isActionUp()) {
setFrame(0);
if (!isSelectComplete) {
return true;
}

if (previousSelectionTimer != null) {
previousSelectionTimer.cancel();
}

if (!isSelectComplete) {
return true;
}

if (!moved && !previousSelectionPerformed) {
velocityY = 0;
if (items.size() <= 1) {
Expand Down

0 comments on commit 412e213

Please sign in to comment.