summaryrefslogtreecommitdiffstats
path: root/src/core/ControllerConfig.cpp
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2021-02-03 01:41:12 +0100
committerSergeanur <s.anureev@yandex.ua>2021-02-03 01:41:12 +0100
commit91612eb45a4195484b43e446907317dbffbff730 (patch)
treee240252a44da318e5854d851e524a3ada6ca869c /src/core/ControllerConfig.cpp
parentAdd radio off text (diff)
downloadre3-91612eb45a4195484b43e446907317dbffbff730.tar
re3-91612eb45a4195484b43e446907317dbffbff730.tar.gz
re3-91612eb45a4195484b43e446907317dbffbff730.tar.bz2
re3-91612eb45a4195484b43e446907317dbffbff730.tar.lz
re3-91612eb45a4195484b43e446907317dbffbff730.tar.xz
re3-91612eb45a4195484b43e446907317dbffbff730.tar.zst
re3-91612eb45a4195484b43e446907317dbffbff730.zip
Diffstat (limited to 'src/core/ControllerConfig.cpp')
-rw-r--r--src/core/ControllerConfig.cpp38
1 files changed, 29 insertions, 9 deletions
diff --git a/src/core/ControllerConfig.cpp b/src/core/ControllerConfig.cpp
index 4115cd38..83d0f669 100644
--- a/src/core/ControllerConfig.cpp
+++ b/src/core/ControllerConfig.cpp
@@ -2619,11 +2619,6 @@ const char *XboxButtons[][MAX_CONTROLLERACTIONS] = CONTROLLER_BUTTONS("~T~", "~O
#define PS2_CIRCLE "|"
#define PS2_CROSS "/"
#define PS2_SQUARE "^"
-#elif defined(BUTTON_ICONS)
-#define PS2_TRIANGLE "~T~"
-#define PS2_CIRCLE "~O~"
-#define PS2_CROSS "~X~"
-#define PS2_SQUARE "~Q~"
#else
#define PS2_TRIANGLE "TRIANGLE"
#define PS2_CIRCLE "CIRCLE"
@@ -2636,7 +2631,7 @@ const char *PlayStationButtons_noIcons[][MAX_CONTROLLERACTIONS] =
#ifdef BUTTON_ICONS
const char *PlayStationButtons[][MAX_CONTROLLERACTIONS] =
- CONTROLLER_BUTTONS(PS2_TRIANGLE, PS2_CIRCLE, PS2_CROSS, PS2_SQUARE, "~K~", "~M~", "~A~", "~J~", "~V~", "~C~", "SELECT");
+ CONTROLLER_BUTTONS("~T~", "~O~", "~X~", "~Q~", "~K~", "~M~", "~A~", "~J~", "~V~", "~C~", "SELECT");
#endif
#undef PS2_TRIANGLE
@@ -2653,11 +2648,36 @@ void CControllerConfigManager::GetWideStringOfCommandKeys(uint16 action, wchar *
if (CPad::GetPad(0)->IsAffectedByController) {
wchar wstr[16];
- // TODO: INI and/or menu setting for Xbox/PS switch
+ const char* (*Buttons)[MAX_CONTROLLERACTIONS];
+
#ifdef BUTTON_ICONS
- const char *(*Buttons)[MAX_CONTROLLERACTIONS] = CFont::ButtonsSlot != -1 ? XboxButtons : XboxButtons_noIcons;
+ #ifdef GAMEPAD_MENU
+ switch (FrontEndMenuManager.m_PrefsControllerType)
+ {
+ case CMenuManager::CONTROLLER_DUALSHOCK2:
+ case CMenuManager::CONTROLLER_DUALSHOCK3:
+ case CMenuManager::CONTROLLER_DUALSHOCK4:
+ Buttons = CFont::ButtonsSlot != -1 ? PlayStationButtons : PlayStationButtons_noIcons;
+ break;
+ default:
+ #endif
+ Buttons = CFont::ButtonsSlot != -1 ? XboxButtons : XboxButtons_noIcons;
+ #ifdef GAMEPAD_MENU
+ break;
+ }
+ #endif
#else
- const char *(*Buttons)[MAX_CONTROLLERACTIONS] = XboxButtons_noIcons;
+ switch (FrontEndMenuManager.m_PrefsControllerType)
+ {
+ case CMenuManager::CONTROLLER_DUALSHOCK2:
+ case CMenuManager::CONTROLLER_DUALSHOCK3:
+ case CMenuManager::CONTROLLER_DUALSHOCK4:
+ Buttons = PlayStationButtons_noIcons;
+ break;
+ default:
+ Buttons = XboxButtons_noIcons;
+ break;
+ }
#endif
assert(Buttons[CPad::GetPad(0)->Mode][action] != nil); // we cannot use these