Add menu cursor wrapping

pull/230/head
Flashfyre 2024-04-21 18:45:14 -04:00
parent 1eaa5c0d79
commit 1a53c19e3b
1 changed files with 4 additions and 0 deletions

View File

@ -336,10 +336,14 @@ export default class MenuUiHandler extends MessageUiHandler {
case Button.UP: case Button.UP:
if (this.cursor) if (this.cursor)
success = this.setCursor(this.cursor - 1); success = this.setCursor(this.cursor - 1);
else
success = this.setCursor(this.menuOptions.length - 1);
break; break;
case Button.DOWN: case Button.DOWN:
if (this.cursor + 1 < this.menuOptions.length) if (this.cursor + 1 < this.menuOptions.length)
success = this.setCursor(this.cursor + 1); success = this.setCursor(this.cursor + 1);
else
success = this.setCursor(0);
break; break;
} }
} }