mirror of
https://github.com/mwpenny/portal64-still-alive.git
synced 2024-10-20 10:37:37 -04:00
Merge pull request #323 from hackgrid/menu-improvements
Various little menu improvements
This commit is contained in:
commit
99a1303d87
|
@ -126,6 +126,7 @@ enum MenuDirection audioOptionsUpdate(struct AudioOptions* audioOptions) {
|
|||
if (audioOptions->selectedItem == AudioOptionCount) {
|
||||
audioOptions->selectedItem = 0;
|
||||
}
|
||||
soundPlayerPlay(SOUNDS_BUTTONROLLOVER, 1.0f, 0.5f, NULL, NULL, SoundTypeAll);
|
||||
}
|
||||
|
||||
if (controllerDir & ControllerDirectionUp) {
|
||||
|
@ -134,6 +135,7 @@ enum MenuDirection audioOptionsUpdate(struct AudioOptions* audioOptions) {
|
|||
} else {
|
||||
--audioOptions->selectedItem;
|
||||
}
|
||||
soundPlayerPlay(SOUNDS_BUTTONROLLOVER, 1.0f, 0.5f, NULL, NULL, SoundTypeAll);
|
||||
}
|
||||
|
||||
switch (audioOptions->selectedItem) {
|
||||
|
|
|
@ -296,6 +296,7 @@ enum MenuDirection controlsMenuUpdate(struct ControlsMenu* controlsMenu) {
|
|||
if (controlsMenu->selectedRow == ControllerActionCount + 1) {
|
||||
controlsMenu->selectedRow = 0;
|
||||
}
|
||||
soundPlayerPlay(SOUNDS_BUTTONROLLOVER, 1.0f, 0.5f, NULL, NULL, SoundTypeAll);
|
||||
}
|
||||
|
||||
if (controllerDir & ControllerDirectionUp) {
|
||||
|
@ -304,6 +305,7 @@ enum MenuDirection controlsMenuUpdate(struct ControlsMenu* controlsMenu) {
|
|||
if (controlsMenu->selectedRow < 0) {
|
||||
controlsMenu->selectedRow = ControllerActionCount;
|
||||
}
|
||||
soundPlayerPlay(SOUNDS_BUTTONROLLOVER, 1.0f, 0.5f, NULL, NULL, SoundTypeAll);
|
||||
}
|
||||
|
||||
if (controlsMenu->selectedRow >= 0 && controlsMenu->selectedRow < ControllerActionCount) {
|
||||
|
|
|
@ -83,6 +83,7 @@ enum MenuDirection gameplayOptionsUpdate(struct GameplayOptions* gameplayOptions
|
|||
if (gameplayOptions->selectedItem == GameplayOptionCount) {
|
||||
gameplayOptions->selectedItem = 0;
|
||||
}
|
||||
soundPlayerPlay(SOUNDS_BUTTONROLLOVER, 1.0f, 0.5f, NULL, NULL, SoundTypeAll);
|
||||
}
|
||||
|
||||
if (controllerDir & ControllerDirectionUp) {
|
||||
|
@ -91,6 +92,7 @@ enum MenuDirection gameplayOptionsUpdate(struct GameplayOptions* gameplayOptions
|
|||
} else {
|
||||
--gameplayOptions->selectedItem;
|
||||
}
|
||||
soundPlayerPlay(SOUNDS_BUTTONROLLOVER, 1.0f, 0.5f, NULL, NULL, SoundTypeAll);
|
||||
}
|
||||
|
||||
switch (gameplayOptions->selectedItem) {
|
||||
|
|
|
@ -92,6 +92,7 @@ enum MenuDirection joystickOptionsUpdate(struct JoystickOptions* joystickOptions
|
|||
if (joystickOptions->selectedItem == JoystickOptionCount) {
|
||||
joystickOptions->selectedItem = 0;
|
||||
}
|
||||
soundPlayerPlay(SOUNDS_BUTTONROLLOVER, 1.0f, 0.5f, NULL, NULL, SoundTypeAll);
|
||||
}
|
||||
|
||||
if (controllerDir & ControllerDirectionUp) {
|
||||
|
@ -100,6 +101,7 @@ enum MenuDirection joystickOptionsUpdate(struct JoystickOptions* joystickOptions
|
|||
} else {
|
||||
--joystickOptions->selectedItem;
|
||||
}
|
||||
soundPlayerPlay(SOUNDS_BUTTONROLLOVER, 1.0f, 0.5f, NULL, NULL, SoundTypeAll);
|
||||
}
|
||||
|
||||
switch (joystickOptions->selectedItem) {
|
||||
|
|
|
@ -71,13 +71,21 @@ void landingMenuInit(struct LandingMenu* landingMenu, struct LandingMenuOption*
|
|||
}
|
||||
|
||||
struct LandingMenuOption* landingMenuUpdate(struct LandingMenu* landingMenu) {
|
||||
if ((controllerGetDirectionDown(0) & ControllerDirectionUp) != 0 && landingMenu->selectedItem > 0) {
|
||||
--landingMenu->selectedItem;
|
||||
if ((controllerGetDirectionDown(0) & ControllerDirectionUp) != 0) {
|
||||
if (landingMenu->selectedItem > 0) {
|
||||
--landingMenu->selectedItem;
|
||||
} else {
|
||||
landingMenu->selectedItem = landingMenu->optionCount - 1;
|
||||
}
|
||||
soundPlayerPlay(SOUNDS_BUTTONROLLOVER, 1.0f, 0.5f, NULL, NULL, SoundTypeAll);
|
||||
}
|
||||
|
||||
if ((controllerGetDirectionDown(0) & ControllerDirectionDown) != 0 && landingMenu->selectedItem + 1 < landingMenu->optionCount) {
|
||||
++landingMenu->selectedItem;
|
||||
if ((controllerGetDirectionDown(0) & ControllerDirectionDown) != 0) {
|
||||
if (landingMenu->selectedItem + 1 < landingMenu->optionCount) {
|
||||
++landingMenu->selectedItem;
|
||||
} else {
|
||||
landingMenu->selectedItem = 0;
|
||||
}
|
||||
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 &&
|
||||
gChapters[newGameMenu->selectedChapter + 1].imageData) {
|
||||
newGameMenu->selectedChapter = newGameMenu->selectedChapter + 1;
|
||||
soundPlayerPlay(SOUNDS_BUTTONROLLOVER, 1.0f, 0.5f, NULL, NULL, SoundTypeAll);
|
||||
}
|
||||
|
||||
if ((controllerGetDirectionDown(0) & ControllerDirectionLeft) != 0 && newGameMenu->selectedChapter > 0) {
|
||||
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;
|
||||
|
||||
if (nextChapterOffset != newGameMenu->chapterOffset) {
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#include "../build/assets/materials/ui.h"
|
||||
|
||||
#include "../controls/controller.h"
|
||||
#include "../build/src/audio/clips.h"
|
||||
|
||||
|
||||
struct Tab gOptionTabs[] = {
|
||||
|
@ -87,6 +88,7 @@ enum MenuDirection optionsMenuUpdate(struct OptionsMenu* options) {
|
|||
}
|
||||
|
||||
tabsSetSelectedTab(&options->tabs, options->tabs.selectedTab);
|
||||
soundPlayerPlay(SOUNDS_BUTTONROLLOVER, 1.0f, 0.5f, NULL, NULL, SoundTypeAll);
|
||||
}
|
||||
|
||||
if (menuDirection == MenuDirectionRight) {
|
||||
|
@ -95,6 +97,7 @@ enum MenuDirection optionsMenuUpdate(struct OptionsMenu* options) {
|
|||
} else {
|
||||
tabsSetSelectedTab(&options->tabs, options->tabs.selectedTab + 1);
|
||||
}
|
||||
soundPlayerPlay(SOUNDS_BUTTONROLLOVER, 1.0f, 0.5f, NULL, NULL, SoundTypeAll);
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue