diff options
author | Sergeanur <s.anureev@yandex.ua> | 2021-02-03 20:43:25 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-03 20:43:25 +0100 |
commit | 91c3bdfa15188054295e04b5152aa9169c38ce07 (patch) | |
tree | cccd13a63bfda33ac24af29ce7a6a15f880dd59d /src/core/ControllerConfig.cpp | |
parent | and a space (diff) | |
parent | Add undef (diff) | |
download | re3-91c3bdfa15188054295e04b5152aa9169c38ce07.tar re3-91c3bdfa15188054295e04b5152aa9169c38ce07.tar.gz re3-91c3bdfa15188054295e04b5152aa9169c38ce07.tar.bz2 re3-91c3bdfa15188054295e04b5152aa9169c38ce07.tar.lz re3-91c3bdfa15188054295e04b5152aa9169c38ce07.tar.xz re3-91c3bdfa15188054295e04b5152aa9169c38ce07.tar.zst re3-91c3bdfa15188054295e04b5152aa9169c38ce07.zip |
Diffstat (limited to 'src/core/ControllerConfig.cpp')
-rw-r--r-- | src/core/ControllerConfig.cpp | 38 |
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 |