diff --git a/source/common/console/c_con.cpp b/source/common/console/c_con.cpp index 09b14a506..d8ff9d529 100644 --- a/source/common/console/c_con.cpp +++ b/source/common/console/c_con.cpp @@ -37,6 +37,7 @@ #include "basics.h" #include "zstring.h" #include "c_bind.h" +#include "control.h" #include "gamecontrol.h" //============================================================================= diff --git a/source/common/gamecontrol.cpp b/source/common/gamecontrol.cpp index 96fbbc2b6..b086ab39a 100644 --- a/source/common/gamecontrol.cpp +++ b/source/common/gamecontrol.cpp @@ -411,7 +411,6 @@ int CONFIG_Init() CONTROL_ClearAssignments(); CONFIG_InitMouseAndController(); - CONFIG_SetGameControllerDefaultsStandard(); CONFIG_SetDefaultKeys(cl_defaultconfiguration == 1 ? "demolition/origbinds.txt" : cl_defaultconfiguration == 2 ? "demolition/leftbinds.txt" : "demolition/defbinds.txt"); G_ReadConfig(currentGame); @@ -721,122 +720,6 @@ static void CONFIG_SetGameControllerAxesModern() analogAxis.apply(); } -void CONFIG_SetGameControllerDefaultsStandard() -{ - CONFIG_SetGameControllerDefaultsClear(); - CONFIG_SetGameControllerAxesModern(); - - static GameControllerButtonSetting const buttons[] = - { - { GAMECONTROLLER_BUTTON_A, gamefunc_Jump }, - { GAMECONTROLLER_BUTTON_B, gamefunc_Toggle_Crouch }, - { GAMECONTROLLER_BUTTON_BACK, gamefunc_Map }, - { GAMECONTROLLER_BUTTON_LEFTSTICK, gamefunc_Run }, - { GAMECONTROLLER_BUTTON_RIGHTSTICK, gamefunc_Quick_Kick }, - { GAMECONTROLLER_BUTTON_LEFTSHOULDER, gamefunc_Crouch }, - { GAMECONTROLLER_BUTTON_RIGHTSHOULDER, gamefunc_Jump }, - { GAMECONTROLLER_BUTTON_DPAD_UP, gamefunc_Previous_Weapon }, - { GAMECONTROLLER_BUTTON_DPAD_DOWN, gamefunc_Next_Weapon }, - }; - - static GameControllerButtonSetting const buttonsDuke[] = - { - { GAMECONTROLLER_BUTTON_X, gamefunc_Open }, - { GAMECONTROLLER_BUTTON_Y, gamefunc_Inventory }, - { GAMECONTROLLER_BUTTON_DPAD_LEFT, gamefunc_Inventory_Left }, - { GAMECONTROLLER_BUTTON_DPAD_RIGHT, gamefunc_Inventory_Right }, - }; - - static GameControllerButtonSetting const buttonsFury[] = - { - { GAMECONTROLLER_BUTTON_X, gamefunc_Steroids }, // Reload - { GAMECONTROLLER_BUTTON_Y, gamefunc_Open }, - { GAMECONTROLLER_BUTTON_DPAD_LEFT, gamefunc_MedKit }, - { GAMECONTROLLER_BUTTON_DPAD_RIGHT, gamefunc_NightVision }, // Radar - }; - - static GameControllerDigitalAxisSetting const digitalAxes[] = - { - { GAMECONTROLLER_AXIS_TRIGGERLEFT, 1, gamefunc_Alt_Fire }, - { GAMECONTROLLER_AXIS_TRIGGERRIGHT, 1, gamefunc_Fire }, - }; - - for (auto const& button : buttons) - button.apply(); - - if (g_gameType & GAMEFLAG_FURY) - { - for (auto const& button : buttonsFury) - button.apply(); - } - else - { - for (auto const& button : buttonsDuke) - button.apply(); - } - - for (auto const& digitalAxis : digitalAxes) - digitalAxis.apply(); -} - -void CONFIG_SetGameControllerDefaultsPro() -{ - CONFIG_SetGameControllerDefaultsClear(); - CONFIG_SetGameControllerAxesModern(); - - static GameControllerButtonSetting const buttons[] = - { - { GAMECONTROLLER_BUTTON_A, gamefunc_Open }, - { GAMECONTROLLER_BUTTON_B, gamefunc_Third_Person_View }, - { GAMECONTROLLER_BUTTON_Y, gamefunc_Quick_Kick }, - { GAMECONTROLLER_BUTTON_BACK, gamefunc_Map }, - { GAMECONTROLLER_BUTTON_LEFTSTICK, gamefunc_Run }, - { GAMECONTROLLER_BUTTON_RIGHTSTICK, gamefunc_Crouch }, - { GAMECONTROLLER_BUTTON_DPAD_UP, gamefunc_Previous_Weapon }, - { GAMECONTROLLER_BUTTON_DPAD_DOWN, gamefunc_Next_Weapon }, - }; - - static GameControllerButtonSetting const buttonsDuke[] = - { - { GAMECONTROLLER_BUTTON_X, gamefunc_Inventory }, - { GAMECONTROLLER_BUTTON_LEFTSHOULDER, gamefunc_Previous_Weapon }, - { GAMECONTROLLER_BUTTON_RIGHTSHOULDER, gamefunc_Next_Weapon }, - { GAMECONTROLLER_BUTTON_DPAD_LEFT, gamefunc_Inventory_Left }, - { GAMECONTROLLER_BUTTON_DPAD_RIGHT, gamefunc_Inventory_Right }, - }; - - static GameControllerButtonSetting const buttonsFury[] = - { - { GAMECONTROLLER_BUTTON_X, gamefunc_Steroids }, // Reload - { GAMECONTROLLER_BUTTON_LEFTSHOULDER, gamefunc_Crouch }, - { GAMECONTROLLER_BUTTON_RIGHTSHOULDER, gamefunc_Alt_Fire }, - { GAMECONTROLLER_BUTTON_DPAD_LEFT, gamefunc_MedKit }, - { GAMECONTROLLER_BUTTON_DPAD_RIGHT, gamefunc_NightVision }, // Radar - }; - - static GameControllerDigitalAxisSetting const digitalAxes[] = - { - { GAMECONTROLLER_AXIS_TRIGGERLEFT, 1, gamefunc_Jump }, - { GAMECONTROLLER_AXIS_TRIGGERRIGHT, 1, gamefunc_Fire }, - }; - - for (auto const& button : buttons) - button.apply(); - - if (g_gameType & GAMEFLAG_FURY) - { - for (auto const& button : buttonsFury) - button.apply(); - } - else - { - for (auto const& button : buttonsDuke) - button.apply(); - } - - for (auto const& digitalAxis : digitalAxes) - digitalAxis.apply(); -} void CONFIG_InitMouseAndController() diff --git a/source/common/gamecontrol.h b/source/common/gamecontrol.h index 740f3de80..b699693d8 100644 --- a/source/common/gamecontrol.h +++ b/source/common/gamecontrol.h @@ -42,8 +42,6 @@ void CONFIG_SetupJoystick(void); void CONFIG_WriteControllerSettings(); void CONFIG_InitMouseAndController(); -void CONFIG_SetGameControllerDefaultsStandard(); -void CONFIG_SetGameControllerDefaultsPro(); void CONFIG_SetGameControllerDefaultsClear(); extern FStringCVar* const CombatMacros[]; diff --git a/wadsrc/static/demolition/commonbinds.txt b/wadsrc/static/demolition/commonbinds.txt index 1ca90ecac..f96323051 100644 --- a/wadsrc/static/demolition/commonbinds.txt +++ b/wadsrc/static/demolition/commonbinds.txt @@ -63,3 +63,17 @@ K "+See_Coop_View" Mouse1 "+Fire" MWheelUp "+Previous_Weapon" MWheelDown "+Next_Weapon" + +Pad_A "+Fire" +Pad_B "+Toggle_Crouch" // fixme: not yet supported by all games +Pad_Back "+Map" +LTrigger "+Run" +RTrigger "+Quick_Kick" +LShoulder "+Crouch" +RShoulder "+Jump" +DPadUp "+Previous_Weapon" +DPadDown "+Next_Weapon" +Pad_X "+Open" +Pad_Y "+Inventory" +DPadLeft "+Inventory_Left" +DPadRight "+Inventory_Right" diff --git a/wadsrc/static/filter/ionfury/demolition/defbinds.txt b/wadsrc/static/filter/ionfury/demolition/defbinds.txt index 1aba205c4..f0e5627be 100644 --- a/wadsrc/static/filter/ionfury/demolition/defbinds.txt +++ b/wadsrc/static/filter/ionfury/demolition/defbinds.txt @@ -1,5 +1,8 @@ // X "+Last_Used_Weapon" C "+Toggle_Crouch" -Mouse2 "+Jetpack" +Mouse2 "+Steroids" Mouse3 "+MediKit" +Pad_Y "+Steroids" +DPadLeft "+MedKit" +DPadRight "+Nightvision" diff --git a/wadsrc/static/filter/ionfury/demolition/origbinds.txt b/wadsrc/static/filter/ionfury/demolition/origbinds.txt index c3ac394e8..dcd40b932 100644 --- a/wadsrc/static/filter/ionfury/demolition/origbinds.txt +++ b/wadsrc/static/filter/ionfury/demolition/origbinds.txt @@ -1,3 +1,6 @@ W "+Show_Opponents_Weapon" -Mouse2 "+Jetpack" +Mouse2 "+Steroids" Mouse3 "+MediKit" +Pad_Y "+Steroids" +DPadLeft "+MedKit" +DPadRight "+Nightvision"