summaryrefslogtreecommitdiffstats
path: root/src/core/ControllerConfig.cpp
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2021-02-10 07:57:51 +0100
committerSergeanur <s.anureev@yandex.ua>2021-02-10 07:57:51 +0100
commit12330e38cb3c2a023bc1327cb89afd19efed0a43 (patch)
treee1db738c39b18b532ef4fe5ac67d8d0cc25b5064 /src/core/ControllerConfig.cpp
parentfix (diff)
downloadre3-12330e38cb3c2a023bc1327cb89afd19efed0a43.tar
re3-12330e38cb3c2a023bc1327cb89afd19efed0a43.tar.gz
re3-12330e38cb3c2a023bc1327cb89afd19efed0a43.tar.bz2
re3-12330e38cb3c2a023bc1327cb89afd19efed0a43.tar.lz
re3-12330e38cb3c2a023bc1327cb89afd19efed0a43.tar.xz
re3-12330e38cb3c2a023bc1327cb89afd19efed0a43.tar.zst
re3-12330e38cb3c2a023bc1327cb89afd19efed0a43.zip
Diffstat (limited to 'src/core/ControllerConfig.cpp')
-rw-r--r--src/core/ControllerConfig.cpp50
1 files changed, 35 insertions, 15 deletions
diff --git a/src/core/ControllerConfig.cpp b/src/core/ControllerConfig.cpp
index 7f634619..727ad06b 100644
--- a/src/core/ControllerConfig.cpp
+++ b/src/core/ControllerConfig.cpp
@@ -2416,7 +2416,7 @@ int32 CControllerConfigManager::GetNumOfSettingsForAction(e_ControllerAction act
#define VFB(b)
#endif
-#define CONTROLLER_BUTTONS(T, O, X, Q, L1, L2, L3, R1, R2, R3, SELECT, RSL, RSR) \
+#define CONTROLLER_BUTTONS(T, O, X, Q, L1, L2, L3, R1, R2, R3, SELECT, RSU, RSD, RSL, RSR) \
{{ \
O, /* PED_FIREWEAPON */ \
R2, /* PED_CYCLE_WEAPON_RIGHT */ \
@@ -2576,8 +2576,8 @@ int32 CControllerConfigManager::GetNumOfSettingsForAction(e_ControllerAction act
L3, /* PED_DUCK */ \
L1, /* PED_ANSWER_PHONE */ \
VFB(R1) /* VEHICLE_FIREWEAPON */ \
- nil, /* VEHICLE_ACCELERATE */ \
- nil, /* VEHICLE_BRAKE */ \
+ RSU, /* VEHICLE_ACCELERATE */ \
+ RSD, /* VEHICLE_BRAKE */ \
O, /* VEHICLE_CHANGE_RADIO_STATION */ \
L3, /* VEHICLE_HORN */ \
Q, /* TOGGLE_SUBMISSIONS */ \
@@ -2618,10 +2618,10 @@ int32 CControllerConfigManager::GetNumOfSettingsForAction(e_ControllerAction act
#define RIGHT "RIGHT"
#endif
-const char *XboxButtons_noIcons[][MAX_CONTROLLERACTIONS] = CONTROLLER_BUTTONS("Y", "B", "A", "X", "LB", "LT", "LS", "RB", "RT", "RS", "BACK", "right stick left", "right stick right");
+const char *XboxButtons_noIcons[][MAX_CONTROLLERACTIONS] = CONTROLLER_BUTTONS("Y", "B", "A", "X", "LB", "LT", "LS", "RB", "RT", "RS", "BACK", "right stick up", "right stick down", "right stick left", "right stick right");
#ifdef BUTTON_ICONS
-const char *XboxButtons[][MAX_CONTROLLERACTIONS] = CONTROLLER_BUTTONS("~T~", "~O~", "~X~", "~Q~", "~K~", "~M~", "~A~", "~J~", "~V~", "~C~", "BACK", "~(~", "~)~");
+const char *XboxButtons[][MAX_CONTROLLERACTIONS] = CONTROLLER_BUTTONS("~T~", "~O~", "~X~", "~Q~", "~K~", "~M~", "~A~", "~J~", "~V~", "~C~", "BACK", "~H~", "~L~", "~(~", "~)~");
#endif
@@ -2630,11 +2630,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"
@@ -2643,11 +2638,11 @@ const char *XboxButtons[][MAX_CONTROLLERACTIONS] = CONTROLLER_BUTTONS("~T~", "~O
#endif
const char *PlayStationButtons_noIcons[][MAX_CONTROLLERACTIONS] =
- CONTROLLER_BUTTONS(PS2_TRIANGLE, PS2_CIRCLE, PS2_CROSS, PS2_SQUARE, "L1", "L2", "L3", "R1", "R2", "R3", "SELECT", "right stick left", "right stick right");
+ CONTROLLER_BUTTONS(PS2_TRIANGLE, PS2_CIRCLE, PS2_CROSS, PS2_SQUARE, "L1", "L2", "L3", "R1", "R2", "R3", "SELECT", "right stick up", "right stick down", "right stick left", "right stick right");
#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", "~H~", "~L~", "~(~", "~)~");
#endif
#undef PS2_TRIANGLE
@@ -2669,11 +2664,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