Merge pull request #328 from ThePlayground/master

Fix the mapping to avoid dealing with OUYA default configs
This commit is contained in:
TwistedUmbrella 2014-02-25 01:58:45 -05:00
commit da60601205
6 changed files with 44 additions and 22 deletions

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<alpha android:fromAlpha="1.0"
android:toAlpha="0.0"
android:interpolator="@android:anim/accelerate_interpolator"
android:duration="1000"
android:repeatCount="0"/>
</set>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<alpha android:fromAlpha="0.0"
android:toAlpha="1.0"
android:interpolator="@android:anim/accelerate_interpolator"
android:duration="1000"
android:repeatCount="0"/>
</set>

View File

@ -41,4 +41,9 @@
<item name="android:shadowRadius">1</item>
</style>
<style name="Animation">
<item name="@android:windowEnterAnimation">@anim/popup_show</item>
<item name="@android:windowExitAnimation">@anim/popup_hide</item>
</style>
</resources>

View File

@ -187,10 +187,8 @@ public class GL2JNIActivity extends Activity {
setContentView(mView);
String menu_spec;
if (pad.isXperiaPlay) {
if (pad.isXperiaPlay || pad.isOuyaOrTV) {
menu_spec = getApplicationContext().getString(R.string.menu_button);
} else if (pad.isOuyaOrTV) {
menu_spec = getApplicationContext().getString(R.string.right_button);
} else {
menu_spec = getApplicationContext().getString(R.string.back_button);
}
@ -379,6 +377,9 @@ public class GL2JNIActivity extends Activity {
public boolean handle_key(Integer playerNum, int kc, boolean down) {
if (playerNum == null || playerNum == -1)
return false;
if (kc == KeyEvent.KEYCODE_BUTTON_SELECT) {
return false;
}
if (pad.isActiveMoga[playerNum]) {
return false;
}

View File

@ -97,7 +97,7 @@ public class OnScreenMenu {
public DebugPopup(Context c) {
super(c);
setBackgroundDrawable(null);
int p = getPixelsFromDp(60, mContext);
int p = getPixelsFromDp(72, mContext);
LayoutParams debugParams = new LayoutParams(p, p);
LinearLayout hlay = new LinearLayout(mContext);
@ -172,7 +172,7 @@ public class OnScreenMenu {
public ConfigPopup(Context c) {
super(c);
setBackgroundDrawable(null);
int p = getPixelsFromDp(60, mContext);
int p = getPixelsFromDp(72, mContext);
LayoutParams configParams = new LayoutParams(p, p);
LinearLayout hlay = new LinearLayout(mContext);
@ -341,8 +341,8 @@ public class OnScreenMenu {
public VmuPopup(Context c) {
super(c);
setBackgroundDrawable(null);
int pX = OnScreenMenu.getPixelsFromDp(80, mContext);
int pY = OnScreenMenu.getPixelsFromDp(56, mContext);
int pX = OnScreenMenu.getPixelsFromDp(96, mContext);
int pY = OnScreenMenu.getPixelsFromDp(68, mContext);
vparams = new LayoutParams(pX, pY);
vlay = new LinearLayout(mContext);
vlay.setOrientation(LinearLayout.HORIZONTAL);
@ -350,7 +350,7 @@ public class OnScreenMenu {
}
public void showVmu() {
vmuLcd.configureScale(80);
vmuLcd.configureScale(96);
vlay.addView(vmuLcd, vparams);
}
@ -363,13 +363,13 @@ public class OnScreenMenu {
public MainPopup(Context c) {
super(c);
setBackgroundDrawable(null);
int p = getPixelsFromDp(60, mContext);
int p = getPixelsFromDp(72, mContext);
params = new LayoutParams(p, p);
hlay = new LinearLayout(mContext);
hlay.setOrientation(LinearLayout.HORIZONTAL);
int vpX = getPixelsFromDp(60, mContext);
int vpY = getPixelsFromDp(42, mContext);
int vpX = getPixelsFromDp(72, mContext);
int vpY = getPixelsFromDp(52, mContext);
LinearLayout.LayoutParams vmuParams = new LinearLayout.LayoutParams(
vpX, vpY);
vmuParams.weight = 1.0f;
@ -439,10 +439,11 @@ public class OnScreenMenu {
}), params);
setContentView(hlay);
this.setAnimationStyle(R.style.Animation);
}
public void showVmu() {
vmuLcd.configureScale(60);
vmuLcd.configureScale(72);
hlay.addView(vmuLcd, 0, params);
}
}

View File

@ -97,9 +97,8 @@ public class Gamepad {
OuyaController.BUTTON_DPAD_LEFT, key_CONT_DPAD_LEFT,
OuyaController.BUTTON_DPAD_RIGHT, key_CONT_DPAD_RIGHT,
OuyaController.BUTTON_MENU, key_CONT_START,
getStartButtonCode(), key_CONT_START,
OuyaController.BUTTON_R3, getSelectButtonCode()
OuyaController.BUTTON_R3, key_CONT_START
};
}