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) {
|
||||||
|
@ -274,4 +276,4 @@ void audioOptionsRender(struct AudioOptions* audioOptions, struct RenderState* r
|
||||||
gSPDisplayList(renderState->dl++, audioOptions->audioLanguageDynamicText);
|
gSPDisplayList(renderState->dl++, audioOptions->audioLanguageDynamicText);
|
||||||
|
|
||||||
gSPDisplayList(renderState->dl++, ui_material_revert_list[DEJAVU_SANS_INDEX]);
|
gSPDisplayList(renderState->dl++, ui_material_revert_list[DEJAVU_SANS_INDEX]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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) {
|
||||||
|
@ -558,4 +560,4 @@ void controlsRenderSubtitle(char* message, float textOpacity, float backgroundOp
|
||||||
renderState->dl
|
renderState->dl
|
||||||
);
|
);
|
||||||
gSPDisplayList(renderState->dl++, ui_material_revert_list[DEJAVU_SANS_INDEX]);
|
gSPDisplayList(renderState->dl++, ui_material_revert_list[DEJAVU_SANS_INDEX]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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) {
|
||||||
|
@ -192,4 +194,4 @@ void gameplayOptionsRender(struct GameplayOptions* gameplayOptions, struct Rende
|
||||||
gSPDisplayList(renderState->dl++, gameplayOptions->portalRenderDepthText);
|
gSPDisplayList(renderState->dl++, gameplayOptions->portalRenderDepthText);
|
||||||
|
|
||||||
gSPDisplayList(renderState->dl++, ui_material_revert_list[DEJAVU_SANS_INDEX]);
|
gSPDisplayList(renderState->dl++, ui_material_revert_list[DEJAVU_SANS_INDEX]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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) {
|
||||||
|
@ -222,4 +224,4 @@ void joystickOptionsRender(struct JoystickOptions* joystickOptions, struct Rende
|
||||||
gSPDisplayList(renderState->dl++, joystickOptions->joystickDeadzoneText);
|
gSPDisplayList(renderState->dl++, joystickOptions->joystickDeadzoneText);
|
||||||
|
|
||||||
gSPDisplayList(renderState->dl++, ui_material_revert_list[DEJAVU_SANS_INDEX]);
|
gSPDisplayList(renderState->dl++, ui_material_revert_list[DEJAVU_SANS_INDEX]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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) {
|
||||||
--landingMenu->selectedItem;
|
if (landingMenu->selectedItem > 0) {
|
||||||
|
--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) {
|
||||||
++landingMenu->selectedItem;
|
if (landingMenu->selectedItem + 1 < landingMenu->optionCount) {
|
||||||
|
++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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -109,4 +117,4 @@ void landingMenuRender(struct LandingMenu* landingMenu, struct RenderState* rend
|
||||||
gSPDisplayList(renderState->dl++, landingMenu->optionText[i]);
|
gSPDisplayList(renderState->dl++, landingMenu->optionText[i]);
|
||||||
}
|
}
|
||||||
gSPDisplayList(renderState->dl++, ui_material_revert_list[DEJAVU_SANS_INDEX]);
|
gSPDisplayList(renderState->dl++, ui_material_revert_list[DEJAVU_SANS_INDEX]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -144,13 +144,14 @@ 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;
|
||||||
|
|
||||||
|
@ -229,4 +230,4 @@ void newGameRender(struct NewGameMenu* newGameMenu, struct RenderState* renderSt
|
||||||
gColorWhite
|
gColorWhite
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -134,4 +137,4 @@ void optionsMenuRender(struct OptionsMenu* options, struct RenderState* renderSt
|
||||||
gameplayOptionsRender(&options->gameplayOptions, renderState, task);
|
gameplayOptionsRender(&options->gameplayOptions, renderState, task);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue