From 1a53c19e3b504313e3aa8ff2f962ff3a6cf87d20 Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Sun, 21 Apr 2024 18:45:14 -0400 Subject: [PATCH] Add menu cursor wrapping --- src/ui/menu-ui-handler.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ui/menu-ui-handler.ts b/src/ui/menu-ui-handler.ts index 88a80f7d2..8b2c56469 100644 --- a/src/ui/menu-ui-handler.ts +++ b/src/ui/menu-ui-handler.ts @@ -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; } }