Android: Add default portrait touch overlays
This commit is contained in:
parent
afe59c50c4
commit
ab46f0cb82
|
@ -83,7 +83,7 @@ public final class InputOverlay extends SurfaceView implements OnTouchListener
|
|||
super(context, attrs);
|
||||
|
||||
mPreferences = PreferenceManager.getDefaultSharedPreferences(getContext());
|
||||
if (!mPreferences.getBoolean("OverlayInit", false))
|
||||
if (!mPreferences.getBoolean("OverlayInitV2", false))
|
||||
defaultOverlay();
|
||||
// Load the controls.
|
||||
refreshControls();
|
||||
|
@ -925,20 +925,33 @@ public final class InputOverlay extends SurfaceView implements OnTouchListener
|
|||
{
|
||||
gcDefaultOverlay();
|
||||
}
|
||||
if (mPreferences.getFloat(ButtonType.BUTTON_A + "-Portrait" + "-X", 0f) == 0f)
|
||||
{
|
||||
gcPortraitDefaultOverlay();
|
||||
}
|
||||
|
||||
// Wii
|
||||
if (mPreferences.getFloat(ButtonType.WIIMOTE_BUTTON_A + "-X", 0f) == 0f)
|
||||
{
|
||||
wiiDefaultOverlay();
|
||||
}
|
||||
if (mPreferences.getFloat(ButtonType.WIIMOTE_BUTTON_A + "-Portrait" + "-X", 0f) == 0f)
|
||||
{
|
||||
wiiPortraitDefaultOverlay();
|
||||
}
|
||||
|
||||
// Wii Classic
|
||||
if (mPreferences.getFloat(ButtonType.CLASSIC_BUTTON_A + "-X", 0f) == 0f)
|
||||
{
|
||||
wiiClassicDefaultOverlay();
|
||||
}
|
||||
if (mPreferences.getFloat(ButtonType.CLASSIC_BUTTON_A + "-Portrait" + "-X", 0f) == 0f)
|
||||
{
|
||||
wiiClassicPortraitDefaultOverlay();
|
||||
}
|
||||
|
||||
SharedPreferences.Editor sPrefsEditor = mPreferences.edit();
|
||||
sPrefsEditor.putBoolean("OverlayInit", true);
|
||||
sPrefsEditor.putBoolean("OverlayInitV2", true);
|
||||
sPrefsEditor.apply();
|
||||
}
|
||||
|
||||
|
@ -1012,6 +1025,78 @@ public final class InputOverlay extends SurfaceView implements OnTouchListener
|
|||
sPrefsEditor.commit();
|
||||
}
|
||||
|
||||
|
||||
private void gcPortraitDefaultOverlay()
|
||||
{
|
||||
SharedPreferences.Editor sPrefsEditor = mPreferences.edit();
|
||||
|
||||
// Get screen size
|
||||
Display display = ((Activity) getContext()).getWindowManager().getDefaultDisplay();
|
||||
DisplayMetrics outMetrics = new DisplayMetrics();
|
||||
display.getMetrics(outMetrics);
|
||||
float maxX = outMetrics.heightPixels;
|
||||
float maxY = outMetrics.widthPixels;
|
||||
// Height and width changes depending on orientation. Use the larger value for height.
|
||||
if (maxY < maxX)
|
||||
{
|
||||
float tmp = maxX;
|
||||
maxX = maxY;
|
||||
maxY = tmp;
|
||||
}
|
||||
Resources res = getResources();
|
||||
String portrait = "-Portrait";
|
||||
|
||||
// Each value is a percent from max X/Y stored as an int. Have to bring that value down
|
||||
// to a decimal before multiplying by MAX X/Y.
|
||||
sPrefsEditor.putFloat(ButtonType.BUTTON_A + portrait + "-X",
|
||||
(((float) res.getInteger(R.integer.BUTTON_A_PORTRAIT_X) / 1000) * maxX));
|
||||
sPrefsEditor.putFloat(ButtonType.BUTTON_A + portrait + "-Y",
|
||||
(((float) res.getInteger(R.integer.BUTTON_A_PORTRAIT_Y) / 1000) * maxY));
|
||||
sPrefsEditor.putFloat(ButtonType.BUTTON_B + portrait + "-X",
|
||||
(((float) res.getInteger(R.integer.BUTTON_B_PORTRAIT_X) / 1000) * maxX));
|
||||
sPrefsEditor.putFloat(ButtonType.BUTTON_B + portrait + "-Y",
|
||||
(((float) res.getInteger(R.integer.BUTTON_B_PORTRAIT_Y) / 1000) * maxY));
|
||||
sPrefsEditor.putFloat(ButtonType.BUTTON_X + portrait + "-X",
|
||||
(((float) res.getInteger(R.integer.BUTTON_X_PORTRAIT_X) / 1000) * maxX));
|
||||
sPrefsEditor.putFloat(ButtonType.BUTTON_X + portrait + "-Y",
|
||||
(((float) res.getInteger(R.integer.BUTTON_X_PORTRAIT_Y) / 1000) * maxY));
|
||||
sPrefsEditor.putFloat(ButtonType.BUTTON_Y + portrait + "-X",
|
||||
(((float) res.getInteger(R.integer.BUTTON_Y_PORTRAIT_X) / 1000) * maxX));
|
||||
sPrefsEditor.putFloat(ButtonType.BUTTON_Y + portrait + "-Y",
|
||||
(((float) res.getInteger(R.integer.BUTTON_Y_PORTRAIT_Y) / 1000) * maxY));
|
||||
sPrefsEditor.putFloat(ButtonType.BUTTON_Z + portrait + "-X",
|
||||
(((float) res.getInteger(R.integer.BUTTON_Z_PORTRAIT_X) / 1000) * maxX));
|
||||
sPrefsEditor.putFloat(ButtonType.BUTTON_Z + portrait + "-Y",
|
||||
(((float) res.getInteger(R.integer.BUTTON_Z_PORTRAIT_Y) / 1000) * maxY));
|
||||
sPrefsEditor.putFloat(ButtonType.BUTTON_UP + portrait + "-X",
|
||||
(((float) res.getInteger(R.integer.BUTTON_UP_PORTRAIT_X) / 1000) * maxX));
|
||||
sPrefsEditor.putFloat(ButtonType.BUTTON_UP + portrait + "-Y",
|
||||
(((float) res.getInteger(R.integer.BUTTON_UP_PORTRAIT_Y) / 1000) * maxY));
|
||||
sPrefsEditor.putFloat(ButtonType.TRIGGER_L + portrait + "-X",
|
||||
(((float) res.getInteger(R.integer.TRIGGER_L_PORTRAIT_X) / 1000) * maxX));
|
||||
sPrefsEditor.putFloat(ButtonType.TRIGGER_L + portrait + "-Y",
|
||||
(((float) res.getInteger(R.integer.TRIGGER_L_PORTRAIT_Y) / 1000) * maxY));
|
||||
sPrefsEditor.putFloat(ButtonType.TRIGGER_R + portrait + "-X",
|
||||
(((float) res.getInteger(R.integer.TRIGGER_R_PORTRAIT_X) / 1000) * maxX));
|
||||
sPrefsEditor.putFloat(ButtonType.TRIGGER_R + portrait + "-Y",
|
||||
(((float) res.getInteger(R.integer.TRIGGER_R_PORTRAIT_Y) / 1000) * maxY));
|
||||
sPrefsEditor.putFloat(ButtonType.BUTTON_START + portrait + "-X",
|
||||
(((float) res.getInteger(R.integer.BUTTON_START_PORTRAIT_X) / 1000) * maxX));
|
||||
sPrefsEditor.putFloat(ButtonType.BUTTON_START + portrait + "-Y",
|
||||
(((float) res.getInteger(R.integer.BUTTON_START_PORTRAIT_Y) / 1000) * maxY));
|
||||
sPrefsEditor.putFloat(ButtonType.STICK_C + portrait + "-X",
|
||||
(((float) res.getInteger(R.integer.STICK_C_PORTRAIT_X) / 1000) * maxX));
|
||||
sPrefsEditor.putFloat(ButtonType.STICK_C + portrait + "-Y",
|
||||
(((float) res.getInteger(R.integer.STICK_C_PORTRAIT_Y) / 1000) * maxY));
|
||||
sPrefsEditor.putFloat(ButtonType.STICK_MAIN + portrait + "-X",
|
||||
(((float) res.getInteger(R.integer.STICK_MAIN_PORTRAIT_X) / 1000) * maxX));
|
||||
sPrefsEditor.putFloat(ButtonType.STICK_MAIN + portrait + "-Y",
|
||||
(((float) res.getInteger(R.integer.STICK_MAIN_PORTRAIT_Y) / 1000) * maxY));
|
||||
|
||||
// We want to commit right away, otherwise the overlay could load before this is saved.
|
||||
sPrefsEditor.commit();
|
||||
}
|
||||
|
||||
private void wiiDefaultOverlay()
|
||||
{
|
||||
SharedPreferences.Editor sPrefsEditor = mPreferences.edit();
|
||||
|
@ -1087,6 +1172,82 @@ public final class InputOverlay extends SurfaceView implements OnTouchListener
|
|||
sPrefsEditor.commit();
|
||||
}
|
||||
|
||||
private void wiiPortraitDefaultOverlay()
|
||||
{
|
||||
SharedPreferences.Editor sPrefsEditor = mPreferences.edit();
|
||||
|
||||
// Get screen size
|
||||
Display display = ((Activity) getContext()).getWindowManager().getDefaultDisplay();
|
||||
DisplayMetrics outMetrics = new DisplayMetrics();
|
||||
display.getMetrics(outMetrics);
|
||||
float maxX = outMetrics.heightPixels;
|
||||
float maxY = outMetrics.widthPixels;
|
||||
// Height and width changes depending on orientation. Use the larger value for maxX.
|
||||
if (maxY < maxX)
|
||||
{
|
||||
float tmp = maxX;
|
||||
maxX = maxY;
|
||||
maxY = tmp;
|
||||
}
|
||||
Resources res = getResources();
|
||||
String portrait = "-Portrait";
|
||||
|
||||
// Each value is a percent from max X/Y stored as an int. Have to bring that value down
|
||||
// to a decimal before multiplying by MAX X/Y.
|
||||
sPrefsEditor.putFloat(ButtonType.WIIMOTE_BUTTON_A + portrait + "-X",
|
||||
(((float) res.getInteger(R.integer.WIIMOTE_BUTTON_A_PORTRAIT_X) / 1000) * maxX));
|
||||
sPrefsEditor.putFloat(ButtonType.WIIMOTE_BUTTON_A + portrait + "-Y",
|
||||
(((float) res.getInteger(R.integer.WIIMOTE_BUTTON_A_PORTRAIT_Y) / 1000) * maxY));
|
||||
sPrefsEditor.putFloat(ButtonType.WIIMOTE_BUTTON_B + portrait + "-X",
|
||||
(((float) res.getInteger(R.integer.WIIMOTE_BUTTON_B_PORTRAIT_X) / 1000) * maxX));
|
||||
sPrefsEditor.putFloat(ButtonType.WIIMOTE_BUTTON_B + portrait + "-Y",
|
||||
(((float) res.getInteger(R.integer.WIIMOTE_BUTTON_B_PORTRAIT_Y) / 1000) * maxY));
|
||||
sPrefsEditor.putFloat(ButtonType.WIIMOTE_BUTTON_1 + portrait + "-X",
|
||||
(((float) res.getInteger(R.integer.WIIMOTE_BUTTON_1_PORTRAIT_X) / 1000) * maxX));
|
||||
sPrefsEditor.putFloat(ButtonType.WIIMOTE_BUTTON_1 + portrait + "-Y",
|
||||
(((float) res.getInteger(R.integer.WIIMOTE_BUTTON_1_PORTRAIT_Y) / 1000) * maxY));
|
||||
sPrefsEditor.putFloat(ButtonType.WIIMOTE_BUTTON_2 + portrait + "-X",
|
||||
(((float) res.getInteger(R.integer.WIIMOTE_BUTTON_2_PORTRAIT_X) / 1000) * maxX));
|
||||
sPrefsEditor.putFloat(ButtonType.WIIMOTE_BUTTON_2 + portrait + "-Y",
|
||||
(((float) res.getInteger(R.integer.WIIMOTE_BUTTON_2_PORTRAIT_Y) / 1000) * maxY));
|
||||
sPrefsEditor.putFloat(ButtonType.NUNCHUK_BUTTON_Z + portrait + "-X",
|
||||
(((float) res.getInteger(R.integer.NUNCHUK_BUTTON_Z_PORTRAIT_X) / 1000) * maxX));
|
||||
sPrefsEditor.putFloat(ButtonType.NUNCHUK_BUTTON_Z + portrait + "-Y",
|
||||
(((float) res.getInteger(R.integer.NUNCHUK_BUTTON_Z_PORTRAIT_Y) / 1000) * maxY));
|
||||
sPrefsEditor.putFloat(ButtonType.NUNCHUK_BUTTON_C + portrait + "-X",
|
||||
(((float) res.getInteger(R.integer.NUNCHUK_BUTTON_C_PORTRAIT_X) / 1000) * maxX));
|
||||
sPrefsEditor.putFloat(ButtonType.NUNCHUK_BUTTON_C + portrait + "-Y",
|
||||
(((float) res.getInteger(R.integer.NUNCHUK_BUTTON_C_PORTRAIT_Y) / 1000) * maxY));
|
||||
sPrefsEditor.putFloat(ButtonType.WIIMOTE_BUTTON_MINUS + portrait + "-X",
|
||||
(((float) res.getInteger(R.integer.WIIMOTE_BUTTON_MINUS_PORTRAIT_X) / 1000) * maxX));
|
||||
sPrefsEditor.putFloat(ButtonType.WIIMOTE_BUTTON_MINUS + portrait + "-Y",
|
||||
(((float) res.getInteger(R.integer.WIIMOTE_BUTTON_MINUS_PORTRAIT_Y) / 1000) * maxY));
|
||||
sPrefsEditor.putFloat(ButtonType.WIIMOTE_BUTTON_PLUS + portrait + "-X",
|
||||
(((float) res.getInteger(R.integer.WIIMOTE_BUTTON_PLUS_PORTRAIT_X) / 1000) * maxX));
|
||||
sPrefsEditor.putFloat(ButtonType.WIIMOTE_BUTTON_PLUS + portrait + "-Y",
|
||||
(((float) res.getInteger(R.integer.WIIMOTE_BUTTON_PLUS_PORTRAIT_Y) / 1000) * maxY));
|
||||
sPrefsEditor.putFloat(ButtonType.WIIMOTE_UP + portrait + "-X",
|
||||
(((float) res.getInteger(R.integer.WIIMOTE_UP_PORTRAIT_X) / 1000) * maxX));
|
||||
sPrefsEditor.putFloat(ButtonType.WIIMOTE_UP + portrait + "-Y",
|
||||
(((float) res.getInteger(R.integer.WIIMOTE_UP_PORTRAIT_Y) / 1000) * maxY));
|
||||
sPrefsEditor.putFloat(ButtonType.WIIMOTE_BUTTON_HOME + portrait + "-X",
|
||||
(((float) res.getInteger(R.integer.WIIMOTE_BUTTON_HOME_PORTRAIT_X) / 1000) * maxX));
|
||||
sPrefsEditor.putFloat(ButtonType.WIIMOTE_BUTTON_HOME + portrait + "-Y",
|
||||
(((float) res.getInteger(R.integer.WIIMOTE_BUTTON_HOME_PORTRAIT_Y) / 1000) * maxY));
|
||||
sPrefsEditor.putFloat(ButtonType.NUNCHUK_STICK + portrait + "-X",
|
||||
(((float) res.getInteger(R.integer.NUNCHUK_STICK_PORTRAIT_X) / 1000) * maxX));
|
||||
sPrefsEditor.putFloat(ButtonType.NUNCHUK_STICK + portrait + "-Y",
|
||||
(((float) res.getInteger(R.integer.NUNCHUK_STICK_PORTRAIT_Y) / 1000) * maxY));
|
||||
// Horizontal dpad
|
||||
sPrefsEditor.putFloat(ButtonType.WIIMOTE_RIGHT + portrait + "-X",
|
||||
(((float) res.getInteger(R.integer.WIIMOTE_RIGHT_PORTRAIT_X) / 1000) * maxX));
|
||||
sPrefsEditor.putFloat(ButtonType.WIIMOTE_RIGHT + portrait + "-Y",
|
||||
(((float) res.getInteger(R.integer.WIIMOTE_RIGHT_PORTRAIT_Y) / 1000) * maxY));
|
||||
|
||||
// We want to commit right away, otherwise the overlay could load before this is saved.
|
||||
sPrefsEditor.commit();
|
||||
}
|
||||
|
||||
private void wiiClassicDefaultOverlay()
|
||||
{
|
||||
SharedPreferences.Editor sPrefsEditor = mPreferences.edit();
|
||||
|
@ -1168,4 +1329,88 @@ public final class InputOverlay extends SurfaceView implements OnTouchListener
|
|||
// We want to commit right away, otherwise the overlay could load before this is saved.
|
||||
sPrefsEditor.commit();
|
||||
}
|
||||
|
||||
|
||||
private void wiiClassicPortraitDefaultOverlay()
|
||||
{
|
||||
SharedPreferences.Editor sPrefsEditor = mPreferences.edit();
|
||||
|
||||
// Get screen size
|
||||
Display display = ((Activity) getContext()).getWindowManager().getDefaultDisplay();
|
||||
DisplayMetrics outMetrics = new DisplayMetrics();
|
||||
display.getMetrics(outMetrics);
|
||||
float maxX = outMetrics.heightPixels;
|
||||
float maxY = outMetrics.widthPixels;
|
||||
// Height and width changes depending on orientation. Use the larger value for maxX.
|
||||
if (maxY < maxX)
|
||||
{
|
||||
float tmp = maxX;
|
||||
maxX = maxY;
|
||||
maxY = tmp;
|
||||
}
|
||||
Resources res = getResources();
|
||||
String portrait = "-Portrait";
|
||||
|
||||
// Each value is a percent from max X/Y stored as an int. Have to bring that value down
|
||||
// to a decimal before multiplying by MAX X/Y.
|
||||
sPrefsEditor.putFloat(ButtonType.CLASSIC_BUTTON_A + portrait + "-X",
|
||||
(((float) res.getInteger(R.integer.CLASSIC_BUTTON_A_PORTRAIT_X) / 1000) * maxX));
|
||||
sPrefsEditor.putFloat(ButtonType.CLASSIC_BUTTON_A + portrait + "-Y",
|
||||
(((float) res.getInteger(R.integer.CLASSIC_BUTTON_A_PORTRAIT_Y) / 1000) * maxY));
|
||||
sPrefsEditor.putFloat(ButtonType.CLASSIC_BUTTON_B + portrait + "-X",
|
||||
(((float) res.getInteger(R.integer.CLASSIC_BUTTON_B_PORTRAIT_X) / 1000) * maxX));
|
||||
sPrefsEditor.putFloat(ButtonType.CLASSIC_BUTTON_B + portrait + "-Y",
|
||||
(((float) res.getInteger(R.integer.CLASSIC_BUTTON_B_PORTRAIT_Y) / 1000) * maxY));
|
||||
sPrefsEditor.putFloat(ButtonType.CLASSIC_BUTTON_X + portrait + "-X",
|
||||
(((float) res.getInteger(R.integer.CLASSIC_BUTTON_X_PORTRAIT_X) / 1000) * maxX));
|
||||
sPrefsEditor.putFloat(ButtonType.CLASSIC_BUTTON_X + portrait + "-Y",
|
||||
(((float) res.getInteger(R.integer.CLASSIC_BUTTON_X_PORTRAIT_Y) / 1000) * maxY));
|
||||
sPrefsEditor.putFloat(ButtonType.CLASSIC_BUTTON_Y + portrait + "-X",
|
||||
(((float) res.getInteger(R.integer.CLASSIC_BUTTON_Y_PORTRAIT_X) / 1000) * maxX));
|
||||
sPrefsEditor.putFloat(ButtonType.CLASSIC_BUTTON_Y + portrait + "-Y",
|
||||
(((float) res.getInteger(R.integer.CLASSIC_BUTTON_Y_PORTRAIT_Y) / 1000) * maxY));
|
||||
sPrefsEditor.putFloat(ButtonType.CLASSIC_BUTTON_MINUS + portrait + "-X",
|
||||
(((float) res.getInteger(R.integer.CLASSIC_BUTTON_MINUS_PORTRAIT_X) / 1000) * maxX));
|
||||
sPrefsEditor.putFloat(ButtonType.CLASSIC_BUTTON_MINUS + portrait + "-Y",
|
||||
(((float) res.getInteger(R.integer.CLASSIC_BUTTON_MINUS_PORTRAIT_Y) / 1000) * maxY));
|
||||
sPrefsEditor.putFloat(ButtonType.CLASSIC_BUTTON_PLUS + portrait + "-X",
|
||||
(((float) res.getInteger(R.integer.CLASSIC_BUTTON_PLUS_PORTRAIT_X) / 1000) * maxX));
|
||||
sPrefsEditor.putFloat(ButtonType.CLASSIC_BUTTON_PLUS + portrait + "-Y",
|
||||
(((float) res.getInteger(R.integer.CLASSIC_BUTTON_PLUS_PORTRAIT_Y) / 1000) * maxY));
|
||||
sPrefsEditor.putFloat(ButtonType.CLASSIC_BUTTON_HOME + portrait + "-X",
|
||||
(((float) res.getInteger(R.integer.CLASSIC_BUTTON_HOME_PORTRAIT_X) / 1000) * maxX));
|
||||
sPrefsEditor.putFloat(ButtonType.CLASSIC_BUTTON_HOME + portrait + "-Y",
|
||||
(((float) res.getInteger(R.integer.CLASSIC_BUTTON_HOME_PORTRAIT_Y) / 1000) * maxY));
|
||||
sPrefsEditor.putFloat(ButtonType.CLASSIC_BUTTON_ZL + portrait + "-X",
|
||||
(((float) res.getInteger(R.integer.CLASSIC_BUTTON_ZL_PORTRAIT_X) / 1000) * maxX));
|
||||
sPrefsEditor.putFloat(ButtonType.CLASSIC_BUTTON_ZL + portrait + "-Y",
|
||||
(((float) res.getInteger(R.integer.CLASSIC_BUTTON_ZL_PORTRAIT_Y) / 1000) * maxY));
|
||||
sPrefsEditor.putFloat(ButtonType.CLASSIC_BUTTON_ZR + portrait + "-X",
|
||||
(((float) res.getInteger(R.integer.CLASSIC_BUTTON_ZR_PORTRAIT_X) / 1000) * maxX));
|
||||
sPrefsEditor.putFloat(ButtonType.CLASSIC_BUTTON_ZR + portrait + "-Y",
|
||||
(((float) res.getInteger(R.integer.CLASSIC_BUTTON_ZR_PORTRAIT_Y) / 1000) * maxY));
|
||||
sPrefsEditor.putFloat(ButtonType.CLASSIC_DPAD_UP + portrait + "-X",
|
||||
(((float) res.getInteger(R.integer.CLASSIC_DPAD_UP_PORTRAIT_X) / 1000) * maxX));
|
||||
sPrefsEditor.putFloat(ButtonType.CLASSIC_DPAD_UP + portrait + "-Y",
|
||||
(((float) res.getInteger(R.integer.CLASSIC_DPAD_UP_PORTRAIT_Y) / 1000) * maxY));
|
||||
sPrefsEditor.putFloat(ButtonType.CLASSIC_STICK_LEFT + portrait + "-X",
|
||||
(((float) res.getInteger(R.integer.CLASSIC_STICK_LEFT_PORTRAIT_X) / 1000) * maxX));
|
||||
sPrefsEditor.putFloat(ButtonType.CLASSIC_STICK_LEFT + portrait + "-Y",
|
||||
(((float) res.getInteger(R.integer.CLASSIC_STICK_LEFT_PORTRAIT_Y) / 1000) * maxY));
|
||||
sPrefsEditor.putFloat(ButtonType.CLASSIC_STICK_RIGHT + portrait + "-X",
|
||||
(((float) res.getInteger(R.integer.CLASSIC_STICK_RIGHT_PORTRAIT_X) / 1000) * maxX));
|
||||
sPrefsEditor.putFloat(ButtonType.CLASSIC_STICK_RIGHT + portrait + "-Y",
|
||||
(((float) res.getInteger(R.integer.CLASSIC_STICK_RIGHT_PORTRAIT_Y) / 1000) * maxY));
|
||||
sPrefsEditor.putFloat(ButtonType.CLASSIC_TRIGGER_L + portrait + "-X",
|
||||
(((float) res.getInteger(R.integer.CLASSIC_TRIGGER_L_PORTRAIT_X) / 1000) * maxX));
|
||||
sPrefsEditor.putFloat(ButtonType.CLASSIC_TRIGGER_L + portrait + "-Y",
|
||||
(((float) res.getInteger(R.integer.CLASSIC_TRIGGER_L_PORTRAIT_Y) / 1000) * maxY));
|
||||
sPrefsEditor.putFloat(ButtonType.CLASSIC_TRIGGER_R + portrait + "-X",
|
||||
(((float) res.getInteger(R.integer.CLASSIC_TRIGGER_R_PORTRAIT_X) / 1000) * maxX));
|
||||
sPrefsEditor.putFloat(ButtonType.CLASSIC_TRIGGER_R + portrait + "-Y",
|
||||
(((float) res.getInteger(R.integer.CLASSIC_TRIGGER_R_PORTRAIT_Y) / 1000) * maxY));
|
||||
|
||||
// We want to commit right away, otherwise the overlay could load before this is saved.
|
||||
sPrefsEditor.commit();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,6 +26,30 @@
|
|||
<integer name="STICK_MAIN_X">17</integer>
|
||||
<integer name="STICK_MAIN_Y">620</integer>
|
||||
|
||||
<!-- Default GameCube portrait layout -->
|
||||
<integer name="BUTTON_A_PORTRAIT_X">638</integer>
|
||||
<integer name="BUTTON_A_PORTRAIT_Y">534</integer>
|
||||
<integer name="BUTTON_B_PORTRAIT_X">560</integer>
|
||||
<integer name="BUTTON_B_PORTRAIT_Y">648</integer>
|
||||
<integer name="BUTTON_X_PORTRAIT_X">795</integer>
|
||||
<integer name="BUTTON_X_PORTRAIT_Y">519</integer>
|
||||
<integer name="BUTTON_Y_PORTRAIT_X">594</integer>
|
||||
<integer name="BUTTON_Y_PORTRAIT_Y">463</integer>
|
||||
<integer name="BUTTON_Z_PORTRAIT_X">357</integer>
|
||||
<integer name="BUTTON_Z_PORTRAIT_Y">560</integer>
|
||||
<integer name="BUTTON_UP_PORTRAIT_X">44</integer>
|
||||
<integer name="BUTTON_UP_PORTRAIT_Y">448</integer>
|
||||
<integer name="TRIGGER_L_PORTRAIT_X">76</integer>
|
||||
<integer name="TRIGGER_L_PORTRAIT_Y">582</integer>
|
||||
<integer name="TRIGGER_R_PORTRAIT_X">739</integer>
|
||||
<integer name="TRIGGER_R_PORTRAIT_Y">629</integer>
|
||||
<integer name="BUTTON_START_PORTRAIT_X">472</integer>
|
||||
<integer name="BUTTON_START_PORTRAIT_Y">789</integer>
|
||||
<integer name="STICK_C_PORTRAIT_X">622</integer>
|
||||
<integer name="STICK_C_PORTRAIT_Y">715</integer>
|
||||
<integer name="STICK_MAIN_PORTRAIT_X">134</integer>
|
||||
<integer name="STICK_MAIN_PORTRAIT_Y">687</integer>
|
||||
|
||||
<!-- Default Wii landscape layout -->
|
||||
<integer name="WIIMOTE_BUTTON_A_X">858</integer>
|
||||
<integer name="WIIMOTE_BUTTON_A_Y">772</integer>
|
||||
|
@ -53,6 +77,34 @@
|
|||
<integer name="WIIMOTE_RIGHT_X">100</integer>
|
||||
<integer name="WIIMOTE_RIGHT_Y">683</integer>
|
||||
|
||||
<!-- Default Wii portrait layout -->
|
||||
<integer name="WIIMOTE_BUTTON_A_PORTRAIT_X">769</integer>
|
||||
<integer name="WIIMOTE_BUTTON_A_PORTRAIT_Y">584</integer>
|
||||
<integer name="WIIMOTE_BUTTON_B_PORTRAIT_X">553</integer>
|
||||
<integer name="WIIMOTE_BUTTON_B_PORTRAIT_Y">621</integer>
|
||||
<integer name="WIIMOTE_BUTTON_1_PORTRAIT_X">707</integer>
|
||||
<integer name="WIIMOTE_BUTTON_1_PORTRAIT_Y">742</integer>
|
||||
<integer name="WIIMOTE_BUTTON_2_PORTRAIT_X">846</integer>
|
||||
<integer name="WIIMOTE_BUTTON_2_PORTRAIT_Y">692</integer>
|
||||
<integer name="NUNCHUK_BUTTON_Z_PORTRAIT_X">526</integer>
|
||||
<integer name="NUNCHUK_BUTTON_Z_PORTRAIT_Y">483</integer>
|
||||
<integer name="NUNCHUK_BUTTON_C_PORTRAIT_X">786</integer>
|
||||
<integer name="NUNCHUK_BUTTON_C_PORTRAIT_Y">455</integer>
|
||||
<integer name="WIIMOTE_BUTTON_MINUS_PORTRAIT_X">100</integer>
|
||||
<integer name="WIIMOTE_BUTTON_MINUS_PORTRAIT_Y">420</integer>
|
||||
<integer name="WIIMOTE_BUTTON_PLUS_PORTRAIT_X">400</integer>
|
||||
<integer name="WIIMOTE_BUTTON_PLUS_PORTRAIT_Y">420</integer>
|
||||
<integer name="WIIMOTE_UP_PORTRAIT_X">260</integer>
|
||||
<integer name="WIIMOTE_UP_PORTRAIT_Y">773</integer>
|
||||
<integer name="WIIMOTE_BUTTON_HOME_PORTRAIT_X">250</integer>
|
||||
<integer name="WIIMOTE_BUTTON_HOME_PORTRAIT_Y">420</integer>
|
||||
<integer name="NUNCHUK_STICK_PORTRAIT_X">68</integer>
|
||||
<integer name="NUNCHUK_STICK_PORTRAIT_Y">602</integer>
|
||||
|
||||
<integer name="WIIMOTE_RIGHT_PORTRAIT_X">68</integer>
|
||||
<integer name="WIIMOTE_RIGHT_PORTRAIT_Y">602</integer>
|
||||
|
||||
<!-- Default Wii classic landscape layout -->
|
||||
<integer name="CLASSIC_BUTTON_A_X">860</integer>
|
||||
<integer name="CLASSIC_BUTTON_A_Y">688</integer>
|
||||
<integer name="CLASSIC_BUTTON_B_X">787</integer>
|
||||
|
@ -81,4 +133,34 @@
|
|||
<integer name="CLASSIC_TRIGGER_L_Y">429</integer>
|
||||
<integer name="CLASSIC_TRIGGER_R_X">737</integer>
|
||||
<integer name="CLASSIC_TRIGGER_R_Y">311</integer>
|
||||
|
||||
<!-- Default Wii classic portrait layout -->
|
||||
<integer name="CLASSIC_BUTTON_A_PORTRAIT_X">820</integer>
|
||||
<integer name="CLASSIC_BUTTON_A_PORTRAIT_Y">481</integer>
|
||||
<integer name="CLASSIC_BUTTON_B_PORTRAIT_X">763</integer>
|
||||
<integer name="CLASSIC_BUTTON_B_PORTRAIT_Y">562</integer>
|
||||
<integer name="CLASSIC_BUTTON_X_PORTRAIT_X">665</integer>
|
||||
<integer name="CLASSIC_BUTTON_X_PORTRAIT_Y">476</integer>
|
||||
<integer name="CLASSIC_BUTTON_Y_PORTRAIT_X">601</integer>
|
||||
<integer name="CLASSIC_BUTTON_Y_PORTRAIT_Y">552</integer>
|
||||
<integer name="CLASSIC_BUTTON_MINUS_PORTRAIT_X">100</integer>
|
||||
<integer name="CLASSIC_BUTTON_MINUS_PORTRAIT_Y">420</integer>
|
||||
<integer name="CLASSIC_BUTTON_PLUS_PORTRAIT_X">400</integer>
|
||||
<integer name="CLASSIC_BUTTON_PLUS_PORTRAIT_Y">420</integer>
|
||||
<integer name="CLASSIC_BUTTON_HOME_PORTRAIT_X">250</integer>
|
||||
<integer name="CLASSIC_BUTTON_HOME_PORTRAIT_Y">420</integer>
|
||||
<integer name="CLASSIC_BUTTON_ZL_PORTRAIT_X">301</integer>
|
||||
<integer name="CLASSIC_BUTTON_ZL_PORTRAIT_Y">613</integer>
|
||||
<integer name="CLASSIC_BUTTON_ZR_PORTRAIT_X">445</integer>
|
||||
<integer name="CLASSIC_BUTTON_ZR_PORTRAIT_Y">734</integer>
|
||||
<integer name="CLASSIC_DPAD_UP_PORTRAIT_X">101</integer>
|
||||
<integer name="CLASSIC_DPAD_UP_PORTRAIT_Y">752</integer>
|
||||
<integer name="CLASSIC_STICK_LEFT_PORTRAIT_X">46</integer>
|
||||
<integer name="CLASSIC_STICK_LEFT_PORTRAIT_Y">533</integer>
|
||||
<integer name="CLASSIC_STICK_RIGHT_PORTRAIT_X">706</integer>
|
||||
<integer name="CLASSIC_STICK_RIGHT_PORTRAIT_Y">671</integer>
|
||||
<integer name="CLASSIC_TRIGGER_L_PORTRAIT_X">342</integer>
|
||||
<integer name="CLASSIC_TRIGGER_L_PORTRAIT_Y">458</integer>
|
||||
<integer name="CLASSIC_TRIGGER_R_PORTRAIT_X">650</integer>
|
||||
<integer name="CLASSIC_TRIGGER_R_PORTRAIT_Y">360</integer>
|
||||
</resources>
|
||||
|
|
Loading…
Reference in New Issue