mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-02-16 17:27:41 +00:00
Add menu cursor wrapping
This commit is contained in:
parent
1eaa5c0d79
commit
1a53c19e3b
@ -336,10 +336,14 @@ export default class MenuUiHandler extends MessageUiHandler {
|
||||
case Button.UP:
|
||||
if (this.cursor)
|
||||
success = this.setCursor(this.cursor - 1);
|
||||
else
|
||||
success = this.setCursor(this.menuOptions.length - 1);
|
||||
break;
|
||||
case Button.DOWN:
|
||||
if (this.cursor + 1 < this.menuOptions.length)
|
||||
success = this.setCursor(this.cursor + 1);
|
||||
else
|
||||
success = this.setCursor(0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user