mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Tweak defaults some more (no L2 on xbox pads..). Minor code cleanup.
This commit is contained in:
parent
b1481347e2
commit
58e7b6bec2
4 changed files with 14 additions and 12 deletions
|
@ -184,21 +184,17 @@ static const DefMappingStruct defaultAndroidXboxControllerMap[] = {
|
|||
{CTRL_SQUARE , NKCODE_BUTTON_X},
|
||||
{CTRL_TRIANGLE , NKCODE_BUTTON_Y},
|
||||
// The hat for DPAD is standard for bluetooth pads, which is the most likely pads on Android I think.
|
||||
{CTRL_LEFT , JOYSTICK_AXIS_HAT_X, -1},
|
||||
{CTRL_LEFT , NKCODE_DPAD_LEFT},
|
||||
{CTRL_RIGHT , JOYSTICK_AXIS_HAT_X, +1},
|
||||
{CTRL_RIGHT , NKCODE_DPAD_RIGHT},
|
||||
{CTRL_UP , JOYSTICK_AXIS_HAT_Y, -1},
|
||||
{CTRL_UP , NKCODE_DPAD_UP},
|
||||
{CTRL_DOWN , JOYSTICK_AXIS_HAT_Y, +1},
|
||||
{CTRL_DOWN , NKCODE_DPAD_DOWN},
|
||||
{CTRL_START , NKCODE_BUTTON_START},
|
||||
{CTRL_SELECT , NKCODE_BACK},
|
||||
{CTRL_LTRIGGER , NKCODE_BUTTON_L1},
|
||||
{CTRL_RTRIGGER , NKCODE_BUTTON_R1},
|
||||
{VIRTKEY_FASTFORWARD , NKCODE_BUTTON_R2},
|
||||
{VIRTKEY_FASTFORWARD , JOYSTICK_AXIS_RTRIGGER, +1},
|
||||
{VIRTKEY_FASTFORWARD , NKCODE_BUTTON_R2},
|
||||
{VIRTKEY_PAUSE , JOYSTICK_AXIS_LTRIGGER, +1},
|
||||
{VIRTKEY_SPEED_TOGGLE, NKCODE_BUTTON_L2},
|
||||
{VIRTKEY_AXIS_X_MIN, JOYSTICK_AXIS_X, -1},
|
||||
{VIRTKEY_AXIS_X_MAX, JOYSTICK_AXIS_X, +1},
|
||||
{VIRTKEY_AXIS_Y_MIN, JOYSTICK_AXIS_Y, +1},
|
||||
|
@ -219,13 +215,15 @@ static const DefMappingStruct defaultPadMapAndroid[] = {
|
|||
{CTRL_UP , NKCODE_DPAD_UP},
|
||||
{CTRL_DOWN , JOYSTICK_AXIS_HAT_Y, +1},
|
||||
{CTRL_DOWN , NKCODE_DPAD_DOWN},
|
||||
|
||||
{CTRL_START , NKCODE_BUTTON_START},
|
||||
{CTRL_SELECT , NKCODE_BUTTON_SELECT},
|
||||
{CTRL_LTRIGGER , NKCODE_BUTTON_L1},
|
||||
{CTRL_RTRIGGER , NKCODE_BUTTON_R1},
|
||||
{VIRTKEY_FASTFORWARD , JOYSTICK_AXIS_RTRIGGER, +1},
|
||||
{VIRTKEY_FASTFORWARD , NKCODE_BUTTON_R2},
|
||||
{VIRTKEY_PAUSE , JOYSTICK_AXIS_LTRIGGER, +1},
|
||||
{VIRTKEY_SPEED_TOGGLE, NKCODE_BUTTON_L2},
|
||||
{VIRTKEY_PAUSE , NKCODE_BUTTON_L2 },
|
||||
{VIRTKEY_AXIS_X_MIN, JOYSTICK_AXIS_X, -1},
|
||||
{VIRTKEY_AXIS_X_MAX, JOYSTICK_AXIS_X, +1},
|
||||
{VIRTKEY_AXIS_Y_MIN, JOYSTICK_AXIS_Y, +1},
|
||||
|
@ -250,6 +248,7 @@ static const DefMappingStruct defaultPadMap[] = {
|
|||
{VIRTKEY_AXIS_Y_MIN, JOYSTICK_AXIS_Y, +1},
|
||||
{VIRTKEY_AXIS_Y_MAX, JOYSTICK_AXIS_Y, -1},
|
||||
{VIRTKEY_PAUSE , JOYSTICK_AXIS_LTRIGGER, +1},
|
||||
{VIRTKEY_PAUSE , NKCODE_BUTTON_L2 },
|
||||
};
|
||||
|
||||
static const DefMappingStruct defaultOuyaMap[] = {
|
||||
|
|
|
@ -784,7 +784,11 @@ void EmuScreen::CreateViews() {
|
|||
|
||||
const Bounds &bounds = screenManager()->getUIContext()->GetLayoutBounds();
|
||||
InitPadLayout(bounds.w, bounds.h);
|
||||
root_ = CreatePadLayout(bounds.w, bounds.h, &pauseTrigger_, &controlMapper_);
|
||||
|
||||
// Devices without a back button like iOS need an on-screen touch back button.
|
||||
bool showPauseButton = !System_GetPropertyBool(SYSPROP_HAS_BACK_BUTTON) || g_Config.bShowTouchPause;
|
||||
|
||||
root_ = CreatePadLayout(bounds.w, bounds.h, &pauseTrigger_, showPauseButton, &controlMapper_);
|
||||
if (g_Config.bShowDeveloperMenu) {
|
||||
root_->Add(new Button(dev->T("DevMenu")))->OnClick.Handle(this, &EmuScreen::OnDevTools);
|
||||
}
|
||||
|
@ -983,7 +987,6 @@ void EmuScreen::update() {
|
|||
|
||||
controlMapper_.Update();
|
||||
|
||||
// This is here to support the iOS on screen back button.
|
||||
if (pauseTrigger_) {
|
||||
pauseTrigger_ = false;
|
||||
screenManager()->push(new GamePauseScreen(gamePath_));
|
||||
|
|
|
@ -698,7 +698,7 @@ void InitPadLayout(float xres, float yres, float globalScale) {
|
|||
initTouchPos(g_Config.touchCombo9, combo9_key_X, combo9_key_Y);
|
||||
}
|
||||
|
||||
UI::ViewGroup *CreatePadLayout(float xres, float yres, bool *pause, ControlMapper* controllMapper) {
|
||||
UI::ViewGroup *CreatePadLayout(float xres, float yres, bool *pause, bool showPauseButton, ControlMapper* controllMapper) {
|
||||
using namespace UI;
|
||||
|
||||
AnchorLayout *root = new AnchorLayout(new LayoutParams(FILL_PARENT, FILL_PARENT));
|
||||
|
@ -756,7 +756,7 @@ UI::ViewGroup *CreatePadLayout(float xres, float yres, bool *pause, ControlMappe
|
|||
return nullptr;
|
||||
};
|
||||
|
||||
if (!System_GetPropertyBool(SYSPROP_HAS_BACK_BUTTON) || g_Config.bShowTouchPause) {
|
||||
if (showPauseButton) {
|
||||
root->Add(new BoolButton(pause, "Pause button", roundImage, ImageID("I_ROUND"), ImageID("I_ARROW"), 1.0f, new AnchorLayoutParams(halfW, 20, NONE, NONE, true)))->SetAngle(90);
|
||||
}
|
||||
|
||||
|
|
|
@ -162,7 +162,7 @@ private:
|
|||
//initializes the layout from Config. if a default layout does not exist,
|
||||
//it sets up default values
|
||||
void InitPadLayout(float xres, float yres, float globalScale = 1.15f);
|
||||
UI::ViewGroup *CreatePadLayout(float xres, float yres, bool *pause, ControlMapper* controllMapper);
|
||||
UI::ViewGroup *CreatePadLayout(float xres, float yres, bool *pause, bool showPauseButton, ControlMapper* controllMapper);
|
||||
|
||||
const int D_pad_Radius = 50;
|
||||
const int baseActionButtonSpacing = 60;
|
||||
|
|
Loading…
Add table
Reference in a new issue