Merge pull request #8096 from hrydgard/xiushudongfang-Combo-Key

Xiushudongfang's Combo Key, with some updates
This commit is contained in:
Henrik Rydgård 2015-10-24 13:24:00 +02:00
commit 624d9003a3
30 changed files with 5219 additions and 4581 deletions

1
.gitignore vendored
View File

@ -32,6 +32,7 @@ ext/_Output
android/lint.xml
PPSSPPWindows64.exe.manifest
PPSSPPWindows.exe.manifest
assets/flash0
# For Mac
.DS_Store

View File

@ -864,7 +864,8 @@ set(NativeAppSource
UI/CwCheatScreen.cpp
UI/InstallZipScreen.cpp
UI/ProfilerDraw.cpp
UI/ui_atlas.cpp)
UI/ui_atlas.cpp
UI/ComboKeyMappingScreen.cpp)
if(ANDROID)
if (ARM)
set(NativeAppSource ${NativeAppSource} android/jni/ArmEmitterTest.cpp)

View File

@ -302,6 +302,7 @@ static ConfigSetting generalSettings[] = {
ConfigSetting("GridView1", &g_Config.bGridView1, true),
ConfigSetting("GridView2", &g_Config.bGridView2, true),
ConfigSetting("GridView3", &g_Config.bGridView3, false),
ConfigSetting("ComboMode", &g_Config.iComboMode, 0),
// "default" means let emulator decide, "" means disable.
ConfigSetting("ReportingHost", &g_Config.sReportHost, "default"),
@ -515,6 +516,18 @@ static ConfigSetting controlSettings[] = {
ConfigSetting("ShowAnalogStick", &g_Config.bShowTouchAnalogStick, true, true, true),
ConfigSetting("ShowTouchDpad", &g_Config.bShowTouchDpad, true, true, true),
ConfigSetting("ShowTouchUnthrottle", &g_Config.bShowTouchUnthrottle, true, true, true),
ConfigSetting("ShowComboKey0", &g_Config.bShowComboKey0, false, true, true),
ConfigSetting("ShowComboKey1", &g_Config.bShowComboKey1, false, true, true),
ConfigSetting("ShowComboKey2", &g_Config.bShowComboKey2, false, true, true),
ConfigSetting("ShowComboKey3", &g_Config.bShowComboKey3, false, true, true),
ConfigSetting("ShowComboKey4", &g_Config.bShowComboKey4, false, true, true),
ConfigSetting("ComboKey0Mapping", &g_Config.iCombokey0, 0, true, true),
ConfigSetting("ComboKey1Mapping", &g_Config.iCombokey1, 0, true, true),
ConfigSetting("ComboKey2Mapping", &g_Config.iCombokey2, 0, true, true),
ConfigSetting("ComboKey3Mapping", &g_Config.iCombokey3, 0, true, true),
ConfigSetting("ComboKey4Mapping", &g_Config.iCombokey4, 0, true, true),
#if !defined(__SYMBIAN32__) && !defined(IOS) && !defined(MAEMO)
#if defined(_WIN32)
// A win32 user seeing touch controls is likely using PPSSPP on a tablet. There it makes
@ -576,6 +589,22 @@ static ConfigSetting controlSettings[] = {
ConfigSetting("AnalogStickX", &g_Config.fAnalogStickX, -1.0f, true, true),
ConfigSetting("AnalogStickY", &g_Config.fAnalogStickY, -1.0f, true, true),
ConfigSetting("AnalogStickScale", &g_Config.fAnalogStickScale, defaultControlScale, true, true),
ConfigSetting("fcombo0X", &g_Config.fcombo0X, -1.0f, true, true),
ConfigSetting("fcombo0Y", &g_Config.fcombo0Y, -1.0f, true, true),
ConfigSetting("comboKeyScale0", &g_Config.fcomboScale0, defaultControlScale, true, true),
ConfigSetting("fcombo1X", &g_Config.fcombo1X, -1.0f, true, true),
ConfigSetting("fcombo1Y", &g_Config.fcombo1Y, -1.0f, true, true),
ConfigSetting("comboKeyScale1", &g_Config.fcomboScale1, defaultControlScale, true, true),
ConfigSetting("fcombo2X", &g_Config.fcombo2X, -1.0f, true, true),
ConfigSetting("fcombo2Y", &g_Config.fcombo2Y, -1.0f, true, true),
ConfigSetting("comboKeyScale2", &g_Config.fcomboScale2, defaultControlScale, true, true),
ConfigSetting("fcombo3X", &g_Config.fcombo3X, -1.0f, true, true),
ConfigSetting("fcombo3Y", &g_Config.fcombo3Y, -1.0f, true, true),
ConfigSetting("comboKeyScale3", &g_Config.fcomboScale3, defaultControlScale, true, true),
ConfigSetting("fcombo4X", &g_Config.fcombo4X, -1.0f, true, true),
ConfigSetting("fcombo4Y", &g_Config.fcombo4Y, -1.0f, true, true),
ConfigSetting("comboKeyScale4", &g_Config.fcomboScale4, defaultControlScale, true, true),
#ifdef _WIN32
ConfigSetting("DInputAnalogDeadzone", &g_Config.fDInputAnalogDeadzone, 0.1f, true, true),
ConfigSetting("DInputAnalogInverseMode", &g_Config.iDInputAnalogInverseMode, 0, true, true),
@ -830,6 +859,16 @@ void Config::Load(const char *iniFileName, const char *controllerIniFilename) {
fRKeyY /= screen_height;
fAnalogStickX /= screen_width;
fAnalogStickY /= screen_height;
fcombo0X /= screen_width;
fcombo0Y /= screen_height;
fcombo1X /= screen_width;
fcombo1Y /= screen_height;
fcombo2X /= screen_width;
fcombo2Y /= screen_height;
fcombo3X /= screen_width;
fcombo3Y /= screen_height;
fcombo4X /= screen_width;
fcombo4Y /= screen_height;
}
const char *gitVer = PPSSPP_GIT_VERSION;
@ -1242,6 +1281,21 @@ void Config::ResetControlLayout() {
g_Config.fAnalogStickX = -1.0;
g_Config.fAnalogStickY = -1.0;
g_Config.fAnalogStickScale = defaultControlScale;
g_Config.fcombo0X = -1.0;
g_Config.fcombo0Y = -1.0;
g_Config.fcomboScale0 = defaultControlScale;
g_Config.fcombo1X = -1.0f;
g_Config.fcombo1Y = -1.0f;
g_Config.fcomboScale1 = defaultControlScale;
g_Config.fcombo2X = -1.0f;
g_Config.fcombo2Y = -1.0f;
g_Config.fcomboScale2 = defaultControlScale;
g_Config.fcombo3X = -1.0f;
g_Config.fcombo3Y = -1.0f;
g_Config.fcomboScale3 = defaultControlScale;
g_Config.fcombo4X = -1.0f;
g_Config.fcombo4Y = -1.0f;
g_Config.fcomboScale4 = defaultControlScale;
}
void Config::GetReportingInfo(UrlEncoder &data) {

View File

@ -231,6 +231,8 @@ public:
bool bGridView1;
bool bGridView2;
bool bGridView3;
//Combo key screen flag
int iComboMode;
// Disable diagonals
bool bDisableDpadDiagonals;
@ -273,6 +275,18 @@ public:
float fAnalogStickX, fAnalogStickY;
float fAnalogStickScale;
//the Combo Button position
float fcombo0X, fcombo0Y;
float fcomboScale0;
float fcombo1X, fcombo1Y;
float fcomboScale1;
float fcombo2X, fcombo2Y;
float fcomboScale2;
float fcombo3X, fcombo3Y;
float fcomboScale3;
float fcombo4X, fcombo4Y;
float fcomboScale4;
// Controls Visibility
bool bShowTouchControls;
@ -291,6 +305,20 @@ public:
bool bShowTouchAnalogStick;
bool bShowTouchDpad;
//Combo Button Visibility
bool bShowComboKey0;
bool bShowComboKey1;
bool bShowComboKey2;
bool bShowComboKey3;
bool bShowComboKey4;
// Combo_key mapping. These are bitfields.
int iCombokey0;
int iCombokey1;
int iCombokey2;
int iCombokey3;
int iCombokey4;
#if !defined(__SYMBIAN32__) && !defined(IOS) && !defined(MAEMO)
bool bShowTouchPause;
#endif

View File

@ -0,0 +1,201 @@
// Copyright (c) 2013- PPSSPP Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0 or later versions.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official git repository and contact information can be found at
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
#include "TouchControlVisibilityScreen.h"
#include "Core/Config.h"
#include "UI/ui_atlas.h"
#include "i18n/i18n.h"
#include "ComboKeyMappingScreen.h"
#include "base/colorutil.h"
#include "base/display.h"
#include "base/timeutil.h"
#include "file/path.h"
#include "gfx_es2/draw_buffer.h"
#include "math/curves.h"
#include "base/stringutil.h"
#include "ui/ui_context.h"
#include "ui/view.h"
#include "ui/viewgroup.h"
void Combo_keyScreen::CreateViews() {
using namespace UI;
I18NCategory *co = GetI18NCategory("Controls");
root_ = new LinearLayout(ORIENT_VERTICAL);
root_->Add(new ItemHeader(co->T("Combo Key Setting")));
LinearLayout *root__ = new LinearLayout(ORIENT_HORIZONTAL, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT));
root_->Add(root__);
LinearLayout *leftColumn = new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(120, FILL_PARENT));
I18NCategory *di = GetI18NCategory("Dialog");
static const int comboKeyImages[5] = {
I_1, I_2, I_3, I_4, I_5,
};
comboselect = new ChoiceStrip(ORIENT_VERTICAL, new AnchorLayoutParams(10, 10, NONE, NONE));
comboselect->SetSpacing(10);
for (int i = 0; i < 5; i++) {
comboselect->AddChoice(comboKeyImages[i]);
}
comboselect->SetSelection(*mode);
comboselect->OnChoice.Handle(this, &Combo_keyScreen::onCombo);
leftColumn->Add(comboselect);
root__->Add(leftColumn);
rightScroll_ = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(1.0f));
LinearLayout *rightColumn = new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(1.0f));
rightScroll_->Add(rightColumn);
leftColumn->Add(new Spacer(new LinearLayoutParams(1.0f)));
leftColumn->Add(new Choice(di->T("Back")))->OnClick.Handle<UIScreen>(this, &UIScreen::OnBack);
root__->Add(rightScroll_);
const int cellSize = 400;
UI::GridLayoutSettings gridsettings(cellSize, 64, 5);
gridsettings.fillCells = true;
GridLayout *grid = rightColumn->Add(new GridLayout(gridsettings, new LayoutParams(FILL_PARENT, WRAP_CONTENT)));
memset(array, 0, sizeof(array));
switch (*mode) {
case 0:
for (int i = 0; i < 16; i++)
array[i] = (0x01 == ((g_Config.iCombokey0 >> i) & 0x01));
break;
case 1:
for (int i = 0; i < 16; i++)
array[i] = (0x01 == ((g_Config.iCombokey1 >> i) & 0x01));
break;
case 2:
for (int i = 0; i < 16; i++)
array[i] = (0x01 == ((g_Config.iCombokey2 >> i) & 0x01));
break;
case 3:
for (int i = 0; i < 16; i++)
array[i] = (0x01 == ((g_Config.iCombokey3 >> i) & 0x01));
break;
case 4:
for (int i = 0; i < 16; i++)
array[i] = (0x01 == ((g_Config.iCombokey4 >> i) & 0x01));
break;
}
std::map<std::string, int> keyImages;
keyImages["Circle"] = I_CIRCLE;
keyImages["Cross"] = I_CROSS;
keyImages["Square"] = I_SQUARE;
keyImages["Triangle"] = I_TRIANGLE;
keyImages["L"] = I_L;
keyImages["R"] = I_R;
keyImages["Start"] = I_START;
keyImages["Select"] = I_SELECT;
keyToggles["Circle"] = &array[13];
keyToggles["Cross"] = &array[14];
keyToggles["Square"] = &array[15];
keyToggles["Triangle"] = &array[12];
keyToggles["L"] = &array[8];
keyToggles["R"] = &array[9];
keyToggles[co->T("Left")] = &array[7];
keyToggles[co->T("Up")] = &array[4];
keyToggles[co->T("Right")] = &array[5];
keyToggles[co->T("Down")] = &array[6];
keyToggles["Start"] = &array[3];
keyToggles["Select"] = &array[0];
std::map<std::string, int>::iterator imageFinder;
I18NCategory *mc = GetI18NCategory("MappableControls");
for (auto i = keyToggles.begin(); i != keyToggles.end(); ++i) {
LinearLayout *row = new LinearLayout(ORIENT_HORIZONTAL, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT));
row->SetSpacing(0);
CheckBox *checkbox = new CheckBox(i->second, "", "", new LinearLayoutParams(50, WRAP_CONTENT));
row->Add(checkbox);
imageFinder = keyImages.find(i->first);
Choice *choice;
if (imageFinder != keyImages.end()) {
choice = new Choice(keyImages[imageFinder->first], new LinearLayoutParams(1.0f));
}
else {
choice = new Choice(mc->T(i->first.c_str()), new LinearLayoutParams(1.0f));
}
ChoiceEventHandler *choiceEventHandler = new ChoiceEventHandler(checkbox);
choice->OnClick.Handle(choiceEventHandler, &ChoiceEventHandler::onChoiceClick);
choice->SetCentered(true);
row->Add(choice);
grid->Add(row);
}
}
static int arrayToInt(bool ary[16]) {
int value = 0;
for (int i = 15; i >= 0; i--) {
value |= ary[i] ? 1 : 0;
value = value << 1;
}
return value >> 1;
}
void Combo_keyScreen::onFinish(DialogResult result) {
switch (*mode) {
case 0:
g_Config.iCombokey0 = arrayToInt(array);
break;
case 1:
g_Config.iCombokey1 = arrayToInt(array);
break;
case 2:
g_Config.iCombokey2 = arrayToInt(array);
break;
case 3:
g_Config.iCombokey3 = arrayToInt(array);
break;
case 4:
g_Config.iCombokey4 = arrayToInt(array);
break;
}
g_Config.Save();
}
UI::EventReturn Combo_keyScreen::ChoiceEventHandler::onChoiceClick(UI::EventParams &e){
checkbox_->Toggle();
return UI::EVENT_DONE;
};
UI::EventReturn Combo_keyScreen::onCombo(UI::EventParams &e) {
switch (*mode){
case 0:g_Config.iCombokey0 = arrayToInt(array);
break;
case 1:g_Config.iCombokey1 = arrayToInt(array);
break;
case 2:g_Config.iCombokey2 = arrayToInt(array);
break;
case 3:g_Config.iCombokey3 = arrayToInt(array);
break;
case 4:g_Config.iCombokey4 = arrayToInt(array);
}
*mode = comboselect->GetSelection();
CreateViews();
return UI::EVENT_DONE;
}

