Add sound to indicate switching option items and tabs. Enable main and game menu to cycle through menu items.
This commit is contained in:
parent
9f7e15e3fd
commit
831370efeb
|
@ -126,6 +126,7 @@ enum MenuDirection audioOptionsUpdate(struct AudioOptions* audioOptions) {
|
||||||
if (audioOptions->selectedItem == AudioOptionCount) {
|
if (audioOptions->selectedItem == AudioOptionCount) {
|
||||||
audioOptions->selectedItem = 0;
|
audioOptions->selectedItem = 0;
|
||||||
}
|
}
|
||||||
|
soundPlayerPlay(SOUNDS_BUTTONROLLOVER, 1.0f, 0.5f, NULL, NULL, SoundTypeAll);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (controllerDir & ControllerDirectionUp) {
|
if (controllerDir & ControllerDirectionUp) {
|
||||||
|
@ -134,6 +135,7 @@ enum MenuDirection audioOptionsUpdate(struct AudioOptions* audioOptions) {
|
||||||
} else {
|
} else {
|
||||||
--audioOptions->selectedItem;
|
--audioOptions->selectedItem;
|
||||||
}
|
}
|
||||||
|
soundPlayerPlay(SOUNDS_BUTTONROLLOVER, 1.0f, 0.5f, NULL, NULL, SoundTypeAll);
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (audioOptions->selectedItem) {
|
switch (audioOptions->selectedItem) {
|
||||||
|
|
|
@ -296,6 +296,7 @@ enum MenuDirection controlsMenuUpdate(struct ControlsMenu* controlsMenu) {
|
||||||
if (controlsMenu->selectedRow == ControllerActionCount + 1) {
|
if (controlsMenu->selectedRow == ControllerActionCount + 1) {
|
||||||
controlsMenu->selectedRow = 0;
|
controlsMenu->selectedRow = 0;
|
||||||
}
|
}
|
||||||
|
soundPlayerPlay(SOUNDS_BUTTONROLLOVER, 1.0f, 0.5f, NULL, NULL, SoundTypeAll);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (controllerDir & ControllerDirectionUp) {
|
if (controllerDir & ControllerDirectionUp) {
|
||||||
|
@ -304,6 +305,7 @@ enum MenuDirection controlsMenuUpdate(struct ControlsMenu* controlsMenu) {
|
||||||
if (controlsMenu->selectedRow < 0) {
|
if (controlsMenu->selectedRow < 0) {
|
||||||
controlsMenu->selectedRow = ControllerActionCount;
|
controlsMenu->selectedRow = ControllerActionCount;
|
||||||
}
|
}
|
||||||
|
soundPlayerPlay(SOUNDS_BUTTONROLLOVER, 1.0f, 0.5f, NULL, NULL, SoundTypeAll);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (controlsMenu->selectedRow >= 0 && controlsMenu->selectedRow < ControllerActionCount) {
|
if (controlsMenu->selectedRow >= 0 && controlsMenu->selectedRow < ControllerActionCount) {
|
||||||
|
|
|
@ -83,6 +83,7 @@ enum MenuDirection gameplayOptionsUpdate(struct GameplayOptions* gameplayOptions
|
||||||
if (gameplayOptions->selectedItem == GameplayOptionCount) {
|
if (gameplayOptions->selectedItem == GameplayOptionCount) {
|
||||||
gameplayOptions->selectedItem = 0;
|
gameplayOptions->selectedItem = 0;
|
||||||
}
|
}
|
||||||
|
soundPlayerPlay(SOUNDS_BUTTONROLLOVER, 1.0f, 0.5f, NULL, NULL, SoundTypeAll);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (controllerDir & ControllerDirectionUp) {
|
if (controllerDir & ControllerDirectionUp) {
|
||||||
|
@ -91,6 +92,7 @@ enum MenuDirection gameplayOptionsUpdate(struct GameplayOptions* gameplayOptions
|
||||||
} else {
|
} else {
|
||||||
--gameplayOptions->selectedItem;
|
--gameplayOptions->selectedItem;
|
||||||
}
|
}
|
||||||
|
soundPlayerPlay(SOUNDS_BUTTONROLLOVER, 1.0f, 0.5f, NULL, NULL, SoundTypeAll);
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (gameplayOptions->selectedItem) {
|
switch (gameplayOptions->selectedItem) {
|
||||||
|
|
|
@ -92,6 +92,7 @@ enum MenuDirection joystickOptionsUpdate(struct JoystickOptions* joystickOptions
|
||||||
if (joystickOptions->selectedItem == JoystickOptionCount) {
|
if (joystickOptions->selectedItem == JoystickOptionCount) {
|
||||||
joystickOptions->selectedItem = 0;
|
joystickOptions->selectedItem = 0;
|
||||||
}
|
}
|
||||||
|
soundPlayerPlay(SOUNDS_BUTTONROLLOVER, 1.0f, 0.5f, NULL, NULL, SoundTypeAll);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (controllerDir & ControllerDirectionUp) {
|
if (controllerDir & ControllerDirectionUp) {
|
||||||
|
@ -100,6 +101,7 @@ enum MenuDirection joystickOptionsUpdate(struct JoystickOptions* joystickOptions
|
||||||
} else {
|
} else {
|
||||||
--joystickOptions->selectedItem;
|
--joystickOptions->selectedItem;
|
||||||
}
|
}
|
||||||
|
soundPlayerPlay(SOUNDS_BUTTONROLLOVER, 1.0f, 0.5f, NULL, NULL, SoundTypeAll);
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (joystickOptions->selectedItem) {
|
switch (joystickOptions->selectedItem) {
|
||||||
|
|
|
@ -71,13 +71,21 @@ void landingMenuInit(struct LandingMenu* landingMenu, struct LandingMenuOption*
|
||||||
}
|
}
|
||||||
|
|
||||||
struct LandingMenuOption* landingMenuUpdate(struct LandingMenu* landingMenu) {
|
struct LandingMenuOption* landingMenuUpdate(struct LandingMenu* landingMenu) {
|
||||||
if ((controllerGetDirectionDown(0) & ControllerDirectionUp) != 0 && landingMenu->selectedItem > 0) {
|
if ((controllerGetDirectionDown(0) & ControllerDirectionUp) != 0) {
|
||||||
|
if (landingMenu->selectedItem > 0) {
|
||||||
--landingMenu->selectedItem;
|
--landingMenu->selectedItem;
|
||||||
|
} else {
|
||||||
|
landingMenu->selectedItem = landingMenu->optionCount - 1;
|
||||||
|
}
|
||||||
soundPlayerPlay(SOUNDS_BUTTONROLLOVER, 1.0f, 0.5f, NULL, NULL, SoundTypeAll);
|
soundPlayerPlay(SOUNDS_BUTTONROLLOVER, 1.0f, 0.5f, NULL, NULL, SoundTypeAll);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((controllerGetDirectionDown(0) & ControllerDirectionDown) != 0 && landingMenu->selectedItem + 1 < landingMenu->optionCount) {
|
if ((controllerGetDirectionDown(0) & ControllerDirectionDown) != 0) {
|
||||||
|
if (landingMenu->selectedItem + 1 < landingMenu->optionCount) {
|
||||||
++landingMenu->selectedItem;
|
++landingMenu->selectedItem;
|
||||||
|
} else {
|
||||||
|
landingMenu->selectedItem = 0;
|
||||||
|
}
|
||||||
soundPlayerPlay(SOUNDS_BUTTONROLLOVER, 1.0f, 0.5f, NULL, NULL, SoundTypeAll);
|
soundPlayerPlay(SOUNDS_BUTTONROLLOVER, 1.0f, 0.5f, NULL, NULL, SoundTypeAll);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -144,14 +144,15 @@ enum MenuDirection newGameUpdate(struct NewGameMenu* newGameMenu) {
|
||||||
newGameMenu->selectedChapter + 1 < newGameMenu->chapterCount &&
|
newGameMenu->selectedChapter + 1 < newGameMenu->chapterCount &&
|
||||||
gChapters[newGameMenu->selectedChapter + 1].imageData) {
|
gChapters[newGameMenu->selectedChapter + 1].imageData) {
|
||||||
newGameMenu->selectedChapter = newGameMenu->selectedChapter + 1;
|
newGameMenu->selectedChapter = newGameMenu->selectedChapter + 1;
|
||||||
soundPlayerPlay(SOUNDS_BUTTONROLLOVER, 1.0f, 0.5f, NULL, NULL, SoundTypeAll);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((controllerGetDirectionDown(0) & ControllerDirectionLeft) != 0 && newGameMenu->selectedChapter > 0) {
|
if ((controllerGetDirectionDown(0) & ControllerDirectionLeft) != 0 && newGameMenu->selectedChapter > 0) {
|
||||||
newGameMenu->selectedChapter = newGameMenu->selectedChapter - 1;
|
newGameMenu->selectedChapter = newGameMenu->selectedChapter - 1;
|
||||||
soundPlayerPlay(SOUNDS_BUTTONROLLOVER, 1.0f, 0.5f, NULL, NULL, SoundTypeAll);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((controllerGetDirectionDown(0) & ControllerDirectionLeft) != 0 || (controllerGetDirectionDown(0) & ControllerDirectionRight) != 0)
|
||||||
|
soundPlayerPlay(SOUNDS_BUTTONROLLOVER, 1.0f, 0.5f, NULL, NULL, SoundTypeAll);
|
||||||
|
|
||||||
int nextChapterOffset = newGameMenu->selectedChapter & ~1;
|
int nextChapterOffset = newGameMenu->selectedChapter & ~1;
|
||||||
|
|
||||||
if (nextChapterOffset != newGameMenu->chapterOffset) {
|
if (nextChapterOffset != newGameMenu->chapterOffset) {
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#include "../build/assets/materials/ui.h"
|
#include "../build/assets/materials/ui.h"
|
||||||
|
|
||||||
#include "../controls/controller.h"
|
#include "../controls/controller.h"
|
||||||
|
#include "../build/src/audio/clips.h"
|
||||||
|
|
||||||
|
|
||||||
struct Tab gOptionTabs[] = {
|
struct Tab gOptionTabs[] = {
|
||||||
|
@ -87,6 +88,7 @@ enum MenuDirection optionsMenuUpdate(struct OptionsMenu* options) {
|
||||||
}
|
}
|
||||||
|
|
||||||
tabsSetSelectedTab(&options->tabs, options->tabs.selectedTab);
|
tabsSetSelectedTab(&options->tabs, options->tabs.selectedTab);
|
||||||
|
soundPlayerPlay(SOUNDS_BUTTONROLLOVER, 1.0f, 0.5f, NULL, NULL, SoundTypeAll);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (menuDirection == MenuDirectionRight) {
|
if (menuDirection == MenuDirectionRight) {
|
||||||
|
@ -95,6 +97,7 @@ enum MenuDirection optionsMenuUpdate(struct OptionsMenu* options) {
|
||||||
} else {
|
} else {
|
||||||
tabsSetSelectedTab(&options->tabs, options->tabs.selectedTab + 1);
|
tabsSetSelectedTab(&options->tabs, options->tabs.selectedTab + 1);
|
||||||
}
|
}
|
||||||
|
soundPlayerPlay(SOUNDS_BUTTONROLLOVER, 1.0f, 0.5f, NULL, NULL, SoundTypeAll);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue