From 1dde0b7a9faa578e6ed043dd1342274508e173df Mon Sep 17 00:00:00 2001 From: darktiny Date: Tue, 9 Apr 2024 07:28:28 +0800 Subject: [PATCH] Fix __f08_menu_items index 1 never used --- source/p8GlobalLuaFunctions.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/p8GlobalLuaFunctions.h b/source/p8GlobalLuaFunctions.h index 6d40bd3d..ddd0be78 100644 --- a/source/p8GlobalLuaFunctions.h +++ b/source/p8GlobalLuaFunctions.h @@ -153,8 +153,8 @@ function menuitem(index, label, callback) callback = nil end - __f08_menu_items[index + 1][1] = label - __f08_menu_items[index + 1][2] = callback + __f08_menu_items[index][1] = label + __f08_menu_items[index][2] = callback end function __addbreadcrumb(label, carttoload) @@ -185,7 +185,7 @@ function __f08_menu_update() until __f08_menu_items[__f08_menu_selected][1] ~= nil end - if btnp(2) and __f08_menu_selected > 1 then + if btnp(2) and __f08_menu_selected > 0 then repeat __f08_menu_selected = __f08_menu_selected - 1 until __f08_menu_items[__f08_menu_selected][1] ~= nil