Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
iota97 committed Nov 17, 2019
1 parent 38d3e44 commit e4e563f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Core/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ static ConfigSetting generalSettings[] = {
ConfigSetting("GridView2", &g_Config.bGridView2, true),
ConfigSetting("GridView3", &g_Config.bGridView3, false),
ConfigSetting("ComboMode", &g_Config.iComboMode, 0),
ConfigSetting("RightAnalogMode", &g_Config.iRightAnalogMode, 1), // Default to D-Pad?
ConfigSetting("RightAnalogMode", &g_Config.iRightAnalogMode, 0),
ConfigSetting("RightAnalogPress", &g_Config.iRightAnalogPress, 0),

// "default" means let emulator decide, "" means disable.
Expand Down
8 changes: 0 additions & 8 deletions UI/GameSettingsScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -588,14 +588,6 @@ void GameSettingsScreen::CreateViews() {
static const char *touchControlStyles[] = {"Classic", "Thin borders", "Glowing borders"};
View *style = controlsSettings->Add(new PopupMultiChoice(&g_Config.iTouchButtonStyle, co->T("Button style"), touchControlStyles, 0, ARRAY_SIZE(touchControlStyles), co->GetName(), screenManager()));
style->SetEnabledPtr(&g_Config.bShowTouchControls);

// Right analog config
static const char *rightAnalogModes[] = {"Right analog", "D-Pad", "Face button"};
View *rightAnalog = controlsSettings->Add(new PopupMultiChoice(&g_Config.iRightAnalogMode, co->T("Right analog mode"), rightAnalogModes, 0, ARRAY_SIZE(rightAnalogModes), co->GetName(), screenManager()));
rightAnalog->SetEnabledPtr(&g_Config.bShowTouchControls);
static const char *rightAnalogButton[] = {"Disabled", "Left trigger", "Right trigger", "Square", "Triangle", "Circle", "Cross", "Up", "Down", "Left", "Right", "Start", "Select"};
View *rightAnalogPress = controlsSettings->Add(new PopupMultiChoice(&g_Config.iRightAnalogPress, co->T("Right analog button on press"), rightAnalogButton, 0, ARRAY_SIZE(rightAnalogButton), co->GetName(), screenManager()));
rightAnalogPress->SetEnabledPtr(&g_Config.bShowTouchControls);
}

#ifdef _WIN32
Expand Down
3 changes: 2 additions & 1 deletion UI/GamepadEmu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,6 @@ void PSPStick::Touch(const TouchInput &input) {
}

void PSPStick::ProcessTouch(float x, float y, bool down) {
int rightAnalogMode = g_Config.iRightAnalogMode - 1; // 0 is the right analog mode
static const int analogButton[2][4] = {{CTRL_RIGHT, CTRL_DOWN, CTRL_LEFT, CTRL_UP},{CTRL_CIRCLE, CTRL_CROSS, CTRL_SQUARE, CTRL_TRIANGLE}};
static const int button[16] = {CTRL_LTRIGGER, CTRL_RTRIGGER, CTRL_SQUARE, CTRL_TRIANGLE, CTRL_CIRCLE, CTRL_CROSS, CTRL_UP, CTRL_DOWN, CTRL_LEFT, CTRL_RIGHT, CTRL_START, CTRL_SELECT};

Expand All @@ -436,6 +435,7 @@ void PSPStick::ProcessTouch(float x, float y, bool down) {
dy = std::min(1.0f, std::max(-1.0f, dy));

if(stick_ == 2) { // Custom right analog
int rightAnalogMode = g_Config.iRightAnalogMode - 1; // 0 is the right analog mode
if(dx > 0.5f)
__CtrlButtonDown(analogButton[rightAnalogMode][0]);
else
Expand All @@ -460,6 +460,7 @@ void PSPStick::ProcessTouch(float x, float y, bool down) {
__CtrlSetAnalogY(-dy, stick_);
} else {
if(stick_ == 2) { // Custom right analog
int rightAnalogMode = g_Config.iRightAnalogMode - 1; // 0 is the right analog mode
__CtrlButtonUp(analogButton[rightAnalogMode][0]);
__CtrlButtonUp(analogButton[rightAnalogMode][1]);
__CtrlButtonUp(analogButton[rightAnalogMode][2]);
Expand Down
7 changes: 7 additions & 0 deletions UI/TouchControlVisibilityScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,13 @@ void TouchControlVisibilityScreen::CreateViews() {
row->Add(choice);
grid->Add(row);
}

static const char *rightAnalogModes[] = {"Right analog", "D-Pad", "Face button"};
View *rightAnalog = vert->Add(new PopupMultiChoice(&g_Config.iRightAnalogMode, co->T("Right analog mode"), rightAnalogModes, 0, ARRAY_SIZE(rightAnalogModes), co->GetName(), screenManager()));
rightAnalog->SetEnabledPtr(&g_Config.touchRightAnalogStick.show);
static const char *rightAnalogButton[] = {"Disabled", "Left trigger", "Right trigger", "Square", "Triangle", "Circle", "Cross", "Up", "Down", "Left", "Right", "Start", "Select"};
View *rightAnalogPress = vert->Add(new PopupMultiChoice(&g_Config.iRightAnalogPress, co->T("Right analog button on press"), rightAnalogButton, 0, ARRAY_SIZE(rightAnalogButton), co->GetName(), screenManager()));
rightAnalogPress->SetEnabledPtr(&g_Config.touchRightAnalogStick.show);
}

void TouchControlVisibilityScreen::onFinish(DialogResult result) {
Expand Down
2 changes: 1 addition & 1 deletion assets/lang
Submodule lang updated 43 files
+27 −6 ar_AE.ini
+27 −6 az_AZ.ini
+27 −6 bg_BG.ini
+27 −6 ca_ES.ini
+27 −6 cz_CZ.ini
+27 −6 da_DK.ini
+27 −6 de_DE.ini
+27 −6 dr_ID.ini
+27 −6 en_US.ini
+27 −6 es_ES.ini
+27 −6 es_LA.ini
+27 −6 fa_IR.ini
+27 −6 fi_FI.ini
+28 −7 fr_FR.ini
+27 −6 gl_ES.ini
+27 −6 gr_EL.ini
+27 −6 he_IL.ini
+27 −6 he_IL_invert.ini
+944 −0 hr_HR.ini
+27 −6 hu_HU.ini
+27 −6 id_ID.ini
+27 −6 it_IT.ini
+27 −6 ja_JP.ini
+27 −6 jv_ID.ini
+27 −6 ko_KR.ini
+27 −6 lo_LA.ini
+27 −6 lt-LT.ini
+27 −6 ms_MY.ini
+27 −6 nl_NL.ini
+27 −6 no_NO.ini
+27 −6 pl_PL.ini
+27 −6 pt_BR.ini
+27 −6 pt_PT.ini
+27 −6 ro_RO.ini
+141 −120 ru_RU.ini
+27 −6 sv_SE.ini
+27 −6 tg_PH.ini
+27 −6 th_TH.ini
+27 −6 tr_TR.ini
+148 −127 uk_UA.ini
+27 −6 vi_VN.ini
+27 −6 zh_CN.ini
+27 −6 zh_TW.ini

0 comments on commit e4e563f

Please sign in to comment.