Skip to content

Commit

Permalink
Adding Menu Sounds
Browse files Browse the repository at this point in the history
  • Loading branch information
DizzyThermal committed Sep 21, 2023
1 parent d986c09 commit e30b5fc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions only-up-64-plugin/a-utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,11 @@ function check_menu_input(m)
if m.controller.stickY > 60 and RETURNED_NEUTRAL then
RETURNED_NEUTRAL = false
MENU_SELECTION_INDEX = MENU_SELECTION_INDEX - 1
play_sound(SOUND_MENU_CHANGE_SELECT, gMarioStates[0].marioObj.header.gfx.cameraToObject)
elseif m.controller.stickY < -60 and RETURNED_NEUTRAL then
RETURNED_NEUTRAL = false
MENU_SELECTION_INDEX = MENU_SELECTION_INDEX + 1
play_sound(SOUND_MENU_CHANGE_SELECT, gMarioStates[0].marioObj.header.gfx.cameraToObject)
elseif (m.controller.buttonPressed & A_BUTTON) ~= 0 then
local menu_size = get_menu_size()
local selectionIndex = MENU_SELECTION_INDEX % menu_size
Expand All @@ -163,6 +165,7 @@ function check_menu_input(m)
-- Main Menu
if selectionIndex == (menu_size - 1) then
-- Exit
play_sound(SOUND_MENU_PAUSE, gMarioStates[0].marioObj.header.gfx.cameraToObject)
close_menu()
elseif selectionIndex == 0 then
-- Last Warp
Expand All @@ -176,13 +179,15 @@ function check_menu_input(m)
-- Enter Submenu
MENU_INDEX = selectionIndex
MENU_SELECTION_INDEX = 0
play_sound(SOUND_MENU_PAUSE, gMarioStates[0].marioObj.header.gfx.cameraToObject)
end
else
-- Sub Menu
if selectionIndex == (menu_size - 1) then
-- Go Back
MENU_INDEX = 0
MENU_SELECTION_INDEX = 0
play_sound(SOUND_MENU_PAUSE, gMarioStates[0].marioObj.header.gfx.cameraToObject)
else
-- Last Warp
warp_from_menu()
Expand All @@ -191,6 +196,9 @@ function check_menu_input(m)
end
elseif (m.controller.buttonPressed & B_BUTTON) ~= 0 then
if MENU_INDEX == 0 then
MENU_INDEX = 0
MENU_SELECTION_INDEX = 0
play_sound(SOUND_MENU_PAUSE, gMarioStates[0].marioObj.header.gfx.cameraToObject)
close_menu()
else
MENU_INDEX = 0
Expand Down
1 change: 1 addition & 0 deletions only-up-64-plugin/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ if OU_ACTIVE and not OU_FLOOD_ACTIVE then

IN_PRACTICE_MENU = true
PRACTICE_MENU[1].text = "Last Warp" .. last_warp_string()
play_sound(SOUND_MENU_PAUSE, gMarioStates[0].marioObj.header.gfx.cameraToObject)
return true
end
hook_chat_command("only-up-practice", "- [X] Warp Menu (Must be Enabled)", PracticeMenu)
Expand Down

0 comments on commit e30b5fc

Please sign in to comment.