Binding button behavior to the controller

This commit is contained in:
Dima353
2026-07-17 23:34:55 +03:00
parent 722a9a5209
commit edd62c1a44
4 changed files with 38 additions and 16 deletions
+12 -13
View File
@@ -103,12 +103,11 @@ int GetOptionCount(int screen)
#ifdef TRIANGLE_BACK_BUTTON
#define GetBackJustUp GetTriangleJustUp
#define GetBackJustDown GetTriangleJustDown
#elif defined(CIRCLE_BACK_BUTTON)
#define GetBackJustUp GetCrossJustUp
#define GetBackJustDown GetCrossJustDown
#else
#define GetBackJustUp GetSquareJustUp
#define GetBackJustDown GetSquareJustDown
// Menu cancel/back follows the selected controller type (see CPad::GetMenuCancel*).
// This supersedes the old CIRCLE_BACK_BUTTON mapping.
#define GetBackJustUp GetMenuCancelJustUp
#define GetBackJustDown GetMenuCancelJustDown
#endif
#ifdef MENU_MAP
@@ -542,7 +541,7 @@ CMenuManager::ProcessList(bool &goBack, bool &optionSelected)
}
#ifndef TIDY_UP_PBP
if (CPad::GetPad(0)->GetEnterJustDown() || CPad::GetPad(0)->GetCircleJustDown()) {
if (CPad::GetPad(0)->GetEnterJustDown() || CPad::GetPad(0)->GetMenuConfirmJustDown()) {
m_bShowMouse = 0;
optionSelected = true;
}
@@ -4348,7 +4347,7 @@ CMenuManager::ProcessButtonPresses(void)
} else if (isPlainTextScreen(m_nCurrScreen)) {
#ifndef TIDY_UP_PBP
if (CPad::GetPad(0)->GetEnterJustDown() || CPad::GetPad(0)->GetCircleJustDown() || CPad::GetPad(0)->GetLeftMouseJustDown()) {
if (CPad::GetPad(0)->GetEnterJustDown() || CPad::GetPad(0)->GetMenuConfirmJustDown() || CPad::GetPad(0)->GetLeftMouseJustDown()) {
optionSelected = true;
}
if (CPad::GetPad(0)->GetEscapeJustDown() || CPad::GetPad(0)->GetBackJustUp()) {
@@ -4375,12 +4374,12 @@ CMenuManager::ProcessButtonPresses(void)
#ifndef TIDY_UP_PBP
if ((m_nCurrOption == 0) && (m_nCurrScreen == MENUPAGE_PAUSE_MENU)) {
if (CPad::GetPad(0)->GetEnterJustUp() || CPad::GetPad(0)->GetCircleJustUp()) {
if (CPad::GetPad(0)->GetEnterJustUp() || CPad::GetPad(0)->GetMenuConfirmJustUp()) {
m_bShowMouse = false;
optionSelected = true;
}
} else {
if (CPad::GetPad(0)->GetEnterJustDown() || CPad::GetPad(0)->GetCircleJustDown()) {
if (CPad::GetPad(0)->GetEnterJustDown() || CPad::GetPad(0)->GetMenuConfirmJustDown()) {
m_bShowMouse = false;
optionSelected = true;
}
@@ -4685,7 +4684,7 @@ CMenuManager::ProcessButtonPresses(void)
// Centralized enter/back (except some conditions)
#ifdef TIDY_UP_PBP
if (aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_Action != MENUACTION_RESUME) {
if (CPad::GetPad(0)->GetEnterJustDown() || CPad::GetPad(0)->GetCircleJustDown() ||
if (CPad::GetPad(0)->GetEnterJustDown() || CPad::GetPad(0)->GetMenuConfirmJustDown() ||
(isPlainTextScreen(m_nCurrScreen) && CPad::GetPad(0)->GetLeftMouseJustDown())) {
if (!isPlainTextScreen(m_nCurrScreen))
@@ -4694,7 +4693,7 @@ CMenuManager::ProcessButtonPresses(void)
optionSelected = true;
}
} else {
if (CPad::GetPad(0)->GetEnterJustUp() || CPad::GetPad(0)->GetCircleJustUp()) {
if (CPad::GetPad(0)->GetEnterJustUp() || CPad::GetPad(0)->GetMenuConfirmJustUp()) {
m_bShowMouse = false;
optionSelected = true;
}
@@ -4726,7 +4725,7 @@ CMenuManager::ProcessButtonPresses(void)
DMAudio.PlayFrontEndTrack(m_PrefsRadioStation, TRUE);
return;
} else if (bottomBarActive) {
if (CPad::GetPad(0)->GetEnterJustDown() || CPad::GetPad(0)->GetCircleJustDown()) {
if (CPad::GetPad(0)->GetEnterJustDown() || CPad::GetPad(0)->GetMenuConfirmJustDown()) {
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_NAVIGATION, 0);
bottomBarActive = false;
@@ -6479,7 +6478,7 @@ CMenuManager::PrintMap(void)
// Adding marker
if (m_nMenuFadeAlpha >= 255) {
if (CPad::GetPad(0)->GetRightMouseJustDown() || CPad::GetPad(0)->GetCircleJustDown()) {
if (CPad::GetPad(0)->GetRightMouseJustDown() || CPad::GetPad(0)->GetMenuConfirmJustDown()) {
if (mapCrosshair.y > fMapCenterY - fMapSize && mapCrosshair.y < fMapCenterY + fMapSize &&
mapCrosshair.x > fMapCenterX - fMapSize && mapCrosshair.x < fMapCenterX + fMapSize) {