Swap kbm keybinds for gamepad commands when trying to displayed localized button string and using controller
This commit is contained in:
parent
2c3bfbe62a
commit
eaa6e6fb8c
@ -1377,12 +1377,23 @@ namespace Components
|
||||
InitDvars();
|
||||
}
|
||||
|
||||
const char* Gamepad::GetGamePadCommand(const char* command)
|
||||
{
|
||||
if (strcmp(command, "+activate") == 0 || strcmp(command, "+reload") == 0)
|
||||
return "+usereload";
|
||||
if (strcmp(command, "+melee_breath") == 0)
|
||||
return "+holdbreath";
|
||||
|
||||
return command;
|
||||
}
|
||||
|
||||
int Gamepad::Key_GetCommandAssignmentInternal_Hk(const char* cmd, int (*keys)[2])
|
||||
{
|
||||
auto keyCount = 0;
|
||||
|
||||
if (gamePads[0].inUse)
|
||||
{
|
||||
cmd = GetGamePadCommand(cmd);
|
||||
for (auto keyNum = 0; keyNum < Game::K_LAST_KEY; keyNum++)
|
||||
{
|
||||
if (!Key_IsValidGamePadChar(keyNum))
|
||||
|
@ -353,6 +353,7 @@ namespace Components
|
||||
static void InitDvars();
|
||||
static void IN_Init_Hk();
|
||||
|
||||
static const char* GetGamePadCommand(const char* command);
|
||||
static int Key_GetCommandAssignmentInternal_Hk(const char* cmd, int(*keys)[2]);
|
||||
static bool IsGamePadInUse();
|
||||
static void CL_KeyEvent_Hk(int localClientNum, int key, int down, unsigned int time);
|
||||
|
Loading…
Reference in New Issue
Block a user