View File

@ -0,0 +1,49 @@
// Copyright (c) 2013- PPSSPP Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0 or later versions.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official git repository and contact information can be found at
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
#pragma once
#include "MiscScreens.h"
#include <map>
namespace UI {
class CheckBox;
}
class Combo_keyScreen : public UIDialogScreenWithBackground {
public:
Combo_keyScreen(int *key): mode(key) {}
virtual void CreateViews();
virtual void onFinish(DialogResult result);
UI::EventReturn onCombo(UI::EventParams &e);
private:
std::map<std::string, bool*> keyToggles;
bool array[16];
int *mode;
UI::ChoiceStrip *comboselect;
UI::ScrollView *rightScroll_;
class ChoiceEventHandler{
public:
ChoiceEventHandler(UI::CheckBox *checkbox) : checkbox_(checkbox) {}
UI::EventReturn onChoiceClick(UI::EventParams &e);
private:
UI::CheckBox *checkbox_;
};
};

View File

@ -38,6 +38,7 @@
#include "UI/TouchControlVisibilityScreen.h"
#include "UI/TiltAnalogSettingsScreen.h"
#include "UI/TiltEventProcessor.h"
#include "UI/ComboKeyMappingScreen.h"
#include "Common/KeyMap.h"
#include "Common/FileUtil.h"
@ -403,6 +404,11 @@ void GameSettingsScreen::CreateViews() {
CheckBox *floatingAnalog = controlsSettings->Add(new CheckBox(&g_Config.bAutoCenterTouchAnalog, co->T("Auto-centering analog stick")));
floatingAnalog->SetEnabledPtr(&g_Config.bShowTouchControls);
// Combo key setup
Choice *comboKey = controlsSettings->Add(new Choice(co->T("Combo Key Setup")));
comboKey->OnClick.Handle(this, &GameSettingsScreen::OnCombo_key);
comboKey->SetEnabledPtr(&g_Config.bShowTouchControls);
// On systems that aren't Symbian, iOS, and Maemo, offer to let the user see this button.
// Some Windows touch devices don't have a back button or other button to call up the menu.
#if !defined(__SYMBIAN32__) && !defined(IOS) && !defined(MAEMO)
@ -915,6 +921,11 @@ UI::EventReturn GameSettingsScreen::OnChangeMacAddress(UI::EventParams &e) {
return UI::EVENT_DONE;
}
UI::EventReturn GameSettingsScreen::OnCombo_key(UI::EventParams &e) {
screenManager()->push(new Combo_keyScreen(&g_Config.iComboMode));
return UI::EVENT_DONE;
}
UI::EventReturn GameSettingsScreen::OnLanguage(UI::EventParams &e) {
I18NCategory *dev = GetI18NCategory("Developer");
auto langScreen = new NewLanguageScreen(dev->T("Language"));

View File

@ -66,6 +66,7 @@ private:
UI::EventReturn OnReloadCheats(UI::EventParams &e);
UI::EventReturn OnTiltTypeChange(UI::EventParams &e);
UI::EventReturn OnTiltCustomize(UI::EventParams &e);
UI::EventReturn OnCombo_key(UI::EventParams &e);
// Global settings handlers
UI::EventReturn OnLanguage(UI::EventParams &e);

View File

@ -103,6 +103,30 @@ void PSPButton::Touch(const TouchInput &input) {
}
}
void ComboKey::Touch(const TouchInput &input) {
bool lastDown = pointerDownMask_ != 0;
MultiTouchButton::Touch(input);
bool down = pointerDownMask_ != 0;
static const int combo[16] = {CTRL_SQUARE ,CTRL_TRIANGLE ,CTRL_CIRCLE ,CTRL_CROSS ,CTRL_UP ,CTRL_DOWN ,CTRL_LEFT ,CTRL_RIGHT ,CTRL_START ,CTRL_SELECT ,CTRL_LTRIGGER ,CTRL_RTRIGGER };
if (down || lastDown) {
for (int i = 0; i < 16; i++) {
if (pspButtonBit_ & combo[i])
{
if (down && !lastDown) {
if (g_Config.bHapticFeedback) {
Vibrate(HAPTIC_VIRTUAL_KEY);
}
__CtrlButtonDown(combo[i]);
}
else if (lastDown && !down) {
__CtrlButtonUp(combo[i]);
}
}
}
}
}
bool PSPButton::IsDown() {
return (__CtrlPeekButtons() & pspButtonBit_) != 0;
}
@ -419,6 +443,53 @@ void InitPadLayout(float xres, float yres, float globalScale) {
g_Config.fRKeyY = (float)r_key_Y / yres;
g_Config.fRKeyScale = scale;
}
//Combo key
int combo_key_X = xres / 2 + (bottom_key_spacing)* scale*1.2f;
int combo_key_Y = yres / 2;
if (g_Config.fcombo0X == -1.0 || g_Config.fcombo0Y == -1.0) {
g_Config.fcombo0X = (float)combo_key_X / xres;
g_Config.fcombo0Y = (float)combo_key_Y / yres;
g_Config.fcomboScale0 = scale;
}
int combo1_key_X = xres / 2 + (bottom_key_spacing)* scale * 2.2;
int combo1_key_Y = yres / 2;
if (g_Config.fcombo1X == -1.0 || g_Config.fcombo1Y == -1.0) {
g_Config.fcombo1X = (float)combo1_key_X / xres;
g_Config.fcombo1Y = (float)combo1_key_Y / yres;
g_Config.fcomboScale1 = scale;
}
int combo2_key_X = xres / 2 + (bottom_key_spacing)* scale * 3.2;
int combo2_key_Y = yres / 2;
if (g_Config.fcombo2X == -1.0 || g_Config.fcombo2Y == -1.0) {
g_Config.fcombo2X = (float)combo2_key_X / xres;
g_Config.fcombo2Y = (float)combo2_key_Y / yres;
g_Config.fcomboScale2 = scale;
}
int combo3_key_X = xres / 2 + (bottom_key_spacing)* scale * 1.2;
int combo3_key_Y = yres / 3;
if (g_Config.fcombo3X == -1.0 || g_Config.fcombo3Y == -1.0) {
g_Config.fcombo3X = (float)combo3_key_X / xres;
g_Config.fcombo3Y = (float)combo3_key_Y / yres;
g_Config.fcomboScale3 = scale;
}
int combo4_key_X = xres / 2 + (bottom_key_spacing)* scale * 2.2;
int combo4_key_Y = yres / 3;
if (g_Config.fcombo4X == -1.0 || g_Config.fcombo4Y == -1.0) {
g_Config.fcombo4X = (float)combo4_key_X / xres;
g_Config.fcombo4Y = (float)combo4_key_Y / yres;
g_Config.fcomboScale4 = scale;
}
};
UI::ViewGroup *CreatePadLayout(float xres, float yres, bool *pause) {
@ -484,6 +555,23 @@ UI::ViewGroup *CreatePadLayout(float xres, float yres, bool *pause) {
float analog_stick_Y = g_Config.fAnalogStickY * yres;
float analog_stick_scale = g_Config.fAnalogStickScale;
//combo key -------------------------------------------------------
float combo0_key_X = g_Config.fcombo0X * xres;
float combo0_key_Y = g_Config.fcombo0Y * yres;
float combo_key_scale = g_Config.fcomboScale0;
float combo1_key_X = g_Config.fcombo1X * xres;
float combo1_key_Y = g_Config.fcombo1Y * yres;
float combo1_key_scale = g_Config.fcomboScale1;
float combo2_key_X = g_Config.fcombo2X * xres;
float combo2_key_Y = g_Config.fcombo2Y * yres;
float combo2_key_scale = g_Config.fcomboScale2;
float combo3_key_X = g_Config.fcombo3X * xres;
float combo3_key_Y = g_Config.fcombo3Y * yres;
float combo3_key_scale = g_Config.fcomboScale3;
float combo4_key_X = g_Config.fcombo4X * xres;
float combo4_key_Y = g_Config.fcombo4Y * yres;
float combo4_key_scale = g_Config.fcomboScale4;
const int halfW = xres / 2;
const int roundImage = g_Config.iTouchButtonStyle ? I_ROUND_LINE : I_ROUND;
@ -499,6 +587,7 @@ UI::ViewGroup *CreatePadLayout(float xres, float yres, bool *pause) {
const int dirImage = g_Config.iTouchButtonStyle ? I_DIR_LINE : I_DIR;
const int stickImage = g_Config.iTouchButtonStyle ? I_STICK_LINE : I_STICK;
const int stickBg = g_Config.iTouchButtonStyle ? I_STICK_BG_LINE : I_STICK_BG;
static const int comboKeyImages[5] = { I_1, I_2, I_3, I_4, I_5 };
#if !defined(__SYMBIAN32__) && !defined(IOS) && !defined(MAEMO)
if (g_Config.bShowTouchPause)
@ -536,6 +625,21 @@ UI::ViewGroup *CreatePadLayout(float xres, float yres, bool *pause) {
if (g_Config.bShowTouchAnalogStick)
root->Add(new PSPStick(stickBg, stickImage, 0, analog_stick_scale, new AnchorLayoutParams(analog_stick_X, analog_stick_Y, NONE, NONE, true)));
if (g_Config.bShowComboKey0)
root->Add(new ComboKey(g_Config.iCombokey0, roundImage, comboKeyImages[0], combo_key_scale, new AnchorLayoutParams(combo0_key_X, combo0_key_Y, NONE, NONE, true)));
if (g_Config.bShowComboKey1)
root->Add(new ComboKey(g_Config.iCombokey1, roundImage, comboKeyImages[1], combo1_key_scale, new AnchorLayoutParams(combo1_key_X, combo1_key_Y, NONE, NONE, true)));
if (g_Config.bShowComboKey2)
root->Add(new ComboKey(g_Config.iCombokey2, roundImage, comboKeyImages[2], combo2_key_scale, new AnchorLayoutParams(combo2_key_X, combo2_key_Y, NONE, NONE, true)));
if (g_Config.bShowComboKey3)
root->Add(new ComboKey(g_Config.iCombokey3, roundImage, comboKeyImages[3], combo3_key_scale, new AnchorLayoutParams(combo3_key_X, combo3_key_Y, NONE, NONE, true)));
if (g_Config.bShowComboKey4)
root->Add(new ComboKey(g_Config.iCombokey4, roundImage, comboKeyImages[4], combo4_key_scale, new AnchorLayoutParams(combo4_key_X, combo4_key_Y, NONE, NONE, true)));
}
return root;

View File

@ -131,3 +131,12 @@ UI::ViewGroup *CreatePadLayout(float xres, float yres, bool *pause);
const int D_pad_Radius = 50;
const int baseActionButtonSpacing = 60;
class ComboKey : public MultiTouchButton {
public:
ComboKey(int pspButtonBit, int bgImg, int img, float scale, UI::LayoutParams *layoutParams)
: MultiTouchButton(bgImg, img, scale, layoutParams), pspButtonBit_(pspButtonBit) {
}
virtual void Touch(const TouchInput &input);
private:
int pspButtonBit_;
};

View File

@ -366,6 +366,9 @@ void TouchControlLayoutScreen::CreateViews() {
int dirImage = g_Config.iTouchButtonStyle ? I_DIR_LINE : I_DIR;
int stickImage = g_Config.iTouchButtonStyle ? I_STICK_LINE : I_STICK;
int stickBg = g_Config.iTouchButtonStyle ? I_STICK_BG_LINE : I_STICK_BG;
int roundImage = g_Config.iTouchButtonStyle ? I_ROUND_LINE : I_ROUND;
const int comboKeyImages[5] = { I_1, I_2, I_3, I_4, I_5 };
if (g_Config.bShowTouchDpad) {
controls_.push_back(new PSPDPadButtons(g_Config.fDpadX, g_Config.fDpadY, g_Config.fDpadScale, g_Config.fDpadSpacing));
@ -397,6 +400,21 @@ void TouchControlLayoutScreen::CreateViews() {
if (g_Config.bShowTouchAnalogStick) {
controls_.push_back(new DragDropButton(g_Config.fAnalogStickX, g_Config.fAnalogStickY, stickBg, stickImage, g_Config.fAnalogStickScale));
}
if (g_Config.bShowComboKey0) {
controls_.push_back(new DragDropButton(g_Config.fcombo0X, g_Config.fcombo0Y, roundImage, comboKeyImages[0], g_Config.fcomboScale0));
}
if (g_Config.bShowComboKey1) {
controls_.push_back(new DragDropButton(g_Config.fcombo1X, g_Config.fcombo1Y, roundImage, comboKeyImages[1], g_Config.fcomboScale1));
}
if (g_Config.bShowComboKey2) {
controls_.push_back(new DragDropButton(g_Config.fcombo2X, g_Config.fcombo2Y, roundImage, comboKeyImages[2], g_Config.fcomboScale2));
}
if (g_Config.bShowComboKey3) {
controls_.push_back(new DragDropButton(g_Config.fcombo3X, g_Config.fcombo3Y, roundImage, comboKeyImages[3], g_Config.fcomboScale3));
}
if (g_Config.bShowComboKey4) {
controls_.push_back(new DragDropButton(g_Config.fcombo4X, g_Config.fcombo4Y, roundImage, comboKeyImages[4], g_Config.fcomboScale4));
};
for (size_t i = 0; i < controls_.size(); i++) {

View File

@ -51,6 +51,11 @@ void TouchControlVisibilityScreen::CreateViews() {
keyImages["Select"] = I_SELECT;
keyImages["L"] = I_L;
keyImages["R"] = I_R;
keyImages["Combo0"] = I_1;
keyImages["Combo1"] = I_2;
keyImages["Combo2"] = I_3;
keyImages["Combo3"] = I_4;
keyImages["Combo4"] = I_5;
keyToggles.clear();
keyToggles["Circle"] = &g_Config.bShowTouchCircle;
@ -64,6 +69,11 @@ void TouchControlVisibilityScreen::CreateViews() {
keyToggles["Dpad"] = &g_Config.bShowTouchDpad;
keyToggles["Analog Stick"] = &g_Config.bShowTouchAnalogStick;
keyToggles["Unthrottle"] = &g_Config.bShowTouchUnthrottle;
keyToggles["Combo0"] = &g_Config.bShowComboKey0;
keyToggles["Combo1"] = &g_Config.bShowComboKey1;
keyToggles["Combo2"] = &g_Config.bShowComboKey2;
keyToggles["Combo3"] = &g_Config.bShowComboKey3;
keyToggles["Combo4"] = &g_Config.bShowComboKey4;
std::map<std::string, int>::iterator imageFinder;

View File

@ -20,6 +20,7 @@
</ItemGroup>
<ItemGroup>
<ClCompile Include="BackgroundAudio.cpp" />
<ClCompile Include="ComboKeyMappingScreen.cpp" />
<ClCompile Include="ControlMappingScreen.cpp" />
<ClCompile Include="CwCheatScreen.cpp" />
<ClCompile Include="DevScreens.cpp" />
@ -46,6 +47,7 @@
</ItemGroup>
<ItemGroup>
<ClInclude Include="BackgroundAudio.h" />
<ClInclude Include="ComboKeyMappingScreen.h" />
<ClInclude Include="ControlMappingScreen.h" />
<ClInclude Include="DevScreens.h" />
<ClInclude Include="EmuScreen.h" />

View File

@ -59,6 +59,9 @@
<ClCompile Include="ProfilerDraw.cpp">
<Filter>Screens</Filter>
</ClCompile>
<ClCompile Include="ComboKeyMappingScreen.cpp">
<Filter>Screens</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="GameInfoCache.h" />
@ -118,10 +121,13 @@
<ClInclude Include="ProfilerDraw.h">
<Filter>Screens</Filter>
</ClInclude>
<ClInclude Include="ComboKeyMappingScreen.h">
<Filter>Screens</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Filter Include="Screens">
<UniqueIdentifier>{faee5dce-633b-4ba6-b19d-ea70ee3c1c38}</UniqueIdentifier>
</Filter>
</ItemGroup>
</Project>
</Project>

File diff suppressed because it is too large Load Diff

View File

@ -42,7 +42,14 @@
#define I_FOLDER 31
#define I_UP_DIRECTORY 32
#define I_GEAR 33
#define I_1 34
#define I_2 35
#define I_3 36
#define I_4 37
#define I_5 38
#define I_6 39
#define I_PSP_DISPLAY 40
extern const Atlas ui_atlas;
extern const AtlasImage ui_images[34];
extern const AtlasImage ui_images[41];

Binary file not shown.

View File

@ -350,7 +350,8 @@ LOCAL_SRC_FILES := \
$(SRC)/UI/CwCheatScreen.cpp \
$(SRC)/UI/InstallZipScreen.cpp \
$(SRC)/UI/ProfilerDraw.cpp \
$(SRC)/UI/NativeApp.cpp
$(SRC)/UI/NativeApp.cpp \
$(SRC)/UI/ComboKeyMappingScreen.cpp
ifneq ($(SKIPAPP),1)
include $(BUILD_SHARED_LIBRARY)

Binary file not shown.

Binary file not shown.

View File

@ -1,5 +1,5 @@
2048
font UBUNTU24 assets/RobotoCondensed-Regular.ttf UWER 34 -2
font UBUNTU24 assets/Roboto-Condensed.ttf UWER 34 -2
font UBUNTU24 C:/Windows/Fonts/ARIALUNI.ttf UWEhkcRGHKVTe 30 0
image I_SOLIDWHITE white.png copy
image I_CROSS source_assets/image/cross.png copy
@ -35,4 +35,10 @@ image I_ICONGOLD source_assets/image/icon_gold_72.png copy
image I_FOLDER source_assets/image/folder_line.png copy
image I_UP_DIRECTORY source_assets/image/up_line.png copy
image I_GEAR source_assets/image/gear.png copy
image I_1 source_assets/image/1.png copy
image I_2 source_assets/image/2.png copy
image I_3 source_assets/image/3.png copy
image I_4 source_assets/image/4.png copy
image I_5 source_assets/image/5.png copy
image I_6 source_assets/image/6.png copy
image I_PSP_DISPLAY source_assets/image/psp_display.png copy

View File

@ -1,5 +1,5 @@
512
font UBUNTU24 assets/RobotoCondensed-Regular.ttf U 34 -2
font UBUNTU24 assets/Roboto-Condensed.ttf U 34 -2
image I_SOLIDWHITE white.png copy
image I_CROSS source_assets/image/cross.png copy
image I_CIRCLE source_assets/image/circle.png copy
@ -34,3 +34,10 @@ image I_ICONGOLD source_assets/image/icon_gold_72.png copy
image I_FOLDER source_assets/image/folder_line.png copy
image I_UP_DIRECTORY source_assets/image/up_line.png copy
image I_GEAR source_assets/image/gear.png copy
image I_1 source_assets/image/1.png copy
image I_2 source_assets/image/2.png copy
image I_3 source_assets/image/3.png copy
image I_4 source_assets/image/4.png copy
image I_5 source_assets/image/5.png copy
image I_6 source_assets/image/6.png copy
image I_PSP_DISPLAY source_assets/image/psp_display.png copy

BIN
source_assets/image/1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 473 B

BIN
source_assets/image/2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 828 B

BIN
source_assets/image/3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 991 B

BIN
source_assets/image/4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 783 B

BIN
source_assets/image/5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 818 B

BIN
source_assets/image/6.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1008 B

View File

@ -14,7 +14,7 @@
height="1052.3622047"
id="svg2"
version="1.1"
inkscape:version="0.48.2 r9819"
inkscape:version="0.91 r13725"
sodipodi:docname="buttons.svg">
<defs
id="defs4">
@ -1262,6 +1262,38 @@
in="SourceGraphic" />
</feMerge>
</filter>
<filter
style="color-interpolation-filters:sRGB;"
inkscape:label="Drop Shadow"
id="filter4775">
<feFlood
flood-opacity="0.498039"
flood-color="rgb(0,0,0)"
result="flood"
id="feFlood4777" />
<feComposite
in="flood"
in2="SourceGraphic"
operator="in"
result="composite1"
id="feComposite4779" />
<feGaussianBlur
in="composite1"
stdDeviation="1"
result="blur"
id="feGaussianBlur4781" />
<feOffset
dx="0"
dy="0"
result="offset"
id="feOffset4783" />
<feComposite
in="SourceGraphic"
in2="offset"
operator="over"
result="composite2"
id="feComposite4785" />
</filter>
</defs>
<sodipodi:namedview
id="base"
@ -1276,9 +1308,9 @@
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1822"
inkscape:window-height="1057"
inkscape:window-x="1370"
inkscape:window-width="2560"
inkscape:window-height="1537"
inkscape:window-x="-8"
inkscape:window-y="-8"
inkscape:window-maximized="1" />
<metadata
@ -1289,7 +1321,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
@ -1298,7 +1330,7 @@
inkscape:groupmode="layer"
id="layer1">
<rect
style="fill:#000000;fill-opacity:1;stroke:none"
style="fill:#5f7897;fill-opacity:1;stroke:none"
id="rect5044"
width="399.68362"
height="362.96939"
@ -1668,7 +1700,7 @@
inkscape:export-xdpi="135"
inkscape:export-filename="D:\Dev\Emulatorer\potemkin\gfx\round.png"
transform="matrix(0.12501803,0,0,0.12501803,39.336944,18.00774)"
d="m 257.14286,175.21933 c 0,77.31986 -63.95932,140 -142.85715,140 -78.897821,0 -142.857144,-62.68014 -142.857144,-140 0,-77.319865 63.959323,-140 142.857144,-140 78.89783,0 142.85715,62.680135 142.85715,140 z"
d="m 257.14286,175.21933 a 142.85715,140 0 0 1 -142.85715,140 142.85715,140 0 0 1 -142.857144,-140 142.85715,140 0 0 1 142.857144,-140 142.85715,140 0 0 1 142.85715,140 z"
sodipodi:ry="140"
sodipodi:rx="142.85715"
sodipodi:cy="175.21933"
@ -1760,7 +1792,7 @@
sodipodi:cy="175.21933"
sodipodi:rx="142.85715"
sodipodi:ry="140"
d="m 257.14286,175.21933 c 0,77.31986 -63.95932,140 -142.85715,140 -78.897821,0 -142.857144,-62.68014 -142.857144,-140 0,-77.319865 63.959323,-140 142.857144,-140 78.89783,0 142.85715,62.680135 142.85715,140 z"
d="m 257.14286,175.21933 a 142.85715,140 0 0 1 -142.85715,140 142.85715,140 0 0 1 -142.857144,-140 142.85715,140 0 0 1 142.857144,-140 142.85715,140 0 0 1 142.85715,140 z"
transform="matrix(0.20279977,0,0,0.20279977,128.34577,81.426482)"
inkscape:export-filename="D:\Dev\Emulatorer\potemkin\gfx\stick.png"
inkscape:export-xdpi="135"
@ -1773,7 +1805,7 @@
sodipodi:cy="175.21933"
sodipodi:rx="142.85715"
sodipodi:ry="140"
d="m 257.14286,175.21933 c 0,77.31986 -63.95932,140 -142.85715,140 -78.897821,0 -142.857144,-62.68014 -142.857144,-140 0,-77.319865 63.959323,-140 142.857144,-140 78.89783,0 142.85715,62.680135 142.85715,140 z"
d="m 257.14286,175.21933 a 142.85715,140 0 0 1 -142.85715,140 142.85715,140 0 0 1 -142.857144,-140 142.85715,140 0 0 1 142.857144,-140 142.85715,140 0 0 1 142.85715,140 z"
transform="matrix(0.19553658,0,0,0.19553658,129.17584,82.699142)"
inkscape:export-filename="D:\Dev\Emulatorer\potemkin\gfx\stick.png"
inkscape:export-xdpi="135"
@ -1821,5 +1853,81 @@
id="tspan4035"
x="-48.487312"
y="151.8112">⚙</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter4775)"
x="170.46324"
y="30.34034"
id="text3635"
sodipodi:linespacing="125%"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"><tspan
sodipodi:role="line"
id="tspan3637"
x="170.46324"
y="30.34034"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:27.5px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1">1</tspan></text>
<text
sodipodi:linespacing="125%"
id="text4799"
y="29.835258"
x="191.67645"
style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter4775)"
xml:space="preserve"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"><tspan
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:27.5px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1"
y="29.835258"
x="191.67645"
id="tspan4801"
sodipodi:role="line">2</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter4775)"
x="213.1422"
y="30.592875"
id="text4803"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan4805"
x="213.1422"
y="30.592875"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:27.5px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1">3</tspan></text>
<text
sodipodi:linespacing="125%"
id="text4807"
y="30.592878"
x="232.84016"
style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter4775)"
xml:space="preserve"><tspan
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:27.5px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1"
y="30.592878"
x="232.84016"
id="tspan4809"
sodipodi:role="line">4</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter4775)"
x="250.01276"
y="30.592878"
id="text4811"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan4813"
x="250.01276"
y="30.592878"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:27.5px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1">5</tspan></text>
<text
sodipodi:linespacing="125%"
id="text4815"
y="31.097954"
x="268.1955"
style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter4775)"
xml:space="preserve"><tspan
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:27.5px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1"
y="31.097954"
x="268.1955"
id="tspan4817"
sodipodi:role="line">6</tspan></text>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 438 B