Merge pull request #328 from ThePlayground/master
Fix the mapping to avoid dealing with OUYA default configs
This commit is contained in:
commit
da60601205
|
@ -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>
|
|
@ -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>
|
|
@ -2,9 +2,9 @@
|
|||
|
||||
<style name="AppTheme" parent="android:Theme.NoTitleBar.Fullscreen">
|
||||
<item name="switchStyle">@style/switch_dark</item>
|
||||
<item name="textAppearance">@style/TextAppearance</item>
|
||||
</style>
|
||||
|
||||
<item name="textAppearance">@style/TextAppearance</item>
|
||||
</style>
|
||||
|
||||
<style name="switch_dark">
|
||||
<item name="track">@drawable/switch_track_holo_dark</item>
|
||||
<item name="thumb">@drawable/switch_inner_holo_dark</item>
|
||||
|
@ -15,7 +15,7 @@
|
|||
<item name="switchPadding">16dip</item>
|
||||
<item name="switchTextAppearance">@style/TextAppearance</item>
|
||||
</style>
|
||||
|
||||
|
||||
<style name="TextAppearance">
|
||||
<item name="textColor">?android:attr/textColorPrimary</item>
|
||||
<item name="textColorHighlight">?android:attr/textColorHighlight</item>
|
||||
|
@ -23,13 +23,13 @@
|
|||
<item name="textColorLink">?android:attr/textColorLink</item>
|
||||
<item name="textSize">16sp</item>
|
||||
</style>
|
||||
|
||||
|
||||
<style name="BaseText" parent="@android:style/TextAppearance">
|
||||
<item name="android:layout_width">wrap_content</item>
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:gravity">center_vertical</item>
|
||||
</style>
|
||||
|
||||
|
||||
<style name="fpsOverlayText">
|
||||
<item name="android:paddingLeft">4px</item>
|
||||
<item name="android:paddingBottom">4px</item>
|
||||
|
@ -39,6 +39,11 @@
|
|||
<item name="android:shadowDx">1</item>
|
||||
<item name="android:shadowDy">1</item>
|
||||
<item name="android:shadowRadius">1</item>
|
||||
</style>
|
||||
</style>
|
||||
|
||||
<style name="Animation">
|
||||
<item name="@android:windowEnterAnimation">@anim/popup_show</item>
|
||||
<item name="@android:windowExitAnimation">@anim/popup_hide</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -96,10 +96,9 @@ public class Gamepad {
|
|||
OuyaController.BUTTON_DPAD_DOWN, key_CONT_DPAD_DOWN,
|
||||
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
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue