mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-23 05:19:56 +00:00
Merge pull request #17193 from hrydgard/combo-key-rename
Combo key: Finish rename
This commit is contained in:
commit
d8727cb515
@ -1356,8 +1356,8 @@ list(APPEND NativeAppSource
|
||||
UI/MemStickScreen.cpp
|
||||
UI/ProfilerDraw.h
|
||||
UI/ProfilerDraw.cpp
|
||||
UI/ComboKeyMappingScreen.h
|
||||
UI/ComboKeyMappingScreen.cpp
|
||||
UI/CustomButtonMappingScreen.h
|
||||
UI/CustomButtonMappingScreen.cpp
|
||||
UI/Theme.h
|
||||
UI/Theme.cpp
|
||||
)
|
||||
|
@ -945,16 +945,27 @@ static const ConfigSetting controlSettings[] = {
|
||||
ConfigSetting("ShowTouchSquare", &g_Config.bShowTouchSquare, true, true, true),
|
||||
ConfigSetting("ShowTouchTriangle", &g_Config.bShowTouchTriangle, true, true, true),
|
||||
|
||||
ConfigSetting("Custom0Mapping", "Custom0Image", "Custom0Shape", "Custom0Toggle", "Custom0Repeat", &g_Config.CustomKey0, {0, 0, 0, false, false}, true, true),
|
||||
ConfigSetting("Custom1Mapping", "Custom1Image", "Custom1Shape", "Custom1Toggle", "Custom1Repeat", &g_Config.CustomKey1, {0, 1, 0, false, false}, true, true),
|
||||
ConfigSetting("Custom2Mapping", "Custom2Image", "Custom2Shape", "Custom2Toggle", "Custom2Repeat", &g_Config.CustomKey2, {0, 2, 0, false, false}, true, true),
|
||||
ConfigSetting("Custom3Mapping", "Custom3Image", "Custom3Shape", "Custom3Toggle", "Custom3Repeat", &g_Config.CustomKey3, {0, 3, 0, false, false}, true, true),
|
||||
ConfigSetting("Custom4Mapping", "Custom4Image", "Custom4Shape", "Custom4Toggle", "Custom4Repeat", &g_Config.CustomKey4, {0, 4, 0, false, false}, true, true),
|
||||
ConfigSetting("Custom5Mapping", "Custom5Image", "Custom5Shape", "Custom5Toggle", "Custom5Repeat", &g_Config.CustomKey5, {0, 0, 1, false, false}, true, true),
|
||||
ConfigSetting("Custom6Mapping", "Custom6Image", "Custom6Shape", "Custom6Toggle", "Custom6Repeat", &g_Config.CustomKey6, {0, 1, 1, false, false}, true, true),
|
||||
ConfigSetting("Custom7Mapping", "Custom7Image", "Custom7Shape", "Custom7Toggle", "Custom7Repeat", &g_Config.CustomKey7, {0, 2, 1, false, false}, true, true),
|
||||
ConfigSetting("Custom8Mapping", "Custom8Image", "Custom8Shape", "Custom8Toggle", "Custom8Repeat", &g_Config.CustomKey8, {0, 3, 1, false, false}, true, true),
|
||||
ConfigSetting("Custom9Mapping", "Custom9Image", "Custom9Shape", "Custom9Toggle", "Custom9Repeat", &g_Config.CustomKey9, {0, 4, 1, false, false}, true, true),
|
||||
ConfigSetting("Custom0Mapping", "Custom0Image", "Custom0Shape", "Custom0Toggle", "Custom0Repeat", &g_Config.CustomButton0, {0, 0, 0, false, false}, true, true),
|
||||
ConfigSetting("Custom1Mapping", "Custom1Image", "Custom1Shape", "Custom1Toggle", "Custom1Repeat", &g_Config.CustomButton1, {0, 1, 0, false, false}, true, true),
|
||||
ConfigSetting("Custom2Mapping", "Custom2Image", "Custom2Shape", "Custom2Toggle", "Custom2Repeat", &g_Config.CustomButton2, {0, 2, 0, false, false}, true, true),
|
||||
ConfigSetting("Custom3Mapping", "Custom3Image", "Custom3Shape", "Custom3Toggle", "Custom3Repeat", &g_Config.CustomButton3, {0, 3, 0, false, false}, true, true),
|
||||
ConfigSetting("Custom4Mapping", "Custom4Image", "Custom4Shape", "Custom4Toggle", "Custom4Repeat", &g_Config.CustomButton4, {0, 4, 0, false, false}, true, true),
|
||||
ConfigSetting("Custom5Mapping", "Custom5Image", "Custom5Shape", "Custom5Toggle", "Custom5Repeat", &g_Config.CustomButton5, {0, 0, 1, false, false}, true, true),
|
||||
ConfigSetting("Custom6Mapping", "Custom6Image", "Custom6Shape", "Custom6Toggle", "Custom6Repeat", &g_Config.CustomButton6, {0, 1, 1, false, false}, true, true),
|
||||
ConfigSetting("Custom7Mapping", "Custom7Image", "Custom7Shape", "Custom7Toggle", "Custom7Repeat", &g_Config.CustomButton7, {0, 2, 1, false, false}, true, true),
|
||||
ConfigSetting("Custom8Mapping", "Custom8Image", "Custom8Shape", "Custom8Toggle", "Custom8Repeat", &g_Config.CustomButton8, {0, 3, 1, false, false}, true, true),
|
||||
ConfigSetting("Custom9Mapping", "Custom9Image", "Custom9Shape", "Custom9Toggle", "Custom9Repeat", &g_Config.CustomButton9, {0, 4, 1, false, false}, true, true),
|
||||
// Combo keys are going to be something else, but I don't want to break the config.
|
||||
ConfigSetting("fcombo0X", "fcombo0Y", "comboKeyScale0", "ShowComboKey0", &g_Config.touchCustom0, defaultTouchPosHide, true, true),
|
||||
ConfigSetting("fcombo1X", "fcombo1Y", "comboKeyScale1", "ShowComboKey1", &g_Config.touchCustom1, defaultTouchPosHide, true, true),
|
||||
ConfigSetting("fcombo2X", "fcombo2Y", "comboKeyScale2", "ShowComboKey2", &g_Config.touchCustom2, defaultTouchPosHide, true, true),
|
||||
ConfigSetting("fcombo3X", "fcombo3Y", "comboKeyScale3", "ShowComboKey3", &g_Config.touchCustom3, defaultTouchPosHide, true, true),
|
||||
ConfigSetting("fcombo4X", "fcombo4Y", "comboKeyScale4", "ShowComboKey4", &g_Config.touchCustom4, defaultTouchPosHide, true, true),
|
||||
ConfigSetting("fcombo5X", "fcombo5Y", "comboKeyScale5", "ShowComboKey5", &g_Config.touchCustom5, defaultTouchPosHide, true, true),
|
||||
ConfigSetting("fcombo6X", "fcombo6Y", "comboKeyScale6", "ShowComboKey6", &g_Config.touchCustom6, defaultTouchPosHide, true, true),
|
||||
ConfigSetting("fcombo7X", "fcombo7Y", "comboKeyScale7", "ShowComboKey7", &g_Config.touchCustom7, defaultTouchPosHide, true, true),
|
||||
ConfigSetting("fcombo8X", "fcombo8Y", "comboKeyScale8", "ShowComboKey8", &g_Config.touchCustom8, defaultTouchPosHide, true, true),
|
||||
ConfigSetting("fcombo9X", "fcombo9Y", "comboKeyScale9", "ShowComboKey9", &g_Config.touchCustom9, defaultTouchPosHide, true, true),
|
||||
|
||||
#if defined(_WIN32)
|
||||
// A win32 user seeing touch controls is likely using PPSSPP on a tablet. There it makes
|
||||
@ -1008,17 +1019,6 @@ static const ConfigSetting controlSettings[] = {
|
||||
ConfigSetting("AnalogStickX", "AnalogStickY", "AnalogStickScale", "ShowAnalogStick", &g_Config.touchAnalogStick, defaultTouchPosShow, true, true),
|
||||
ConfigSetting("RightAnalogStickX", "RightAnalogStickY", "RightAnalogStickScale", "ShowRightAnalogStick", &g_Config.touchRightAnalogStick, defaultTouchPosHide, true, true),
|
||||
|
||||
ConfigSetting("fcombo0X", "fcombo0Y", "comboKeyScale0", "ShowComboKey0", &g_Config.touchCombo0, defaultTouchPosHide, true, true),
|
||||
ConfigSetting("fcombo1X", "fcombo1Y", "comboKeyScale1", "ShowComboKey1", &g_Config.touchCombo1, defaultTouchPosHide, true, true),
|
||||
ConfigSetting("fcombo2X", "fcombo2Y", "comboKeyScale2", "ShowComboKey2", &g_Config.touchCombo2, defaultTouchPosHide, true, true),
|
||||
ConfigSetting("fcombo3X", "fcombo3Y", "comboKeyScale3", "ShowComboKey3", &g_Config.touchCombo3, defaultTouchPosHide, true, true),
|
||||
ConfigSetting("fcombo4X", "fcombo4Y", "comboKeyScale4", "ShowComboKey4", &g_Config.touchCombo4, defaultTouchPosHide, true, true),
|
||||
ConfigSetting("fcombo5X", "fcombo5Y", "comboKeyScale5", "ShowComboKey5", &g_Config.touchCombo5, defaultTouchPosHide, true, true),
|
||||
ConfigSetting("fcombo6X", "fcombo6Y", "comboKeyScale6", "ShowComboKey6", &g_Config.touchCombo6, defaultTouchPosHide, true, true),
|
||||
ConfigSetting("fcombo7X", "fcombo7Y", "comboKeyScale7", "ShowComboKey7", &g_Config.touchCombo7, defaultTouchPosHide, true, true),
|
||||
ConfigSetting("fcombo8X", "fcombo8Y", "comboKeyScale8", "ShowComboKey8", &g_Config.touchCombo8, defaultTouchPosHide, true, true),
|
||||
ConfigSetting("fcombo9X", "fcombo9Y", "comboKeyScale9", "ShowComboKey9", &g_Config.touchCombo9, defaultTouchPosHide, true, true),
|
||||
|
||||
ConfigSetting("AnalogDeadzone", &g_Config.fAnalogDeadzone, 0.15f, true, true),
|
||||
ConfigSetting("AnalogInverseDeadzone", &g_Config.fAnalogInverseDeadzone, 0.0f, true, true),
|
||||
ConfigSetting("AnalogSensitivity", &g_Config.fAnalogSensitivity, 1.1f, true, true),
|
||||
@ -2005,16 +2005,16 @@ void Config::ResetControlLayout() {
|
||||
reset(g_Config.touchRKey);
|
||||
reset(g_Config.touchAnalogStick);
|
||||
reset(g_Config.touchRightAnalogStick);
|
||||
reset(g_Config.touchCombo0);
|
||||
reset(g_Config.touchCombo1);
|
||||
reset(g_Config.touchCombo2);
|
||||
reset(g_Config.touchCombo3);
|
||||
reset(g_Config.touchCombo4);
|
||||
reset(g_Config.touchCombo5);
|
||||
reset(g_Config.touchCombo6);
|
||||
reset(g_Config.touchCombo7);
|
||||
reset(g_Config.touchCombo8);
|
||||
reset(g_Config.touchCombo9);
|
||||
reset(g_Config.touchCustom0);
|
||||
reset(g_Config.touchCustom1);
|
||||
reset(g_Config.touchCustom2);
|
||||
reset(g_Config.touchCustom3);
|
||||
reset(g_Config.touchCustom4);
|
||||
reset(g_Config.touchCustom5);
|
||||
reset(g_Config.touchCustom6);
|
||||
reset(g_Config.touchCustom7);
|
||||
reset(g_Config.touchCustom8);
|
||||
reset(g_Config.touchCustom9);
|
||||
g_Config.fLeftStickHeadScale = 1.0f;
|
||||
g_Config.fRightStickHeadScale = 1.0f;
|
||||
}
|
||||
|
@ -355,16 +355,16 @@ public:
|
||||
ConfigTouchPos touchAnalogStick;
|
||||
ConfigTouchPos touchRightAnalogStick;
|
||||
|
||||
ConfigTouchPos touchCombo0;
|
||||
ConfigTouchPos touchCombo1;
|
||||
ConfigTouchPos touchCombo2;
|
||||
ConfigTouchPos touchCombo3;
|
||||
ConfigTouchPos touchCombo4;
|
||||
ConfigTouchPos touchCombo5;
|
||||
ConfigTouchPos touchCombo6;
|
||||
ConfigTouchPos touchCombo7;
|
||||
ConfigTouchPos touchCombo8;
|
||||
ConfigTouchPos touchCombo9;
|
||||
ConfigTouchPos touchCustom0;
|
||||
ConfigTouchPos touchCustom1;
|
||||
ConfigTouchPos touchCustom2;
|
||||
ConfigTouchPos touchCustom3;
|
||||
ConfigTouchPos touchCustom4;
|
||||
ConfigTouchPos touchCustom5;
|
||||
ConfigTouchPos touchCustom6;
|
||||
ConfigTouchPos touchCustom7;
|
||||
ConfigTouchPos touchCustom8;
|
||||
ConfigTouchPos touchCustom9;
|
||||
|
||||
float fLeftStickHeadScale;
|
||||
float fRightStickHeadScale;
|
||||
@ -378,16 +378,16 @@ public:
|
||||
bool bShowTouchTriangle;
|
||||
bool bShowTouchSquare;
|
||||
|
||||
ConfigCustomButton CustomKey0;
|
||||
ConfigCustomButton CustomKey1;
|
||||
ConfigCustomButton CustomKey2;
|
||||
ConfigCustomButton CustomKey3;
|
||||
ConfigCustomButton CustomKey4;
|
||||
ConfigCustomButton CustomKey5;
|
||||
ConfigCustomButton CustomKey6;
|
||||
ConfigCustomButton CustomKey7;
|
||||
ConfigCustomButton CustomKey8;
|
||||
ConfigCustomButton CustomKey9;
|
||||
ConfigCustomButton CustomButton0;
|
||||
ConfigCustomButton CustomButton1;
|
||||
ConfigCustomButton CustomButton2;
|
||||
ConfigCustomButton CustomButton3;
|
||||
ConfigCustomButton CustomButton4;
|
||||
ConfigCustomButton CustomButton5;
|
||||
ConfigCustomButton CustomButton6;
|
||||
ConfigCustomButton CustomButton7;
|
||||
ConfigCustomButton CustomButton8;
|
||||
ConfigCustomButton CustomButton9;
|
||||
|
||||
// Ignored on iOS and other platforms that lack pause.
|
||||
bool bShowTouchPause;
|
||||
|
@ -29,7 +29,7 @@
|
||||
#include "Common/StringUtils.h"
|
||||
#include "Core/Config.h"
|
||||
|
||||
#include "UI/ComboKeyMappingScreen.h"
|
||||
#include "UI/CustomButtonMappingScreen.h"
|
||||
|
||||
class ButtonShapeScreen : public PopupScreen {
|
||||
public:
|
||||
@ -37,13 +37,13 @@ public:
|
||||
|
||||
void CreatePopupContents(UI::ViewGroup *parent) override {
|
||||
using namespace UI;
|
||||
using namespace CustomKey;
|
||||
using namespace CustomKeyData;
|
||||
|
||||
ScrollView *scroll = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT, 1.0f));
|
||||
LinearLayout *items = new LinearLayoutList(ORIENT_VERTICAL);
|
||||
|
||||
for (int i = 0; i < ARRAY_SIZE(comboKeyShapes); ++i) {
|
||||
Choice *c = items->Add(new Choice(ImageID(comboKeyShapes[i].l), 0.6f, comboKeyShapes[i].r*PI/180, comboKeyShapes[i].f));
|
||||
for (int i = 0; i < ARRAY_SIZE(customKeyShapes); ++i) {
|
||||
Choice *c = items->Add(new Choice(ImageID(customKeyShapes[i].l), 0.6f, customKeyShapes[i].r*PI/180, customKeyShapes[i].f));
|
||||
c->OnClick.Add([=](UI::EventParams &e) {
|
||||
*setting_ = i;
|
||||
TriggerFinish(DR_OK);
|
||||
@ -67,13 +67,13 @@ public:
|
||||
|
||||
void CreatePopupContents(UI::ViewGroup *parent) override {
|
||||
using namespace UI;
|
||||
using namespace CustomKey;
|
||||
using namespace CustomKeyData;
|
||||
|
||||
ScrollView *scroll = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT, 1.0f));
|
||||
LinearLayout *items = new LinearLayoutList(ORIENT_VERTICAL);
|
||||
|
||||
for (int i = 0; i < ARRAY_SIZE(comboKeyImages); ++i) {
|
||||
Choice *c = items->Add(new Choice(ImageID(comboKeyImages[i].i), 1.0f, comboKeyImages[i].r*PI/180));
|
||||
for (int i = 0; i < ARRAY_SIZE(customKeyImages); ++i) {
|
||||
Choice *c = items->Add(new Choice(ImageID(customKeyImages[i].i), 1.0f, customKeyImages[i].r*PI/180));
|
||||
c->OnClick.Add([=](UI::EventParams &e) {
|
||||
*setting_ = i;
|
||||
TriggerFinish(DR_OK);
|
||||
@ -116,9 +116,9 @@ private:
|
||||
ImageID img_;
|
||||
};
|
||||
|
||||
void ComboKeyScreen::CreateViews() {
|
||||
void CustomButtonMappingScreen::CreateViews() {
|
||||
using namespace UI;
|
||||
using namespace CustomKey;
|
||||
using namespace CustomKeyData;
|
||||
auto co = GetI18NCategory("Controls");
|
||||
auto mc = GetI18NCategory("MappableControls");
|
||||
root_ = new LinearLayout(ORIENT_VERTICAL);
|
||||
@ -133,74 +133,74 @@ void ComboKeyScreen::CreateViews() {
|
||||
memset(array, 0, sizeof(array));
|
||||
switch (id_) {
|
||||
case 0:
|
||||
cfg = &g_Config.CustomKey0;
|
||||
show = &g_Config.touchCombo0.show;
|
||||
for (int i = 0; i < ARRAY_SIZE(comboKeyList); i++)
|
||||
array[i] = (0x01 == ((g_Config.CustomKey0.key >> i) & 0x01));
|
||||
cfg = &g_Config.CustomButton0;
|
||||
show = &g_Config.touchCustom0.show;
|
||||
for (int i = 0; i < ARRAY_SIZE(customKeyList); i++)
|
||||
array[i] = (0x01 == ((g_Config.CustomButton0.key >> i) & 0x01));
|
||||
break;
|
||||
case 1:
|
||||
cfg = &g_Config.CustomKey1;
|
||||
show = &g_Config.touchCombo1.show;
|
||||
for (int i = 0; i < ARRAY_SIZE(comboKeyList); i++)
|
||||
array[i] = (0x01 == ((g_Config.CustomKey1.key >> i) & 0x01));
|
||||
cfg = &g_Config.CustomButton1;
|
||||
show = &g_Config.touchCustom1.show;
|
||||
for (int i = 0; i < ARRAY_SIZE(customKeyList); i++)
|
||||
array[i] = (0x01 == ((g_Config.CustomButton1.key >> i) & 0x01));
|
||||
break;
|
||||
case 2:
|
||||
cfg = &g_Config.CustomKey2;
|
||||
show = &g_Config.touchCombo2.show;
|
||||
for (int i = 0; i < ARRAY_SIZE(comboKeyList); i++)
|
||||
array[i] = (0x01 == ((g_Config.CustomKey2.key >> i) & 0x01));
|
||||
cfg = &g_Config.CustomButton2;
|
||||
show = &g_Config.touchCustom2.show;
|
||||
for (int i = 0; i < ARRAY_SIZE(customKeyList); i++)
|
||||
array[i] = (0x01 == ((g_Config.CustomButton2.key >> i) & 0x01));
|
||||
break;
|
||||
case 3:
|
||||
cfg = &g_Config.CustomKey3;
|
||||
show = &g_Config.touchCombo3.show;
|
||||
for (int i = 0; i < ARRAY_SIZE(comboKeyList); i++)
|
||||
array[i] = (0x01 == ((g_Config.CustomKey3.key >> i) & 0x01));
|
||||
cfg = &g_Config.CustomButton3;
|
||||
show = &g_Config.touchCustom3.show;
|
||||
for (int i = 0; i < ARRAY_SIZE(customKeyList); i++)
|
||||
array[i] = (0x01 == ((g_Config.CustomButton3.key >> i) & 0x01));
|
||||
break;
|
||||
case 4:
|
||||
cfg = &g_Config.CustomKey4;
|
||||
show = &g_Config.touchCombo4.show;
|
||||
for (int i = 0; i < ARRAY_SIZE(comboKeyList); i++)
|
||||
array[i] = (0x01 == ((g_Config.CustomKey4.key >> i) & 0x01));
|
||||
cfg = &g_Config.CustomButton4;
|
||||
show = &g_Config.touchCustom4.show;
|
||||
for (int i = 0; i < ARRAY_SIZE(customKeyList); i++)
|
||||
array[i] = (0x01 == ((g_Config.CustomButton4.key >> i) & 0x01));
|
||||
break;
|
||||
case 5:
|
||||
cfg = &g_Config.CustomKey5;
|
||||
show = &g_Config.touchCombo5.show;
|
||||
for (int i = 0; i < ARRAY_SIZE(comboKeyList); i++)
|
||||
array[i] = (0x01 == ((g_Config.CustomKey5.key >> i) & 0x01));
|
||||
cfg = &g_Config.CustomButton5;
|
||||
show = &g_Config.touchCustom5.show;
|
||||
for (int i = 0; i < ARRAY_SIZE(customKeyList); i++)
|
||||
array[i] = (0x01 == ((g_Config.CustomButton5.key >> i) & 0x01));
|
||||
break;
|
||||
case 6:
|
||||
cfg = &g_Config.CustomKey6;
|
||||
show = &g_Config.touchCombo6.show;
|
||||
for (int i = 0; i < ARRAY_SIZE(comboKeyList); i++)
|
||||
array[i] = (0x01 == ((g_Config.CustomKey6.key >> i) & 0x01));
|
||||
cfg = &g_Config.CustomButton6;
|
||||
show = &g_Config.touchCustom6.show;
|
||||
for (int i = 0; i < ARRAY_SIZE(customKeyList); i++)
|
||||
array[i] = (0x01 == ((g_Config.CustomButton6.key >> i) & 0x01));
|
||||
break;
|
||||
case 7:
|
||||
cfg = &g_Config.CustomKey7;
|
||||
show = &g_Config.touchCombo7.show;
|
||||
for (int i = 0; i < ARRAY_SIZE(comboKeyList); i++)
|
||||
array[i] = (0x01 == ((g_Config.CustomKey7.key >> i) & 0x01));
|
||||
cfg = &g_Config.CustomButton7;
|
||||
show = &g_Config.touchCustom7.show;
|
||||
for (int i = 0; i < ARRAY_SIZE(customKeyList); i++)
|
||||
array[i] = (0x01 == ((g_Config.CustomButton7.key >> i) & 0x01));
|
||||
break;
|
||||
case 8:
|
||||
cfg = &g_Config.CustomKey8;
|
||||
show = &g_Config.touchCombo8.show;
|
||||
for (int i = 0; i < ARRAY_SIZE(comboKeyList); i++)
|
||||
array[i] = (0x01 == ((g_Config.CustomKey8.key >> i) & 0x01));
|
||||
cfg = &g_Config.CustomButton8;
|
||||
show = &g_Config.touchCustom8.show;
|
||||
for (int i = 0; i < ARRAY_SIZE(customKeyList); i++)
|
||||
array[i] = (0x01 == ((g_Config.CustomButton8.key >> i) & 0x01));
|
||||
break;
|
||||
case 9:
|
||||
cfg = &g_Config.CustomKey9;
|
||||
show = &g_Config.touchCombo9.show;
|
||||
for (int i = 0; i < ARRAY_SIZE(comboKeyList); i++)
|
||||
array[i] = (0x01 == ((g_Config.CustomKey9.key >> i) & 0x01));
|
||||
cfg = &g_Config.CustomButton9;
|
||||
show = &g_Config.touchCustom9.show;
|
||||
for (int i = 0; i < ARRAY_SIZE(customKeyList); i++)
|
||||
array[i] = (0x01 == ((g_Config.CustomButton9.key >> i) & 0x01));
|
||||
break;
|
||||
default:
|
||||
// This shouldn't happen, let's just not crash.
|
||||
cfg = &g_Config.CustomKey0;
|
||||
show = &g_Config.touchCombo0.show;
|
||||
cfg = &g_Config.CustomButton0;
|
||||
show = &g_Config.touchCustom0.show;
|
||||
break;
|
||||
}
|
||||
|
||||
leftColumn->Add(new ButtonPreview(g_Config.iTouchButtonStyle == 0 ? comboKeyShapes[cfg->shape].i : comboKeyShapes[cfg->shape].l,
|
||||
comboKeyImages[cfg->image].i, comboKeyImages[cfg->image].r, comboKeyShapes[cfg->shape].f, comboKeyShapes[cfg->shape].r, 62, 82));
|
||||
leftColumn->Add(new ButtonPreview(g_Config.iTouchButtonStyle == 0 ? customKeyShapes[cfg->shape].i : customKeyShapes[cfg->shape].l,
|
||||
customKeyImages[cfg->image].i, customKeyImages[cfg->image].r, customKeyShapes[cfg->shape].f, customKeyShapes[cfg->shape].r, 62, 82));
|
||||
|
||||
root__->Add(leftColumn);
|
||||
rightScroll_ = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(WRAP_CONTENT, WRAP_CONTENT, 1.0f));
|
||||
@ -215,7 +215,7 @@ void ComboKeyScreen::CreateViews() {
|
||||
vertLayout->Add(new CheckBox(show, co->T("Visible")));
|
||||
|
||||
Choice *icon = vertLayout->Add(new Choice(co->T("Icon")));
|
||||
icon->SetIcon(ImageID(comboKeyImages[cfg->image].i), 1.0f, comboKeyImages[cfg->image].r*PI/180, false, false); // Set right icon on the choice
|
||||
icon->SetIcon(ImageID(customKeyImages[cfg->image].i), 1.0f, customKeyImages[cfg->image].r*PI/180, false, false); // Set right icon on the choice
|
||||
icon->OnClick.Add([=](UI::EventParams &e) {
|
||||
auto iconScreen = new ButtonIconScreen(co->T("Icon"), &(cfg->image));
|
||||
if (e.v)
|
||||
@ -226,7 +226,7 @@ void ComboKeyScreen::CreateViews() {
|
||||
});
|
||||
|
||||
Choice *shape = vertLayout->Add(new Choice(co->T("Shape")));
|
||||
shape->SetIcon(ImageID(comboKeyShapes[cfg->shape].l), 0.6f, comboKeyShapes[cfg->shape].r*PI/180, comboKeyShapes[cfg->shape].f, false); // Set right icon on the choice
|
||||
shape->SetIcon(ImageID(customKeyShapes[cfg->shape].l), 0.6f, customKeyShapes[cfg->shape].r*PI/180, customKeyShapes[cfg->shape].f, false); // Set right icon on the choice
|
||||
shape->OnClick.Add([=](UI::EventParams &e) {
|
||||
auto shape = new ButtonShapeScreen(co->T("Shape"), &(cfg->shape));
|
||||
if (e.v)
|
||||
@ -246,7 +246,7 @@ void ComboKeyScreen::CreateViews() {
|
||||
GridLayout *grid = vertLayout->Add(new GridLayout(gridsettings, new LayoutParams(FILL_PARENT, WRAP_CONTENT)));
|
||||
|
||||
// Button image and action are defined in GamepadEmu.h
|
||||
for (int i = 0; i < ARRAY_SIZE(comboKeyList); ++i) {
|
||||
for (int i = 0; i < ARRAY_SIZE(customKeyList); ++i) {
|
||||
LinearLayout *row = new LinearLayout(ORIENT_HORIZONTAL, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT));
|
||||
row->SetSpacing(0);
|
||||
|
||||
@ -254,10 +254,10 @@ void ComboKeyScreen::CreateViews() {
|
||||
row->Add(checkbox);
|
||||
|
||||
Choice *choice;
|
||||
if (comboKeyList[i].i.isValid()) {
|
||||
choice = new Choice(comboKeyList[i].i, new LinearLayoutParams(1.0f));
|
||||
if (customKeyList[i].i.isValid()) {
|
||||
choice = new Choice(customKeyList[i].i, new LinearLayoutParams(1.0f));
|
||||
} else {
|
||||
choice = new Choice(mc->T(KeyMap::GetPspButtonNameCharPointer(comboKeyList[i].c)), new LinearLayoutParams(1.0f));
|
||||
choice = new Choice(mc->T(KeyMap::GetPspButtonNameCharPointer(customKeyList[i].c)), new LinearLayoutParams(1.0f));
|
||||
}
|
||||
|
||||
ChoiceEventHandler *choiceEventHandler = new ChoiceEventHandler(checkbox);
|
||||
@ -270,9 +270,9 @@ void ComboKeyScreen::CreateViews() {
|
||||
}
|
||||
}
|
||||
|
||||
static uint64_t arrayToInt(const bool ary[ARRAY_SIZE(CustomKey::comboKeyList)]) {
|
||||
static uint64_t arrayToInt(const bool ary[ARRAY_SIZE(CustomKeyData::customKeyList)]) {
|
||||
uint64_t value = 0;
|
||||
for (int i = ARRAY_SIZE(CustomKey::comboKeyList)-1; i >= 0; i--) {
|
||||
for (int i = ARRAY_SIZE(CustomKeyData::customKeyList)-1; i >= 0; i--) {
|
||||
value |= ary[i] ? 1 : 0;
|
||||
if (i > 0) {
|
||||
value = value << 1;
|
||||
@ -281,52 +281,52 @@ static uint64_t arrayToInt(const bool ary[ARRAY_SIZE(CustomKey::comboKeyList)])
|
||||
return value;
|
||||
}
|
||||
|
||||
void ComboKeyScreen::saveArray() {
|
||||
void CustomButtonMappingScreen::saveArray() {
|
||||
switch (id_) {
|
||||
case 0:
|
||||
g_Config.CustomKey0.key = arrayToInt(array);
|
||||
g_Config.CustomButton0.key = arrayToInt(array);
|
||||
break;
|
||||
case 1:
|
||||
g_Config.CustomKey1.key = arrayToInt(array);
|
||||
g_Config.CustomButton1.key = arrayToInt(array);
|
||||
break;
|
||||
case 2:
|
||||
g_Config.CustomKey2.key = arrayToInt(array);
|
||||
g_Config.CustomButton2.key = arrayToInt(array);
|
||||
break;
|
||||
case 3:
|
||||
g_Config.CustomKey3.key = arrayToInt(array);
|
||||
g_Config.CustomButton3.key = arrayToInt(array);
|
||||
break;
|
||||
case 4:
|
||||
g_Config.CustomKey4.key = arrayToInt(array);
|
||||
g_Config.CustomButton4.key = arrayToInt(array);
|
||||
break;
|
||||
case 5:
|
||||
g_Config.CustomKey5.key = arrayToInt(array);
|
||||
g_Config.CustomButton5.key = arrayToInt(array);
|
||||
break;
|
||||
case 6:
|
||||
g_Config.CustomKey6.key = arrayToInt(array);
|
||||
g_Config.CustomButton6.key = arrayToInt(array);
|
||||
break;
|
||||
case 7:
|
||||
g_Config.CustomKey7.key = arrayToInt(array);
|
||||
g_Config.CustomButton7.key = arrayToInt(array);
|
||||
break;
|
||||
case 8:
|
||||
g_Config.CustomKey8.key = arrayToInt(array);
|
||||
g_Config.CustomButton8.key = arrayToInt(array);
|
||||
break;
|
||||
case 9:
|
||||
g_Config.CustomKey9.key = arrayToInt(array);
|
||||
g_Config.CustomButton9.key = arrayToInt(array);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void ComboKeyScreen::dialogFinished(const Screen *dialog, DialogResult result) {
|
||||
void CustomButtonMappingScreen::dialogFinished(const Screen *dialog, DialogResult result) {
|
||||
saveArray();
|
||||
RecreateViews();
|
||||
}
|
||||
|
||||
void ComboKeyScreen::onFinish(DialogResult result) {
|
||||
void CustomButtonMappingScreen::onFinish(DialogResult result) {
|
||||
saveArray();
|
||||
g_Config.Save("ComboKeyScreen::onFinish");
|
||||
g_Config.Save("CustomButtonMappingScreen::onFinish");
|
||||
}
|
||||
|
||||
UI::EventReturn ComboKeyScreen::ChoiceEventHandler::onChoiceClick(UI::EventParams &e){
|
||||
UI::EventReturn CustomButtonMappingScreen::ChoiceEventHandler::onChoiceClick(UI::EventParams &e){
|
||||
checkbox_->Toggle();
|
||||
return UI::EVENT_DONE;
|
||||
};
|
@ -24,11 +24,11 @@ namespace UI {
|
||||
class CheckBox;
|
||||
}
|
||||
|
||||
class ComboKeyScreen : public UIDialogScreenWithGameBackground {
|
||||
class CustomButtonMappingScreen : public UIDialogScreenWithGameBackground {
|
||||
public:
|
||||
ComboKeyScreen(const Path &gamePath, int id) : UIDialogScreenWithGameBackground(gamePath), id_(id) {}
|
||||
CustomButtonMappingScreen(const Path &gamePath, int id) : UIDialogScreenWithGameBackground(gamePath), id_(id) {}
|
||||
|
||||
const char *tag() const override { return "ComboKey"; }
|
||||
const char *tag() const override { return "CustomKey"; }
|
||||
|
||||
void CreateViews() override;
|
||||
void onFinish(DialogResult result) override;
|
||||
@ -39,9 +39,10 @@ protected:
|
||||
private:
|
||||
void saveArray();
|
||||
|
||||
bool array[ARRAY_SIZE(CustomKey::comboKeyList)];
|
||||
bool array[ARRAY_SIZE(CustomKeyData::customKeyList)]{};
|
||||
int id_;
|
||||
UI::ScrollView *rightScroll_;
|
||||
UI::ScrollView *rightScroll_ = nullptr;
|
||||
|
||||
class ChoiceEventHandler{
|
||||
public:
|
||||
ChoiceEventHandler(UI::CheckBox *checkbox) : checkbox_(checkbox) {}
|
||||
@ -50,4 +51,3 @@ private:
|
||||
UI::CheckBox *checkbox_;
|
||||
};
|
||||
};
|
||||
|
@ -189,11 +189,11 @@ bool PSPButton::Touch(const TouchInput &input) {
|
||||
return retval;
|
||||
}
|
||||
|
||||
bool ComboKey::IsDown() {
|
||||
bool CustomKey::IsDown() {
|
||||
return (toggle_ && on_) || (!toggle_ && pointerDownMask_ != 0);
|
||||
}
|
||||
|
||||
void ComboKey::GetContentDimensions(const UIContext &dc, float &w, float &h) const {
|
||||
void CustomKey::GetContentDimensions(const UIContext &dc, float &w, float &h) const {
|
||||
MultiTouchButton::GetContentDimensions(dc, w, h);
|
||||
if (invertedContextDimension_) {
|
||||
float tmp = w;
|
||||
@ -202,8 +202,8 @@ void ComboKey::GetContentDimensions(const UIContext &dc, float &w, float &h) con
|
||||
}
|
||||
}
|
||||
|
||||
bool ComboKey::Touch(const TouchInput &input) {
|
||||
using namespace CustomKey;
|
||||
bool CustomKey::Touch(const TouchInput &input) {
|
||||
using namespace CustomKeyData;
|
||||
bool lastDown = pointerDownMask_ != 0;
|
||||
bool retval = MultiTouchButton::Touch(input);
|
||||
bool down = pointerDownMask_ != 0;
|
||||
@ -213,18 +213,18 @@ bool ComboKey::Touch(const TouchInput &input) {
|
||||
System_Vibrate(HAPTIC_VIRTUAL_KEY);
|
||||
|
||||
if (!repeat_) {
|
||||
for (int i = 0; i < ARRAY_SIZE(comboKeyList); i++) {
|
||||
for (int i = 0; i < ARRAY_SIZE(customKeyList); i++) {
|
||||
if (pspButtonBit_ & (1ULL << i)) {
|
||||
controlMapper_->pspKey(DEVICE_ID_TOUCH, comboKeyList[i].c, (on_ && toggle_) ? KEY_UP : KEY_DOWN);
|
||||
controlMapper_->pspKey(DEVICE_ID_TOUCH, customKeyList[i].c, (on_ && toggle_) ? KEY_UP : KEY_DOWN);
|
||||
}
|
||||
}
|
||||
}
|
||||
on_ = toggle_ ? !on_ : true;
|
||||
} else if (!toggle_ && lastDown && !down) {
|
||||
if (!repeat_) {
|
||||
for (int i = 0; i < ARRAY_SIZE(comboKeyList); i++) {
|
||||
for (int i = 0; i < ARRAY_SIZE(customKeyList); i++) {
|
||||
if (pspButtonBit_ & (1ULL << i)) {
|
||||
controlMapper_->pspKey(DEVICE_ID_TOUCH, comboKeyList[i].c, KEY_UP);
|
||||
controlMapper_->pspKey(DEVICE_ID_TOUCH, customKeyList[i].c, KEY_UP);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -233,9 +233,9 @@ bool ComboKey::Touch(const TouchInput &input) {
|
||||
return retval;
|
||||
}
|
||||
|
||||
void ComboKey::Update() {
|
||||
void CustomKey::Update() {
|
||||
MultiTouchButton::Update();
|
||||
using namespace CustomKey;
|
||||
using namespace CustomKeyData;
|
||||
|
||||
if (repeat_) {
|
||||
// Give the game some time to process the input, frame based so it's faster when fast-forwarding.
|
||||
@ -244,15 +244,15 @@ void ComboKey::Update() {
|
||||
if (pressedFrames_ == 2*DOWN_FRAME) {
|
||||
pressedFrames_ = 0;
|
||||
} else if (pressedFrames_ == DOWN_FRAME) {
|
||||
for (int i = 0; i < ARRAY_SIZE(comboKeyList); i++) {
|
||||
for (int i = 0; i < ARRAY_SIZE(customKeyList); i++) {
|
||||
if (pspButtonBit_ & (1ULL << i)) {
|
||||
controlMapper_->pspKey(DEVICE_ID_TOUCH, comboKeyList[i].c, KEY_UP);
|
||||
controlMapper_->pspKey(DEVICE_ID_TOUCH, customKeyList[i].c, KEY_UP);
|
||||
}
|
||||
}
|
||||
} else if (on_ && pressedFrames_ == 0) {
|
||||
for (int i = 0; i < ARRAY_SIZE(comboKeyList); i++) {
|
||||
for (int i = 0; i < ARRAY_SIZE(customKeyList); i++) {
|
||||
if (pspButtonBit_ & (1ULL << i)) {
|
||||
controlMapper_->pspKey(DEVICE_ID_TOUCH, comboKeyList[i].c, KEY_DOWN);
|
||||
controlMapper_->pspKey(DEVICE_ID_TOUCH, customKeyList[i].c, KEY_DOWN);
|
||||
}
|
||||
}
|
||||
pressedFrames_ = 1;
|
||||
@ -742,43 +742,43 @@ void InitPadLayout(float xres, float yres, float globalScale) {
|
||||
//Combo key
|
||||
int combo_key_X = halfW + bottom_key_spacing * scale * 1.2f;
|
||||
int combo_key_Y = yres / 2;
|
||||
initTouchPos(g_Config.touchCombo0, combo_key_X, combo_key_Y);
|
||||
initTouchPos(g_Config.touchCustom0, combo_key_X, combo_key_Y);
|
||||
|
||||
int combo1_key_X = halfW + bottom_key_spacing * scale * 2.2f;
|
||||
int combo1_key_Y = yres / 2;
|
||||
initTouchPos(g_Config.touchCombo1, combo1_key_X, combo1_key_Y);
|
||||
initTouchPos(g_Config.touchCustom1, combo1_key_X, combo1_key_Y);
|
||||
|
||||
int combo2_key_X = halfW + bottom_key_spacing * scale * 3.2f;
|
||||
int combo2_key_Y = yres / 2;
|
||||
initTouchPos(g_Config.touchCombo2, combo2_key_X, combo2_key_Y);
|
||||
initTouchPos(g_Config.touchCustom2, combo2_key_X, combo2_key_Y);
|
||||
|
||||
int combo3_key_X = halfW + bottom_key_spacing * scale * 1.2f;
|
||||
int combo3_key_Y = yres / 3;
|
||||
initTouchPos(g_Config.touchCombo3, combo3_key_X, combo3_key_Y);
|
||||
initTouchPos(g_Config.touchCustom3, combo3_key_X, combo3_key_Y);
|
||||
|
||||
int combo4_key_X = halfW + bottom_key_spacing * scale * 2.2f;
|
||||
int combo4_key_Y = yres / 3;
|
||||
initTouchPos(g_Config.touchCombo4, combo4_key_X, combo4_key_Y);
|
||||
initTouchPos(g_Config.touchCustom4, combo4_key_X, combo4_key_Y);
|
||||
|
||||
int combo5_key_X = halfW - bottom_key_spacing * scale * 1.2f;
|
||||
int combo5_key_Y = yres / 2;
|
||||
initTouchPos(g_Config.touchCombo5, combo5_key_X, combo5_key_Y);
|
||||
initTouchPos(g_Config.touchCustom5, combo5_key_X, combo5_key_Y);
|
||||
|
||||
int combo6_key_X = halfW - bottom_key_spacing * scale * 2.2f;
|
||||
int combo6_key_Y = yres / 2;
|
||||
initTouchPos(g_Config.touchCombo6, combo6_key_X, combo6_key_Y);
|
||||
initTouchPos(g_Config.touchCustom6, combo6_key_X, combo6_key_Y);
|
||||
|
||||
int combo7_key_X = halfW - bottom_key_spacing * scale * 3.2f;
|
||||
int combo7_key_Y = yres / 2;
|
||||
initTouchPos(g_Config.touchCombo7, combo7_key_X, combo7_key_Y);
|
||||
initTouchPos(g_Config.touchCustom7, combo7_key_X, combo7_key_Y);
|
||||
|
||||
int combo8_key_X = halfW - bottom_key_spacing * scale * 1.2f;
|
||||
int combo8_key_Y = yres / 3;
|
||||
initTouchPos(g_Config.touchCombo8, combo8_key_X, combo8_key_Y);
|
||||
initTouchPos(g_Config.touchCustom8, combo8_key_X, combo8_key_Y);
|
||||
|
||||
int combo9_key_X = halfW - bottom_key_spacing * scale * 2.2f;
|
||||
int combo9_key_Y = yres / 3;
|
||||
initTouchPos(g_Config.touchCombo9, combo9_key_X, combo9_key_Y);
|
||||
initTouchPos(g_Config.touchCustom9, combo9_key_X, combo9_key_Y);
|
||||
}
|
||||
|
||||
UI::ViewGroup *CreatePadLayout(float xres, float yres, bool *pause, bool showPauseButton, ControlMapper* controllMapper) {
|
||||
@ -826,14 +826,14 @@ UI::ViewGroup *CreatePadLayout(float xres, float yres, bool *pause, bool showPau
|
||||
}
|
||||
return nullptr;
|
||||
};
|
||||
auto addComboKey = [=](const ConfigCustomButton& cfg, const char *key, const ConfigTouchPos &touch) -> ComboKey * {
|
||||
using namespace CustomKey;
|
||||
auto addCustomButton = [=](const ConfigCustomButton& cfg, const char *key, const ConfigTouchPos &touch) -> CustomKey * {
|
||||
using namespace CustomKeyData;
|
||||
if (touch.show) {
|
||||
auto aux = root->Add(new ComboKey(cfg.key, key, cfg.toggle, cfg.repeat, controllMapper,
|
||||
g_Config.iTouchButtonStyle == 0 ? comboKeyShapes[cfg.shape].i : comboKeyShapes[cfg.shape].l, comboKeyShapes[cfg.shape].i,
|
||||
comboKeyImages[cfg.image].i, touch.scale, comboKeyShapes[cfg.shape].d, buttonLayoutParams(touch)));
|
||||
aux->SetAngle(comboKeyImages[cfg.image].r, comboKeyShapes[cfg.shape].r);
|
||||
aux->FlipImageH(comboKeyShapes[cfg.shape].f);
|
||||
auto aux = root->Add(new CustomKey(cfg.key, key, cfg.toggle, cfg.repeat, controllMapper,
|
||||
g_Config.iTouchButtonStyle == 0 ? customKeyShapes[cfg.shape].i : customKeyShapes[cfg.shape].l, customKeyShapes[cfg.shape].i,
|
||||
customKeyImages[cfg.image].i, touch.scale, customKeyShapes[cfg.shape].d, buttonLayoutParams(touch)));
|
||||
aux->SetAngle(customKeyImages[cfg.image].r, customKeyShapes[cfg.shape].r);
|
||||
aux->FlipImageH(customKeyShapes[cfg.shape].f);
|
||||
return aux;
|
||||
}
|
||||
return nullptr;
|
||||
@ -885,16 +885,16 @@ UI::ViewGroup *CreatePadLayout(float xres, float yres, bool *pause, bool showPau
|
||||
root->Add(new PSPStick(stickBg, "Right analog stick", stickImage, ImageID("I_STICK"), 1, g_Config.touchRightAnalogStick.scale, buttonLayoutParams(g_Config.touchRightAnalogStick)));
|
||||
}
|
||||
|
||||
addComboKey(g_Config.CustomKey0, "Custom 1 button", g_Config.touchCombo0);
|
||||
addComboKey(g_Config.CustomKey1, "Custom 2 button", g_Config.touchCombo1);
|
||||
addComboKey(g_Config.CustomKey2, "Custom 3 button", g_Config.touchCombo2);
|
||||
addComboKey(g_Config.CustomKey3, "Custom 4 button", g_Config.touchCombo3);
|
||||
addComboKey(g_Config.CustomKey4, "Custom 5 button", g_Config.touchCombo4);
|
||||
addComboKey(g_Config.CustomKey5, "Custom 6 button", g_Config.touchCombo5);
|
||||
addComboKey(g_Config.CustomKey6, "Custom 7 button", g_Config.touchCombo6);
|
||||
addComboKey(g_Config.CustomKey7, "Custom 8 button", g_Config.touchCombo7);
|
||||
addComboKey(g_Config.CustomKey8, "Custom 9 button", g_Config.touchCombo8);
|
||||
addComboKey(g_Config.CustomKey9, "Custom 10 button", g_Config.touchCombo9);
|
||||
addCustomButton(g_Config.CustomButton0, "Custom 1 button", g_Config.touchCustom0);
|
||||
addCustomButton(g_Config.CustomButton1, "Custom 2 button", g_Config.touchCustom1);
|
||||
addCustomButton(g_Config.CustomButton2, "Custom 3 button", g_Config.touchCustom2);
|
||||
addCustomButton(g_Config.CustomButton3, "Custom 4 button", g_Config.touchCustom3);
|
||||
addCustomButton(g_Config.CustomButton4, "Custom 5 button", g_Config.touchCustom4);
|
||||
addCustomButton(g_Config.CustomButton5, "Custom 6 button", g_Config.touchCustom5);
|
||||
addCustomButton(g_Config.CustomButton6, "Custom 7 button", g_Config.touchCustom6);
|
||||
addCustomButton(g_Config.CustomButton7, "Custom 8 button", g_Config.touchCustom7);
|
||||
addCustomButton(g_Config.CustomButton8, "Custom 9 button", g_Config.touchCustom8);
|
||||
addCustomButton(g_Config.CustomButton9, "Custom 10 button", g_Config.touchCustom9);
|
||||
|
||||
if (g_Config.bGestureControlEnabled)
|
||||
root->Add(new GestureGamepad(controllMapper));
|
||||
|
@ -172,9 +172,9 @@ UI::ViewGroup *CreatePadLayout(float xres, float yres, bool *pause, bool showPau
|
||||
const int D_pad_Radius = 50;
|
||||
const int baseActionButtonSpacing = 60;
|
||||
|
||||
class ComboKey : public MultiTouchButton {
|
||||
class CustomKey : public MultiTouchButton {
|
||||
public:
|
||||
ComboKey(uint64_t pspButtonBit, const char *key, bool toggle, bool repeat, ControlMapper* controllMapper, ImageID bgImg, ImageID bgDownImg, ImageID img, float scale, bool invertedContextDimension, UI::LayoutParams *layoutParams)
|
||||
CustomKey(uint64_t pspButtonBit, const char *key, bool toggle, bool repeat, ControlMapper* controllMapper, ImageID bgImg, ImageID bgDownImg, ImageID img, float scale, bool invertedContextDimension, UI::LayoutParams *layoutParams)
|
||||
: MultiTouchButton(key, bgImg, bgDownImg, img, scale, layoutParams), pspButtonBit_(pspButtonBit), toggle_(toggle), repeat_(repeat), controlMapper_(controllMapper), on_(false), invertedContextDimension_(invertedContextDimension) {
|
||||
}
|
||||
bool Touch(const TouchInput &input) override;
|
||||
@ -217,13 +217,13 @@ protected:
|
||||
};
|
||||
|
||||
// Just edit this to add new image, shape or button function
|
||||
namespace CustomKey {
|
||||
namespace CustomKeyData {
|
||||
// Image list
|
||||
struct keyImage {
|
||||
ImageID i; // ImageID
|
||||
float r; // Rotation angle in degree
|
||||
};
|
||||
static const keyImage comboKeyImages[] = {
|
||||
static const keyImage customKeyImages[] = {
|
||||
{ ImageID("I_1"), 0.0f },
|
||||
{ ImageID("I_2"), 0.0f },
|
||||
{ ImageID("I_3"), 0.0f },
|
||||
@ -269,7 +269,7 @@ namespace CustomKey {
|
||||
bool f; // Flip Horizontally
|
||||
bool d; // Invert height and width for context dimension (for example for 90 degree rot)
|
||||
};
|
||||
static const keyShape comboKeyShapes[] = {
|
||||
static const keyShape customKeyShapes[] = {
|
||||
{ ImageID("I_ROUND"), ImageID("I_ROUND_LINE"), 0.0f, false, false },
|
||||
{ ImageID("I_RECT"), ImageID("I_RECT_LINE"), 0.0f, false, false },
|
||||
{ ImageID("I_RECT"), ImageID("I_RECT_LINE"), 90.0f, false, true },
|
||||
@ -287,7 +287,7 @@ namespace CustomKey {
|
||||
ImageID i; // UI ImageID
|
||||
uint32_t c; // Key code
|
||||
};
|
||||
static const keyList comboKeyList[] = {
|
||||
static const keyList customKeyList[] = {
|
||||
{ ImageID("I_SQUARE"), CTRL_SQUARE },
|
||||
{ ImageID("I_TRIANGLE"), CTRL_TRIANGLE },
|
||||
{ ImageID("I_CIRCLE"), CTRL_CIRCLE },
|
||||
@ -329,7 +329,7 @@ namespace CustomKey {
|
||||
{ ImageID::invalid(), VIRTKEY_AXIS_X_MAX },
|
||||
{ ImageID::invalid(), VIRTKEY_AXIS_Y_MAX },
|
||||
};
|
||||
static_assert(ARRAY_SIZE(comboKeyList) <= 64, "Too many key for a uint64_t bit mask");
|
||||
static_assert(ARRAY_SIZE(customKeyList) <= 64, "Too many key for a uint64_t bit mask");
|
||||
};
|
||||
|
||||
// Gesture key only have virtual button that can work without constant press
|
||||
|
@ -454,7 +454,7 @@ void ControlLayoutView::Draw(UIContext& dc) {
|
||||
}
|
||||
|
||||
void ControlLayoutView::CreateViews() {
|
||||
using namespace CustomKey;
|
||||
using namespace CustomKeyData;
|
||||
const Bounds &bounds = GetBounds();
|
||||
if (bounds.w == 0.0f || bounds.h == 0.0f) {
|
||||
// Layout hasn't happened yet, return.
|
||||
@ -510,26 +510,26 @@ void ControlLayoutView::CreateViews() {
|
||||
controls_.push_back(new PSPStickDragDrop(g_Config.touchRightAnalogStick, "Right analog stick", stickBg, stickImage, bounds, g_Config.fRightStickHeadScale));
|
||||
}
|
||||
|
||||
auto addDragComboKey = [&](ConfigTouchPos &pos, const char *key, const ConfigCustomButton& cfg) {
|
||||
auto addDragCustomKey = [&](ConfigTouchPos &pos, const char *key, const ConfigCustomButton& cfg) {
|
||||
DragDropButton *b = nullptr;
|
||||
if (pos.show) {
|
||||
b = new DragDropButton(pos, key, g_Config.iTouchButtonStyle == 0 ? comboKeyShapes[cfg.shape].i : comboKeyShapes[cfg.shape].l, comboKeyImages[cfg.image].i, bounds);
|
||||
b->FlipImageH(comboKeyShapes[cfg.shape].f);
|
||||
b->SetAngle(comboKeyImages[cfg.image].r, comboKeyShapes[cfg.shape].r);
|
||||
b = new DragDropButton(pos, key, g_Config.iTouchButtonStyle == 0 ? customKeyShapes[cfg.shape].i : customKeyShapes[cfg.shape].l, customKeyImages[cfg.image].i, bounds);
|
||||
b->FlipImageH(customKeyShapes[cfg.shape].f);
|
||||
b->SetAngle(customKeyImages[cfg.image].r, customKeyShapes[cfg.shape].r);
|
||||
controls_.push_back(b);
|
||||
}
|
||||
return b;
|
||||
};
|
||||
addDragComboKey(g_Config.touchCombo0, "Custom 1 button", g_Config.CustomKey0);
|
||||
addDragComboKey(g_Config.touchCombo1, "Custom 2 button", g_Config.CustomKey1);
|
||||
addDragComboKey(g_Config.touchCombo2, "Custom 3 button", g_Config.CustomKey2);
|
||||
addDragComboKey(g_Config.touchCombo3, "Custom 4 button", g_Config.CustomKey3);
|
||||
addDragComboKey(g_Config.touchCombo4, "Custom 5 button", g_Config.CustomKey4);
|
||||
addDragComboKey(g_Config.touchCombo5, "Custom 6 button", g_Config.CustomKey5);
|
||||
addDragComboKey(g_Config.touchCombo6, "Custom 7 button", g_Config.CustomKey6);
|
||||
addDragComboKey(g_Config.touchCombo7, "Custom 8 button", g_Config.CustomKey7);
|
||||
addDragComboKey(g_Config.touchCombo8, "Custom 9 button", g_Config.CustomKey8);
|
||||
addDragComboKey(g_Config.touchCombo9, "Custom 10 button", g_Config.CustomKey9);
|
||||
addDragCustomKey(g_Config.touchCustom0, "Custom 1 button", g_Config.CustomButton0);
|
||||
addDragCustomKey(g_Config.touchCustom1, "Custom 2 button", g_Config.CustomButton1);
|
||||
addDragCustomKey(g_Config.touchCustom2, "Custom 3 button", g_Config.CustomButton2);
|
||||
addDragCustomKey(g_Config.touchCustom3, "Custom 4 button", g_Config.CustomButton3);
|
||||
addDragCustomKey(g_Config.touchCustom4, "Custom 5 button", g_Config.CustomButton4);
|
||||
addDragCustomKey(g_Config.touchCustom5, "Custom 6 button", g_Config.CustomButton5);
|
||||
addDragCustomKey(g_Config.touchCustom6, "Custom 7 button", g_Config.CustomButton6);
|
||||
addDragCustomKey(g_Config.touchCustom7, "Custom 8 button", g_Config.CustomButton7);
|
||||
addDragCustomKey(g_Config.touchCustom8, "Custom 9 button", g_Config.CustomButton8);
|
||||
addDragCustomKey(g_Config.touchCustom9, "Custom 10 button", g_Config.CustomButton9);
|
||||
|
||||
for (size_t i = 0; i < controls_.size(); i++) {
|
||||
Add(controls_[i]);
|
||||
|
@ -16,11 +16,12 @@
|
||||
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
|
||||
|
||||
#include "Common/Render/TextureAtlas.h"
|
||||
|
||||
#include "TouchControlVisibilityScreen.h"
|
||||
#include "Core/Config.h"
|
||||
#include "Common/Data/Text/I18n.h"
|
||||
#include "ComboKeyMappingScreen.h"
|
||||
|
||||
#include "Core/Config.h"
|
||||
|
||||
#include "UI/TouchControlVisibilityScreen.h"
|
||||
#include "UI/CustomButtonMappingScreen.h"
|
||||
|
||||
static const int leftColumnWidth = 140;
|
||||
|
||||
@ -43,7 +44,7 @@ private:
|
||||
|
||||
void TouchControlVisibilityScreen::CreateViews() {
|
||||
using namespace UI;
|
||||
using namespace CustomKey;
|
||||
using namespace CustomKeyData;
|
||||
|
||||
auto di = GetI18NCategory("Dialog");
|
||||
auto co = GetI18NCategory("Controls");
|
||||
@ -88,44 +89,44 @@ void TouchControlVisibilityScreen::CreateViews() {
|
||||
return UI::EVENT_DONE;
|
||||
}});
|
||||
toggles_.push_back({ "Fast-forward", &g_Config.touchFastForwardKey.show, ImageID::invalid(), nullptr });
|
||||
toggles_.push_back({ "Custom 1", &g_Config.touchCombo0.show, ImageID::invalid(), [=](EventParams &e) {
|
||||
screenManager()->push(new ComboKeyScreen(gamePath_, 0));
|
||||
toggles_.push_back({ "Custom 1", &g_Config.touchCustom0.show, ImageID::invalid(), [=](EventParams &e) {
|
||||
screenManager()->push(new CustomButtonMappingScreen(gamePath_, 0));
|
||||
return UI::EVENT_DONE;
|
||||
}});
|
||||
toggles_.push_back({ "Custom 2", &g_Config.touchCombo1.show, ImageID::invalid(), [=](EventParams &e) {
|
||||
screenManager()->push(new ComboKeyScreen(gamePath_, 1));
|
||||
toggles_.push_back({ "Custom 2", &g_Config.touchCustom1.show, ImageID::invalid(), [=](EventParams &e) {
|
||||
screenManager()->push(new CustomButtonMappingScreen(gamePath_, 1));
|
||||
return UI::EVENT_DONE;
|
||||
}});
|
||||
toggles_.push_back({ "Custom 3", &g_Config.touchCombo2.show, ImageID::invalid(), [=](EventParams &e) {
|
||||
screenManager()->push(new ComboKeyScreen(gamePath_, 2));
|
||||
toggles_.push_back({ "Custom 3", &g_Config.touchCustom2.show, ImageID::invalid(), [=](EventParams &e) {
|
||||
screenManager()->push(new CustomButtonMappingScreen(gamePath_, 2));
|
||||
return UI::EVENT_DONE;
|
||||
}});
|
||||
toggles_.push_back({ "Custom 4", &g_Config.touchCombo3.show, ImageID::invalid(), [=](EventParams &e) {
|
||||
screenManager()->push(new ComboKeyScreen(gamePath_, 3));
|
||||
toggles_.push_back({ "Custom 4", &g_Config.touchCustom3.show, ImageID::invalid(), [=](EventParams &e) {
|
||||
screenManager()->push(new CustomButtonMappingScreen(gamePath_, 3));
|
||||
return UI::EVENT_DONE;
|
||||
}});
|
||||
toggles_.push_back({ "Custom 5", &g_Config.touchCombo4.show, ImageID::invalid(), [=](EventParams &e) {
|
||||
screenManager()->push(new ComboKeyScreen(gamePath_, 4));
|
||||
toggles_.push_back({ "Custom 5", &g_Config.touchCustom4.show, ImageID::invalid(), [=](EventParams &e) {
|
||||
screenManager()->push(new CustomButtonMappingScreen(gamePath_, 4));
|
||||
return UI::EVENT_DONE;
|
||||
}});
|
||||
toggles_.push_back({ "Custom 6", &g_Config.touchCombo5.show, ImageID::invalid(), [=](EventParams &e) {
|
||||
screenManager()->push(new ComboKeyScreen(gamePath_, 5));
|
||||
toggles_.push_back({ "Custom 6", &g_Config.touchCustom5.show, ImageID::invalid(), [=](EventParams &e) {
|
||||
screenManager()->push(new CustomButtonMappingScreen(gamePath_, 5));
|
||||
return UI::EVENT_DONE;
|
||||
}});
|
||||
toggles_.push_back({ "Custom 7", &g_Config.touchCombo6.show, ImageID::invalid(), [=](EventParams &e) {
|
||||
screenManager()->push(new ComboKeyScreen(gamePath_, 6));
|
||||
toggles_.push_back({ "Custom 7", &g_Config.touchCustom6.show, ImageID::invalid(), [=](EventParams &e) {
|
||||
screenManager()->push(new CustomButtonMappingScreen(gamePath_, 6));
|
||||
return UI::EVENT_DONE;
|
||||
}});
|
||||
toggles_.push_back({ "Custom 8", &g_Config.touchCombo7.show, ImageID::invalid(), [=](EventParams &e) {
|
||||
screenManager()->push(new ComboKeyScreen(gamePath_, 7));
|
||||
toggles_.push_back({ "Custom 8", &g_Config.touchCustom7.show, ImageID::invalid(), [=](EventParams &e) {
|
||||
screenManager()->push(new CustomButtonMappingScreen(gamePath_, 7));
|
||||
return UI::EVENT_DONE;
|
||||
}});
|
||||
toggles_.push_back({ "Custom 9", &g_Config.touchCombo8.show, ImageID::invalid(), [=](EventParams &e) {
|
||||
screenManager()->push(new ComboKeyScreen(gamePath_, 8));
|
||||
toggles_.push_back({ "Custom 9", &g_Config.touchCustom8.show, ImageID::invalid(), [=](EventParams &e) {
|
||||
screenManager()->push(new CustomButtonMappingScreen(gamePath_, 8));
|
||||
return UI::EVENT_DONE;
|
||||
}});
|
||||
toggles_.push_back({ "Custom 10", &g_Config.touchCombo9.show, ImageID::invalid(), [=](EventParams &e) {
|
||||
screenManager()->push(new ComboKeyScreen(gamePath_, 9));
|
||||
toggles_.push_back({ "Custom 10", &g_Config.touchCustom9.show, ImageID::invalid(), [=](EventParams &e) {
|
||||
screenManager()->push(new CustomButtonMappingScreen(gamePath_, 9));
|
||||
return UI::EVENT_DONE;
|
||||
}});
|
||||
|
||||
|
@ -37,8 +37,8 @@
|
||||
<ItemGroup>
|
||||
<ClCompile Include="BackgroundAudio.cpp" />
|
||||
<ClCompile Include="ChatScreen.cpp" />
|
||||
<ClCompile Include="ComboKeyMappingScreen.cpp" />
|
||||
<ClCompile Include="ControlMappingScreen.cpp" />
|
||||
<ClCompile Include="CustomButtonMappingScreen.cpp" />
|
||||
<ClCompile Include="CwCheatScreen.cpp" />
|
||||
<ClCompile Include="DevScreens.cpp" />
|
||||
<ClCompile Include="DiscordIntegration.cpp" />
|
||||
@ -72,8 +72,8 @@
|
||||
<ClInclude Include="AudioCommon.h" />
|
||||
<ClInclude Include="BackgroundAudio.h" />
|
||||
<ClInclude Include="ChatScreen.h" />
|
||||
<ClInclude Include="ComboKeyMappingScreen.h" />
|
||||
<ClInclude Include="ControlMappingScreen.h" />
|
||||
<ClInclude Include="CustomButtonMappingScreen.h" />
|
||||
<ClInclude Include="DevScreens.h" />
|
||||
<ClInclude Include="DiscordIntegration.h" />
|
||||
<ClInclude Include="DisplayLayoutScreen.h" />
|
||||
|
@ -53,9 +53,6 @@
|
||||
<ClCompile Include="ProfilerDraw.cpp">
|
||||
<Filter>Screens</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ComboKeyMappingScreen.cpp">
|
||||
<Filter>Screens</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="DisplayLayoutScreen.cpp">
|
||||
<Filter>Screens</Filter>
|
||||
</ClCompile>
|
||||
@ -83,6 +80,9 @@
|
||||
<Filter>Views</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="AudioCommon.cpp" />
|
||||
<ClCompile Include="CustomButtonMappingScreen.cpp">
|
||||
<Filter>Screens</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="GameInfoCache.h" />
|
||||
@ -136,9 +136,6 @@
|
||||
<ClInclude Include="ProfilerDraw.h">
|
||||
<Filter>Screens</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="ComboKeyMappingScreen.h">
|
||||
<Filter>Screens</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="DisplayLayoutScreen.h">
|
||||
<Filter>Screens</Filter>
|
||||
</ClInclude>
|
||||
@ -166,6 +163,9 @@
|
||||
<Filter>Views</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="AudioCommon.h" />
|
||||
<ClInclude Include="CustomButtonMappingScreen.h">
|
||||
<Filter>Screens</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Filter Include="Screens">
|
||||
|
@ -268,8 +268,8 @@
|
||||
<ClInclude Include="..\..\UI\AudioCommon.h" />
|
||||
<ClInclude Include="..\..\UI\BackgroundAudio.h" />
|
||||
<ClInclude Include="..\..\UI\ChatScreen.h" />
|
||||
<ClInclude Include="..\..\UI\ComboKeyMappingScreen.h" />
|
||||
<ClInclude Include="..\..\UI\ControlMappingScreen.h" />
|
||||
<ClInclude Include="..\..\UI\CustomButtonMappingScreen.h" />
|
||||
<ClInclude Include="..\..\UI\CwCheatScreen.h" />
|
||||
<ClInclude Include="..\..\UI\DevScreens.h" />
|
||||
<ClInclude Include="..\..\UI\DiscordIntegration.h" />
|
||||
@ -303,8 +303,8 @@
|
||||
<ClCompile Include="..\..\UI\AudioCommon.cpp" />
|
||||
<ClCompile Include="..\..\UI\BackgroundAudio.cpp" />
|
||||
<ClCompile Include="..\..\UI\ChatScreen.cpp" />
|
||||
<ClCompile Include="..\..\UI\ComboKeyMappingScreen.cpp" />
|
||||
<ClCompile Include="..\..\UI\ControlMappingScreen.cpp" />
|
||||
<ClCompile Include="..\..\UI\CustomButtonMappingScreen.cpp" />
|
||||
<ClCompile Include="..\..\UI\CwCheatScreen.cpp" />
|
||||
<ClCompile Include="..\..\UI\DevScreens.cpp" />
|
||||
<ClCompile Include="..\..\UI\DiscordIntegration.cpp" />
|
||||
|
@ -3,7 +3,6 @@
|
||||
<ItemGroup>
|
||||
<ClCompile Include="pch.cpp" />
|
||||
<ClCompile Include="..\..\UI\BackgroundAudio.cpp" />
|
||||
<ClCompile Include="..\..\UI\ComboKeyMappingScreen.cpp" />
|
||||
<ClCompile Include="..\..\UI\ControlMappingScreen.cpp" />
|
||||
<ClCompile Include="..\..\UI\CwCheatScreen.cpp" />
|
||||
<ClCompile Include="..\..\UI\DevScreens.cpp" />
|
||||
@ -34,12 +33,12 @@
|
||||
<ClCompile Include="..\..\UI\Theme.cpp" />
|
||||
<ClCompile Include="..\..\UI\JoystickHistoryView.cpp" />
|
||||
<ClCompile Include="..\..\UI\AudioCommon.cpp" />
|
||||
<ClCompile Include="..\..\UI\CustomButtonMappingScreen.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="pch.h" />
|
||||
<ClInclude Include="targetver.h" />
|
||||
<ClInclude Include="..\..\UI\BackgroundAudio.h" />
|
||||
<ClInclude Include="..\..\UI\ComboKeyMappingScreen.h" />
|
||||
<ClInclude Include="..\..\UI\ControlMappingScreen.h" />
|
||||
<ClInclude Include="..\..\UI\CwCheatScreen.h" />
|
||||
<ClInclude Include="..\..\UI\DevScreens.h" />
|
||||
@ -69,5 +68,6 @@
|
||||
<ClInclude Include="..\..\UI\Theme.h" />
|
||||
<ClInclude Include="..\..\UI\JoystickHistoryView.h" />
|
||||
<ClInclude Include="..\..\UI\AudioCommon.h" />
|
||||
<ClInclude Include="..\..\UI\CustomButtonMappingScreen.h" />
|
||||
</ItemGroup>
|
||||
</Project>
|
@ -745,7 +745,7 @@ LOCAL_SRC_FILES := \
|
||||
$(SRC)/UI/ProfilerDraw.cpp \
|
||||
$(SRC)/UI/NativeApp.cpp \
|
||||
$(SRC)/UI/Theme.cpp \
|
||||
$(SRC)/UI/ComboKeyMappingScreen.cpp
|
||||
$(SRC)/UI/CustomButtonMappingScreen.cpp
|
||||
|
||||
ifneq ($(SKIPAPP),1)
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
|
Loading…
Reference in New Issue
Block a user