Android: On-screen classic controller + Wii controller select

It's now possible to switch between a horizontal or vertical Wiimote
with no extension, a Wiimote with a Nunchuk, a Classic Controller,
or a GameCube Controller when running a Wii game.
This commit is contained in:
Sean Maas 2016-10-12 17:20:32 -04:00
parent 14facbc438
commit f981098438
7 changed files with 455 additions and 152 deletions

View File

@ -118,7 +118,7 @@ public final class NativeLibrary
public static final int CLASSIC_DPAD_UP = 309; public static final int CLASSIC_DPAD_UP = 309;
public static final int CLASSIC_DPAD_DOWN = 310; public static final int CLASSIC_DPAD_DOWN = 310;
public static final int CLASSIC_DPAD_LEFT = 311; public static final int CLASSIC_DPAD_LEFT = 311;
public static final int CLASSIC_DPADON_RIGHT = 312; public static final int CLASSIC_DPAD_RIGHT = 312;
public static final int CLASSIC_STICK_LEFT = 313; public static final int CLASSIC_STICK_LEFT = 313;
public static final int CLASSIC_STICK_LEFT_UP = 314; public static final int CLASSIC_STICK_LEFT_UP = 314;
public static final int CLASSIC_STICK_LEFT_DOWN = 315; public static final int CLASSIC_STICK_LEFT_DOWN = 315;

View File

