Separate menu D-Pad bindings
This commit is contained in:
@@ -33,6 +33,9 @@ JVS_CIRCLE = D, L, Ds4_Circle, Ds4_DPad_Right, Ds4_L_Trigger, Ds4_R_Trigger, XIN
|
||||
JVS_LEFT = Left, Up, Ds4_L1, Ds4_L_Stick_Up, Ds4_R_Stick_Up, XINPUT_LS
|
||||
JVS_RIGHT = Right, Down, Ds4_R1, Ds4_L_Stick_Down, Ds4_R_Stick_Down, XINPUT_RS
|
||||
|
||||
MENU_L = Left, Up, Ds4_L1, Ds4_L_Stick_Up, Ds4_R_Stick_Up, XINPUT_LS, Ds4_DPad_Left, Ds4_DPad_Up, XINPUT_LEFT, XINPUT_UP
|
||||
MENU_R = Right, Down, Ds4_R1, Ds4_L_Stick_Down, Ds4_R_Stick_Down, XINPUT_RS, Ds4_DPad_Right, Ds4_DPad_Down, XINPUT_RIGHT, XINPUT_DOWN
|
||||
|
||||
# Touch Slider:
|
||||
LEFT_SIDE_SLIDE_LEFT = Q, Ds4_L_Stick_Left, XINPUT_LLEFT
|
||||
LEFT_SIDE_SLIDE_RIGHT = E, Ds4_L_Stick_Right, XINPUT_LRIGHT
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "../../Utilities/Operations.h"
|
||||
#include "../../Utilities/EnumBitwiseOperations.h"
|
||||
#include "../../FileSystem/ConfigFile.h"
|
||||
#include "../GameState.h"
|
||||
|
||||
const std::string KEY_CONFIG_FILE_NAME = "keyconfig.ini";
|
||||
|
||||
@@ -67,6 +68,9 @@ namespace TLAC::Components
|
||||
LeftBinding = new Binding();
|
||||
RightBinding = new Binding();
|
||||
|
||||
MenuLBinding = new Binding();
|
||||
MenuRBinding = new Binding();
|
||||
|
||||
FileSystem::ConfigFile configFile(framework::GetModuleDirectory(), KEY_CONFIG_FILE_NAME);
|
||||
configFile.OpenRead();
|
||||
|
||||
@@ -79,6 +83,8 @@ namespace TLAC::Components
|
||||
Config::BindConfigKeys(configFile.ConfigMap, "JVS_CIRCLE", *MaruBinding, { "D", "L" });
|
||||
Config::BindConfigKeys(configFile.ConfigMap, "JVS_LEFT", *LeftBinding, { "Q", "U" });
|
||||
Config::BindConfigKeys(configFile.ConfigMap, "JVS_RIGHT", *RightBinding, { "E", "O" });
|
||||
Config::BindConfigKeys(configFile.ConfigMap, "MENU_L", *MenuLBinding, { "Left", "Up" });
|
||||
Config::BindConfigKeys(configFile.ConfigMap, "MENU_R", *MenuRBinding, { "Down", "Right" });
|
||||
|
||||
mouseScrollPvSelection = configFile.GetBooleanValue("mouse_scroll_pv_selection");
|
||||
}
|
||||
@@ -230,6 +236,19 @@ namespace TLAC::Components
|
||||
{
|
||||
JvsButtons buttons = JVS_NONE;
|
||||
|
||||
if (!(*(GameState*)CURRENT_GAME_STATE_ADDRESS == GS_GAME && *(SubGameState*)CURRENT_GAME_SUB_STATE_ADDRESS == SUB_GAME_MAIN) &&
|
||||
buttonTestFunc(MenuLBinding))
|
||||
{
|
||||
buttons |= JVS_L;
|
||||
return buttons;
|
||||
}
|
||||
if (!(*(GameState*)CURRENT_GAME_STATE_ADDRESS == GS_GAME && *(SubGameState*)CURRENT_GAME_SUB_STATE_ADDRESS == SUB_GAME_MAIN) &&
|
||||
buttonTestFunc(MenuRBinding))
|
||||
{
|
||||
buttons |= JVS_R;
|
||||
return buttons;
|
||||
}
|
||||
|
||||
if (buttonTestFunc(TestBinding))
|
||||
buttons |= JVS_TEST;
|
||||
if (buttonTestFunc(ServiceBinding))
|
||||
|
||||
@@ -32,6 +32,9 @@ namespace TLAC::Components
|
||||
Input::Binding* LeftBinding;
|
||||
Input::Binding* RightBinding;
|
||||
|
||||
Input::Binding* MenuLBinding;
|
||||
Input::Binding* MenuRBinding;
|
||||
|
||||
InputEmulator();
|
||||
~InputEmulator();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user