mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-12-03 11:11:25 +00:00
Allow to disable right analog diagonal
This commit is contained in:
parent
af3ad2ca03
commit
bac96bd47c
@ -548,6 +548,7 @@ static ConfigSetting generalSettings[] = {
|
||||
ConfigSetting("RightAnalogRight", &g_Config.iRightAnalogRight, 0, true, true),
|
||||
ConfigSetting("RightAnalogPress", &g_Config.iRightAnalogPress, 0, true, true),
|
||||
ConfigSetting("RightAnalogCustom", &g_Config.bRightAnalogCustom, false, true, true),
|
||||
ConfigSetting("RightAnalogDisableDiagonal", &g_Config.bRightAnalogDisableDiagonal, false, true, true),
|
||||
|
||||
// "default" means let emulator decide, "" means disable.
|
||||
ConfigSetting("ReportingHost", &g_Config.sReportHost, "default"),
|
||||
|
@ -315,6 +315,7 @@ public:
|
||||
int iRightAnalogRight;
|
||||
int iRightAnalogPress;
|
||||
bool bRightAnalogCustom;
|
||||
bool bRightAnalogDisableDiagonal;
|
||||
|
||||
// Disable diagonals
|
||||
bool bDisableDpadDiagonals;
|
||||
|
@ -529,25 +529,25 @@ void PSPCustomStick::ProcessTouch(float x, float y, bool down) {
|
||||
dy = std::min(1.0f, std::max(-1.0f, dy));
|
||||
|
||||
if (g_Config.iRightAnalogRight != 0) {
|
||||
if (dx > 0.5f)
|
||||
if (dx > 0.5f && (!g_Config.bRightAnalogDisableDiagonal || fabs(dx) > fabs(dy)))
|
||||
__CtrlButtonDown(button[g_Config.iRightAnalogRight-1]);
|
||||
else
|
||||
__CtrlButtonUp(button[g_Config.iRightAnalogRight-1]);
|
||||
}
|
||||
if (g_Config.iRightAnalogLeft != 0) {
|
||||
if (dx < -0.5f)
|
||||
if (dx < -0.5f && (!g_Config.bRightAnalogDisableDiagonal || fabs(dx) > fabs(dy)))
|
||||
__CtrlButtonDown(button[g_Config.iRightAnalogLeft-1]);
|
||||
else
|
||||
__CtrlButtonUp(button[g_Config.iRightAnalogLeft-1]);
|
||||
}
|
||||
if (g_Config.iRightAnalogUp != 0) {
|
||||
if (dy < -0.5f)
|
||||
if (dy < -0.5f && (!g_Config.bRightAnalogDisableDiagonal || fabs(dx) <= fabs(dy)))
|
||||
__CtrlButtonDown(button[g_Config.iRightAnalogUp-1]);
|
||||
else
|
||||
__CtrlButtonUp(button[g_Config.iRightAnalogUp-1]);
|
||||
}
|
||||
if (g_Config.iRightAnalogDown != 0) {
|
||||
if (dy > 0.5f)
|
||||
if (dy > 0.5f && (!g_Config.bRightAnalogDisableDiagonal || fabs(dx) <= fabs(dy)))
|
||||
__CtrlButtonDown(button[g_Config.iRightAnalogDown-1]);
|
||||
else
|
||||
__CtrlButtonUp(button[g_Config.iRightAnalogDown-1]);
|
||||
|
@ -174,8 +174,12 @@ void RightAnalogMappingScreen::CreateViews() {
|
||||
|
||||
static const char *rightAnalogButton[] = {"None", "L", "R", "Square", "Triangle", "Circle", "Cross", "D-pad up", "D-pad down", "D-pad left", "D-pad right", "Start", "Select"};
|
||||
|
||||
vert->Add(new ItemHeader(co->T("Analog Style")));
|
||||
vert->Add(new CheckBox(&g_Config.touchRightAnalogStick.show, co->T("Visible")));
|
||||
vert->Add(new CheckBox(&g_Config.bRightAnalogCustom, co->T("Use custom right analog")));
|
||||
vert->Add(new CheckBox(&g_Config.bRightAnalogDisableDiagonal, co->T("Disable diagonal input")))->SetEnabledPtr(&g_Config.bRightAnalogCustom);
|
||||
|
||||
vert->Add(new ItemHeader(co->T("Analog Binding")));
|
||||
PopupMultiChoice *rightAnalogUp = vert->Add(new PopupMultiChoice(&g_Config.iRightAnalogUp, mc->T("RightAn.Up"), rightAnalogButton, 0, ARRAY_SIZE(rightAnalogButton), mc->GetName(), screenManager()));
|
||||
PopupMultiChoice *rightAnalogDown = vert->Add(new PopupMultiChoice(&g_Config.iRightAnalogDown, mc->T("RightAn.Down"), rightAnalogButton, 0, ARRAY_SIZE(rightAnalogButton), mc->GetName(), screenManager()));
|
||||
PopupMultiChoice *rightAnalogLeft = vert->Add(new PopupMultiChoice(&g_Config.iRightAnalogLeft, mc->T("RightAn.Left"), rightAnalogButton, 0, ARRAY_SIZE(rightAnalogButton), mc->GetName(), screenManager()));
|
||||
|
Loading…
Reference in New Issue
Block a user