@ -27,6 +27,7 @@ import android.widget.ImageView;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.SeekBar; import android.widget.SeekBar;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast;
import com.squareup.picasso.Callback; import com.squareup.picasso.Callback;
import com.squareup.picasso.Picasso; import com.squareup.picasso.Picasso;
@ -383,7 +384,14 @@ public final class EmulationActivity extends AppCompatActivity
public boolean onCreateOptionsMenu(Menu menu) public boolean onCreateOptionsMenu(Menu menu)
{ {
// Inflate the menu; this adds items to the action bar if it is present. // Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_emulation, menu); if (mIsGameCubeGame)
{
getMenuInflater().inflate(R.menu.menu_emulation, menu);
}
else
{
getMenuInflater().inflate(R.menu.menu_emulation_wii, menu);
}
return true; return true;
} }
@ -414,10 +422,11 @@ public final class EmulationActivity extends AppCompatActivity
// Enable/Disable specific buttons or the entire input overlay. // Enable/Disable specific buttons or the entire input overlay.
case R.id.menu_emulation_toggle_controls: case R.id.menu_emulation_toggle_controls:
{ {
boolean[] enabledButtons = new boolean[11]; final SharedPreferences.Editor editor = mPreferences.edit();
boolean[] enabledButtons = new boolean[14];
AlertDialog.Builder builder = new AlertDialog.Builder(this); AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle(R.string.emulation_toggle_controls); builder.setTitle(R.string.emulation_toggle_controls);
if (mIsGameCubeGame) if (mIsGameCubeGame || mPreferences.getInt("wiiController", 3) == 0)
{ {
for (int i = 0; i < enabledButtons.length; i++) for (int i = 0; i < enabledButtons.length; i++)
{ {
@ -429,19 +438,23 @@ public final class EmulationActivity extends AppCompatActivity
@Override @Override
public void onClick(DialogInterface dialog, int indexSelected, boolean isChecked) public void onClick(DialogInterface dialog, int indexSelected, boolean isChecked)
{ {
SharedPreferences.Editor editor = mPreferences.edit(); editor.putBoolean("buttonToggleGc" + indexSelected, isChecked);
}
if (mPreferences.getBoolean("buttonToggleGc" + indexSelected, true)) });
{ }
// If the button is enabled, disable it. else if (mPreferences.getInt("wiiController", 3) == 4)
editor.putBoolean("buttonToggleGc" + indexSelected, false); {
} for (int i = 0; i < enabledButtons.length; i++)
else {
{ enabledButtons[i] = mPreferences.getBoolean("buttonToggleClassic" + i, true);
// If the button is disabled, enable it. }
editor.putBoolean("buttonToggleGc" + indexSelected, true); builder.setMultiChoiceItems(R.array.classicButtons, enabledButtons,
} new DialogInterface.OnMultiChoiceClickListener()
editor.apply(); {
@Override
public void onClick(DialogInterface dialog, int indexSelected, boolean isChecked)
{
editor.putBoolean("buttonToggleClassic" + indexSelected, isChecked);
} }
}); });
} }
@ -451,28 +464,30 @@ public final class EmulationActivity extends AppCompatActivity
{ {
enabledButtons[i] = mPreferences.getBoolean("buttonToggleWii" + i, true); enabledButtons[i] = mPreferences.getBoolean("buttonToggleWii" + i, true);
} }
builder.setMultiChoiceItems(R.array.wiimoteButtons, enabledButtons, if (mPreferences.getInt("wiiController", 3) == 3)
new DialogInterface.OnMultiChoiceClickListener()
{ {
@Override builder.setMultiChoiceItems(R.array.nunchukButtons, enabledButtons,
public void onClick(DialogInterface dialog, int indexSelected, boolean isChecked) new DialogInterface.OnMultiChoiceClickListener()
{ {
SharedPreferences.Editor editor = mPreferences.edit(); @Override
public void onClick(DialogInterface dialog, int indexSelected, boolean isChecked)
if (mPreferences.getBoolean("buttonToggleWii" + indexSelected, true))
{ {
// If the button is enabled, disable it. editor.putBoolean("buttonToggleWii" + indexSelected, isChecked);
editor.putBoolean("buttonToggleWii" + indexSelected, false);
} }
else });
}
else
{
builder.setMultiChoiceItems(R.array.wiimoteButtons, enabledButtons,
new DialogInterface.OnMultiChoiceClickListener()
{
@Override
public void onClick(DialogInterface dialog, int indexSelected, boolean isChecked)
{ {
// If the button is disabled, enable it. editor.putBoolean("buttonToggleWii" + indexSelected, isChecked);
editor.putBoolean("buttonToggleWii" + indexSelected, true);
} }
});
editor.apply(); }
}
});
} }
builder.setNeutralButton(getString(R.string.emulation_toggle_all), new DialogInterface.OnClickListener() builder.setNeutralButton(getString(R.string.emulation_toggle_all), new DialogInterface.OnClickListener()
{ {
@ -489,6 +504,8 @@ public final class EmulationActivity extends AppCompatActivity
@Override @Override
public void onClick(DialogInterface dialogInterface, int i) public void onClick(DialogInterface dialogInterface, int i)
{ {
editor.apply();
EmulationFragment emulationFragment = (EmulationFragment) getFragmentManager() EmulationFragment emulationFragment = (EmulationFragment) getFragmentManager()
.findFragmentByTag(EmulationFragment.FRAGMENT_TAG); .findFragmentByTag(EmulationFragment.FRAGMENT_TAG);
emulationFragment.refreshInputOverlay(); emulationFragment.refreshInputOverlay();
@ -556,6 +573,43 @@ public final class EmulationActivity extends AppCompatActivity
return; return;
} }
// (Wii games only) Change the controller for the input overlay.
case R.id.menu_emulation_choose_controller:
final SharedPreferences.Editor editor = mPreferences.edit();
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle(R.string.emulation_choose_controller);
builder.setSingleChoiceItems(R.array.controllersEntries, mPreferences.getInt("wiiController", 3),
new DialogInterface.OnClickListener()
{
@Override
public void onClick(DialogInterface dialog, int indexSelected)
{
editor.putInt("wiiController", indexSelected);
NativeLibrary.SetConfig("WiimoteNew.ini", "Wiimote1", "Extension",
getResources().getStringArray(R.array.controllersValues)[indexSelected]);
}
});
builder.setPositiveButton(getString(R.string.emulation_done), new DialogInterface.OnClickListener()
{
@Override
public void onClick(DialogInterface dialogInterface, int i)
{
editor.apply();
EmulationFragment emulationFragment = (EmulationFragment) getFragmentManager()
.findFragmentByTag(EmulationFragment.FRAGMENT_TAG);
emulationFragment.refreshInputOverlay();
Toast.makeText(getApplication(), R.string.emulation_controller_changed, Toast.LENGTH_SHORT).show();
}
});
AlertDialog alertDialog = builder.create();
alertDialog.show();
return;
case R.id.menu_refresh_wiimotes: case R.id.menu_refresh_wiimotes:
NativeLibrary.RefreshWiimotes(); NativeLibrary.RefreshWiimotes();
return; return;

View File

@ -323,6 +323,191 @@ public final class InputOverlay extends SurfaceView implements OnTouchListener
return true; return true;
} }
private void addGameCubeOverlayControls()
{
if (mPreferences.getBoolean("buttonToggleGc0", true))
{
overlayButtons.add(initializeOverlayButton(getContext(), R.drawable.gcpad_a, ButtonType.BUTTON_A));
}
if (mPreferences.getBoolean("buttonToggleGc1", true))
{
overlayButtons.add(initializeOverlayButton(getContext(), R.drawable.gcpad_b, ButtonType.BUTTON_B));
}
if (mPreferences.getBoolean("buttonToggleGc2", true))
{
overlayButtons.add(initializeOverlayButton(getContext(), R.drawable.gcpad_x, ButtonType.BUTTON_X));
}
if (mPreferences.getBoolean("buttonToggleGc3", true))
{
overlayButtons.add(initializeOverlayButton(getContext(), R.drawable.gcpad_y, ButtonType.BUTTON_Y));
}
if (mPreferences.getBoolean("buttonToggleGc4", true))
{
overlayButtons.add(initializeOverlayButton(getContext(), R.drawable.gcpad_z, ButtonType.BUTTON_Z));
}
if (mPreferences.getBoolean("buttonToggleGc5", true))
{
overlayButtons.add(initializeOverlayButton(getContext(), R.drawable.gcpad_start, ButtonType.BUTTON_START));
}
if (mPreferences.getBoolean("buttonToggleGc6", true))
{
overlayButtons.add(initializeOverlayButton(getContext(), R.drawable.gcpad_l, ButtonType.TRIGGER_L));
}
if (mPreferences.getBoolean("buttonToggleGc7", true))
{
overlayButtons.add(initializeOverlayButton(getContext(), R.drawable.gcpad_r, ButtonType.TRIGGER_R));
}
if (mPreferences.getBoolean("buttonToggleGc8", true))
{
overlayDpads.add(initializeOverlayDpad(getContext(), R.drawable.gcwii_dpad,
ButtonType.BUTTON_UP, ButtonType.BUTTON_DOWN,
ButtonType.BUTTON_LEFT, ButtonType.BUTTON_RIGHT));
}
if (mPreferences.getBoolean("buttonToggleGc9", true))
{
overlayJoysticks.add(initializeOverlayJoystick(getContext(),
R.drawable.gcwii_joystick_range, R.drawable.gcwii_joystick,
ButtonType.STICK_MAIN));
}
if (mPreferences.getBoolean("buttonToggleGc10", true))
{
overlayJoysticks.add(initializeOverlayJoystick(getContext(),
R.drawable.gcwii_joystick_range, R.drawable.gcpad_c,
ButtonType.STICK_C));
}
}
private void addWiimoteOverlayControls()
{
if (mPreferences.getBoolean("buttonToggleWii0", true))
{
overlayButtons.add(initializeOverlayButton(getContext(), R.drawable.wiimote_a, ButtonType.WIIMOTE_BUTTON_A));
}
if (mPreferences.getBoolean("buttonToggleWii1", true))
{
overlayButtons.add(initializeOverlayButton(getContext(), R.drawable.wiimote_b, ButtonType.WIIMOTE_BUTTON_B));
}
if (mPreferences.getBoolean("buttonToggleWii2", true))
{
overlayButtons.add(initializeOverlayButton(getContext(), R.drawable.wiimote_one, ButtonType.WIIMOTE_BUTTON_1));
}
if (mPreferences.getBoolean("buttonToggleWii3", true))
{
overlayButtons.add(initializeOverlayButton(getContext(), R.drawable.wiimote_two, ButtonType.WIIMOTE_BUTTON_2));
}
if (mPreferences.getBoolean("buttonToggleWii4", true))
{
overlayButtons.add(initializeOverlayButton(getContext(), R.drawable.wiimote_plus, ButtonType.WIIMOTE_BUTTON_PLUS));
}
if (mPreferences.getBoolean("buttonToggleWii5", true))
{
overlayButtons.add(initializeOverlayButton(getContext(), R.drawable.wiimote_minus, ButtonType.WIIMOTE_BUTTON_MINUS));
}
if (mPreferences.getBoolean("buttonToggleWii6", true))
{
overlayButtons.add(initializeOverlayButton(getContext(), R.drawable.wiimote_home, ButtonType.WIIMOTE_BUTTON_HOME));
}
if (mPreferences.getBoolean("buttonToggleWii7", true))
{
if (mPreferences.getInt("wiiController", 3) == 2)
{
overlayDpads.add(initializeOverlayDpad(getContext(), R.drawable.gcwii_dpad,
ButtonType.WIIMOTE_RIGHT, ButtonType.WIIMOTE_LEFT,
ButtonType.WIIMOTE_UP, ButtonType.WIIMOTE_DOWN));
}
else
{
overlayDpads.add(initializeOverlayDpad(getContext(), R.drawable.gcwii_dpad,
ButtonType.WIIMOTE_UP, ButtonType.WIIMOTE_DOWN,
ButtonType.WIIMOTE_LEFT, ButtonType.WIIMOTE_RIGHT));
}
}
}
private void addNunchukOverlayControls()
{
if (mPreferences.getBoolean("buttonToggleWii8", true))
{
overlayButtons.add(initializeOverlayButton(getContext(), R.drawable.nunchuk_c, ButtonType.NUNCHUK_BUTTON_C));
}
if (mPreferences.getBoolean("buttonToggleWii9", true))
{
overlayButtons.add(initializeOverlayButton(getContext(), R.drawable.nunchuk_z, ButtonType.NUNCHUK_BUTTON_Z));
}
if (mPreferences.getBoolean("buttonToggleWii10", true))
{
overlayJoysticks.add(initializeOverlayJoystick(getContext(),
R.drawable.gcwii_joystick_range, R.drawable.gcwii_joystick,
ButtonType.NUNCHUK_STICK));
}
}
private void addClassicOverlayControls()
{
if (mPreferences.getBoolean("buttonToggleClassic0", true))
{
overlayButtons.add(initializeOverlayButton(getContext(), R.drawable.classic_a, ButtonType.CLASSIC_BUTTON_A));
}
if (mPreferences.getBoolean("buttonToggleClassic1", true))
{
overlayButtons.add(initializeOverlayButton(getContext(), R.drawable.classic_b, ButtonType.CLASSIC_BUTTON_B));
}
if (mPreferences.getBoolean("buttonToggleClassic2", true))
{
overlayButtons.add(initializeOverlayButton(getContext(), R.drawable.classic_x, ButtonType.CLASSIC_BUTTON_X));
}
if (mPreferences.getBoolean("buttonToggleClassic3", true))
{
overlayButtons.add(initializeOverlayButton(getContext(), R.drawable.classic_y, ButtonType.CLASSIC_BUTTON_Y));
}
if (mPreferences.getBoolean("buttonToggleClassic4", true))
{
overlayButtons.add(initializeOverlayButton(getContext(), R.drawable.wiimote_plus, ButtonType.CLASSIC_BUTTON_PLUS));
}
if (mPreferences.getBoolean("buttonToggleClassic5", true))
{
overlayButtons.add(initializeOverlayButton(getContext(), R.drawable.wiimote_minus, ButtonType.CLASSIC_BUTTON_MINUS));
}
if (mPreferences.getBoolean("buttonToggleClassic6", true))
{
overlayButtons.add(initializeOverlayButton(getContext(), R.drawable.wiimote_home, ButtonType.CLASSIC_BUTTON_HOME));
}
if (mPreferences.getBoolean("buttonToggleClassic7", true))
{
overlayButtons.add(initializeOverlayButton(getContext(), R.drawable.classic_l, ButtonType.CLASSIC_TRIGGER_L));
}
if (mPreferences.getBoolean("buttonToggleClassic8", true))
{
overlayButtons.add(initializeOverlayButton(getContext(), R.drawable.classic_r, ButtonType.CLASSIC_TRIGGER_R));
}
if (mPreferences.getBoolean("buttonToggleClassic9", true))
{
overlayButtons.add(initializeOverlayButton(getContext(), R.drawable.classic_zl, ButtonType.CLASSIC_BUTTON_ZL));
}
if (mPreferences.getBoolean("buttonToggleClassic10", true))
{
overlayButtons.add(initializeOverlayButton(getContext(), R.drawable.classic_zr, ButtonType.CLASSIC_BUTTON_ZR));
}
if (mPreferences.getBoolean("buttonToggleClassic11", true))
{
overlayDpads.add(initializeOverlayDpad(getContext(), R.drawable.gcwii_dpad,
ButtonType.CLASSIC_DPAD_UP, ButtonType.CLASSIC_DPAD_DOWN,
ButtonType.CLASSIC_DPAD_LEFT, ButtonType.CLASSIC_DPAD_RIGHT));
}
if (mPreferences.getBoolean("buttonToggleClassic12", true))
{
overlayJoysticks.add(initializeOverlayJoystick(getContext(),
R.drawable.gcwii_joystick_range, R.drawable.gcwii_joystick,
ButtonType.CLASSIC_STICK_LEFT));
}
if (mPreferences.getBoolean("buttonToggleClassic13", true))
{
overlayJoysticks.add(initializeOverlayJoystick(getContext(),
R.drawable.gcwii_joystick_range, R.drawable.gcwii_joystick,
ButtonType.CLASSIC_STICK_RIGHT));
}
}
public void refreshControls() public void refreshControls()
{ {
// Remove all the overlay buttons from the HashSet. // Remove all the overlay buttons from the HashSet.
@ -331,110 +516,20 @@ public final class InputOverlay extends SurfaceView implements OnTouchListener
overlayJoysticks.removeAll(overlayJoysticks); overlayJoysticks.removeAll(overlayJoysticks);
// Add all the enabled overlay items back to the HashSet. // Add all the enabled overlay items back to the HashSet.
if (EmulationActivity.isGameCubeGame()) if (EmulationActivity.isGameCubeGame() || mPreferences.getInt("wiiController", 3) == 0)
{ {
// GameCube addGameCubeOverlayControls();
if (mPreferences.getBoolean("buttonToggleGc0", true)) }
{ else if (mPreferences.getInt("wiiController", 3) == 4)
overlayButtons.add(initializeOverlayButton(getContext(), R.drawable.gcpad_a, ButtonType.BUTTON_A)); {
} addClassicOverlayControls();
if (mPreferences.getBoolean("buttonToggleGc1", true))
{
overlayButtons.add(initializeOverlayButton(getContext(), R.drawable.gcpad_b, ButtonType.BUTTON_B));
}
if (mPreferences.getBoolean("buttonToggleGc2", true))
{
overlayButtons.add(initializeOverlayButton(getContext(), R.drawable.gcpad_x, ButtonType.BUTTON_X));
}
if (mPreferences.getBoolean("buttonToggleGc3", true))
{
overlayButtons.add(initializeOverlayButton(getContext(), R.drawable.gcpad_y, ButtonType.BUTTON_Y));
}
if (mPreferences.getBoolean("buttonToggleGc4", true))
{
overlayButtons.add(initializeOverlayButton(getContext(), R.drawable.gcpad_z, ButtonType.BUTTON_Z));
}
if (mPreferences.getBoolean("buttonToggleGc5", true))
{
overlayButtons.add(initializeOverlayButton(getContext(), R.drawable.gcpad_start, ButtonType.BUTTON_START));
}
if (mPreferences.getBoolean("buttonToggleGc6", true))
{
overlayButtons.add(initializeOverlayButton(getContext(), R.drawable.gcpad_l, ButtonType.TRIGGER_L));
}
if (mPreferences.getBoolean("buttonToggleGc7", true))
{
overlayButtons.add(initializeOverlayButton(getContext(), R.drawable.gcpad_r, ButtonType.TRIGGER_R));
}
if (mPreferences.getBoolean("buttonToggleGc8", true))
{
overlayDpads.add(initializeOverlayDpad(getContext(), R.drawable.gcwii_dpad,
ButtonType.BUTTON_UP, ButtonType.BUTTON_DOWN,
ButtonType.BUTTON_LEFT, ButtonType.BUTTON_RIGHT));
}
if (mPreferences.getBoolean("buttonToggleGc9", true))
{
overlayJoysticks.add(initializeOverlayJoystick(getContext(),
R.drawable.gcwii_joystick_range, R.drawable.gcwii_joystick,
ButtonType.STICK_MAIN));
}
if (mPreferences.getBoolean("buttonToggleGc10", true))
{
overlayJoysticks.add(initializeOverlayJoystick(getContext(),
R.drawable.gcwii_joystick_range, R.drawable.gcpad_c,
ButtonType.STICK_C));
}
} }
else else
{ {
// Wiimote + Nunchuk addWiimoteOverlayControls();
if (mPreferences.getBoolean("buttonToggleWii0", true)) if (mPreferences.getInt("wiiController", 3) == 3)
{ {
overlayButtons.add(initializeOverlayButton(getContext(), R.drawable.wiimote_a, ButtonType.WIIMOTE_BUTTON_A)); addNunchukOverlayControls();
}
if (mPreferences.getBoolean("buttonToggleWii1", true))
{
overlayButtons.add(initializeOverlayButton(getContext(), R.drawable.wiimote_b, ButtonType.WIIMOTE_BUTTON_B));
}
if (mPreferences.getBoolean("buttonToggleWii2", true))
{
overlayButtons.add(initializeOverlayButton(getContext(), R.drawable.wiimote_one, ButtonType.WIIMOTE_BUTTON_1));
}
if (mPreferences.getBoolean("buttonToggleWii3", true))
{
overlayButtons.add(initializeOverlayButton(getContext(), R.drawable.wiimote_two, ButtonType.WIIMOTE_BUTTON_2));
}
if (mPreferences.getBoolean("buttonToggleWii4", true))
{
overlayButtons.add(initializeOverlayButton(getContext(), R.drawable.wiimote_plus, ButtonType.WIIMOTE_BUTTON_PLUS));
}
if (mPreferences.getBoolean("buttonToggleWii5", true))
{
overlayButtons.add(initializeOverlayButton(getContext(), R.drawable.wiimote_minus, ButtonType.WIIMOTE_BUTTON_MINUS));
}
if (mPreferences.getBoolean("buttonToggleWii6", true))
{
overlayButtons.add(initializeOverlayButton(getContext(), R.drawable.wiimote_home, ButtonType.WIIMOTE_BUTTON_HOME));
}
if (mPreferences.getBoolean("buttonToggleWii7", true))
{
overlayButtons.add(initializeOverlayButton(getContext(), R.drawable.nunchuk_c, ButtonType.NUNCHUK_BUTTON_C));
}
if (mPreferences.getBoolean("buttonToggleWii8", true))
{
overlayButtons.add(initializeOverlayButton(getContext(), R.drawable.nunchuk_z, ButtonType.NUNCHUK_BUTTON_Z));
}
if (mPreferences.getBoolean("buttonToggleWii9", true))
{
overlayDpads.add(initializeOverlayDpad(getContext(), R.drawable.gcwii_dpad,
ButtonType.WIIMOTE_UP, ButtonType.WIIMOTE_DOWN,
ButtonType.WIIMOTE_LEFT, ButtonType.WIIMOTE_RIGHT));
}
if (mPreferences.getBoolean("buttonToggleWii10", true))
{
overlayJoysticks.add(initializeOverlayJoystick(getContext(),
R.drawable.gcwii_joystick_range, R.drawable.gcwii_joystick,
ButtonType.NUNCHUK_STICK));
} }
} }
@ -506,7 +601,7 @@ public final class InputOverlay extends SurfaceView implements OnTouchListener
case ButtonType.BUTTON_Z: case ButtonType.BUTTON_Z:
case ButtonType.TRIGGER_L: case ButtonType.TRIGGER_L:
case ButtonType.TRIGGER_R: case ButtonType.TRIGGER_R:
scale = 0.22f; scale = 0.225f;
break; break;
case ButtonType.BUTTON_START: case ButtonType.BUTTON_START:
scale = 0.075f; scale = 0.075f;
@ -518,8 +613,17 @@ public final class InputOverlay extends SurfaceView implements OnTouchListener
case ButtonType.WIIMOTE_BUTTON_PLUS: case ButtonType.WIIMOTE_BUTTON_PLUS:
case ButtonType.WIIMOTE_BUTTON_MINUS: case ButtonType.WIIMOTE_BUTTON_MINUS:
case ButtonType.WIIMOTE_BUTTON_HOME: case ButtonType.WIIMOTE_BUTTON_HOME:
case ButtonType.CLASSIC_BUTTON_PLUS:
case ButtonType.CLASSIC_BUTTON_MINUS:
case ButtonType.CLASSIC_BUTTON_HOME:
scale = 0.0625f; scale = 0.0625f;
break; break;
case ButtonType.CLASSIC_TRIGGER_L:
case ButtonType.CLASSIC_TRIGGER_R:
case ButtonType.CLASSIC_BUTTON_ZL:
case ButtonType.CLASSIC_BUTTON_ZR:
scale = 0.25f;
break;
default: default:
scale = 0.125f; scale = 0.125f;
break; break;
@ -583,11 +687,11 @@ public final class InputOverlay extends SurfaceView implements OnTouchListener
case ButtonType.BUTTON_UP: case ButtonType.BUTTON_UP:
scale = 0.2375f; scale = 0.2375f;
break; break;
case ButtonType.WIIMOTE_UP: case ButtonType.CLASSIC_DPAD_UP:
scale = 0.2125f; scale = 0.275f;
break; break;
default: default:
scale = 0.275f; scale = 0.2125f;
break; break;
} }

View File

@ -2,9 +2,6 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
tools:context="org.dolphinemu.dolphinemu.activities.EmulationActivity"> tools:context="org.dolphinemu.dolphinemu.activities.EmulationActivity">
<item <item
android:id="@+id/menu_emulation_screenshot" android:id="@+id/menu_emulation_screenshot"
android:showAsAction="ifRoom" android:showAsAction="ifRoom"

View File

@ -0,0 +1,103 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:context="org.dolphinemu.dolphinemu.activities.EmulationActivity">
<item
android:id="@+id/menu_emulation_screenshot"
android:showAsAction="ifRoom"
android:icon="@drawable/ic_screenshot"
android:title="@string/overlay_screenshot"/>
<item
android:id="@+id/menu_quicksave"
android:showAsAction="ifRoom"
android:icon="@drawable/ic_quicksave"
android:title="@string/emulation_quicksave"
/>
<item
android:id="@+id/menu_quickload"
android:showAsAction="ifRoom"
android:icon="@drawable/ic_quickload"
android:title="@string/emulation_quickload"
/>
<!-- Save State Slots -->
<item
android:id="@+id/menu_emulation_save_root"
android:showAsAction="never"
android:title="@string/overlay_savestate">
<menu>
<item
android:id="@+id/menu_emulation_save_1"
android:title="@string/overlay_slot1"/>
<item
android:id="@+id/menu_emulation_save_2"
android:title="@string/overlay_slot2"/>
<item
android:id="@+id/menu_emulation_save_3"
android:title="@string/overlay_slot3"/>
<item
android:id="@+id/menu_emulation_save_4"
android:title="@string/overlay_slot4"/>
<item
android:id="@+id/menu_emulation_save_5"
android:title="@string/overlay_slot5"/>
</menu>
</item>
<!-- Load State Slots -->
<item
android:id="@+id/menu_emulation_load_root"
android:showAsAction="never"
android:title="@string/overlay_loadstate">
<menu>
<item
android:id="@+id/menu_emulation_load_1"
android:title="@string/overlay_slot1"/>
<item
android:id="@+id/menu_emulation_load_2"
android:title="@string/overlay_slot2"/>
<item
android:id="@+id/menu_emulation_load_3"
android:title="@string/overlay_slot3"/>
<item
android:id="@+id/menu_emulation_load_4"
android:title="@string/overlay_slot4"/>
<item
android:id="@+id/menu_emulation_load_5"
android:title="@string/overlay_slot5"/>
</menu>
</item>
<item
android:id="@+id/menu_emulation_configure_controls"
android:showAsAction="never"
android:title="@string/emulation_configure_controls">
<menu>
<item
android:id="@+id/menu_emulation_edit_layout"
android:title="@string/emulation_edit_layout"/>
<item
android:id="@+id/menu_emulation_toggle_controls"
android:title="@string/emulation_toggle_controls"/>
<item
android:id="@+id/menu_emulation_adjust_scale"
android:title="@string/emulation_control_scale"/>
<item
android:id="@+id/menu_emulation_choose_controller"
android:title="@string/emulation_choose_controller"/>
</menu>
</item>
</menu>

View File

@ -32,7 +32,7 @@
<item>3</item> <item>3</item>
</integer-array> </integer-array>
<!-- Wiimote extensions --> <!-- Wii Remote extensions -->
<string-array name="wiimoteExtEntries" translatable="false"> <string-array name="wiimoteExtEntries" translatable="false">
<item>"None"</item> <item>"None"</item>
<item>"Nunchuk"</item> <item>"Nunchuk"</item>
@ -179,6 +179,32 @@
<item>12</item> <item>12</item>
</integer-array> </integer-array>
<string-array name="wiimoteTypeEntries">
<item>Disabled</item>
<item>Emulated</item>
<item>Real Wii Remote (DolphinBar required)</item>
</string-array>
<integer-array name="wiimoteTypeValues">
<item>0</item>
<item>1</item>
<item>2</item>
</integer-array>
<string-array name="controllersEntries">
<item>GameCube Controller</item>
<item>Wii Remote</item>
<item>Horizontal Wii Remote</item>
<item>Wii Remote + Nunchuk</item>
<item>Classic Controller</item>
</string-array>
<string-array name="controllersValues">
<item>None</item>
<item>None</item>
<item>None</item>
<item>Nunchuk</item>
<item>Classic</item>
</string-array>
<string-array name="gcpadButtons"> <string-array name="gcpadButtons">
<item>A</item> <item>A</item>
<item>B</item> <item>B</item>
@ -193,17 +219,6 @@
<item>C Stick</item> <item>C Stick</item>
</string-array> </string-array>
<string-array name="wiimoteTypeEntries">
<item>Disabled</item>
<item>Emulated</item>
<item>Real Wiimote (DolphinBar required)</item>
</string-array>
<integer-array name="wiimoteTypeValues">
<item>0</item>
<item>1</item>
<item>2</item>
</integer-array>
<string-array name="wiimoteButtons"> <string-array name="wiimoteButtons">
<item>A</item> <item>A</item>
<item>B</item> <item>B</item>
@ -212,10 +227,38 @@
<item>+</item> <item>+</item>
<item>-</item> <item>-</item>
<item>Home</item> <item>Home</item>
<item>D-Pad</item>
</string-array>
<string-array name="nunchukButtons">
<item>A</item>
<item>B</item>
<item>1</item>
<item>2</item>
<item>+</item>
<item>-</item>
<item>Home</item>
<item>D-Pad</item>
<item>C</item> <item>C</item>
<item>Z</item> <item>Z</item>
<item>D-Pad</item>
<item>Nunchuk Stick</item> <item>Nunchuk Stick</item>
</string-array> </string-array>
<string-array name="classicButtons">
<item>a</item>
<item>b</item>
<item>x</item>
<item>y</item>
<item>+</item>
<item>-</item>
<item>Home</item>
<item>L</item>
<item>R</item>
<item>ZL</item>
<item>ZR</item>
<item>D-Pad</item>
<item>Left Stick</item>
<item>Right Stick</item>
</string-array>
</resources> </resources>

View File

@ -364,6 +364,8 @@
<string name="emulation_toggle_controls">Toggle Controls</string> <string name="emulation_toggle_controls">Toggle Controls</string>
<string name="emulation_toggle_all">Toggle All</string> <string name="emulation_toggle_all">Toggle All</string>
<string name="emulation_control_scale">Adjust Scale</string> <string name="emulation_control_scale">Adjust Scale</string>
<string name="emulation_choose_controller">Choose Controller</string>
<string name="emulation_controller_changed">You may have to reload the game after changing extensions.</string>
<!-- GC Adapter Menu--> <!-- GC Adapter Menu-->
<string name="gc_adapter_rumble">Enable Vibration</string> <string name="gc_adapter_rumble">Enable Vibration</string>