Merge pull request #2633 from sigmabeta/android-emulation-menu

Android: Add Quicksave/Load functionality, and cleanup in-game menu.
This commit is contained in:
Ryan Houdek 2015-06-23 20:47:10 -05:00
commit 52aa9c05bd
20 changed files with 61 additions and 128 deletions

View File

@ -1,8 +1,6 @@
package org.dolphinemu.dolphinemu.activities;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
@ -167,7 +165,7 @@ public final class EmulationActivity extends Activity
switch (item.getItemId())
{
// Enable/Disable input overlay.
case R.id.enableInputOverlay:
case R.id.menu_emulation_input_overlay:
{
EmulationFragment emulationFragment = (EmulationFragment) getFragmentManager()
.findFragmentByTag(EmulationFragment.FRAGMENT_TAG);
@ -178,70 +176,61 @@ public final class EmulationActivity extends Activity
}
// Screenshot capturing
case R.id.takeScreenshot:
case R.id.menu_emulation_screenshot:
NativeLibrary.SaveScreenShot();
return true;
// Quicksave / Load
case R.id.menu_quicksave:
NativeLibrary.SaveState(9);
return true;
case R.id.menu_quickload:
NativeLibrary.LoadState(9);
return true;
// Save state slots
case R.id.saveSlot1:
case R.id.menu_emulation_save_1:
NativeLibrary.SaveState(0);
return true;
case R.id.saveSlot2:
case R.id.menu_emulation_save_2:
NativeLibrary.SaveState(1);
return true;
case R.id.saveSlot3:
case R.id.menu_emulation_save_3:
NativeLibrary.SaveState(2);
return true;
case R.id.saveSlot4:
case R.id.menu_emulation_save_4:
NativeLibrary.SaveState(3);
return true;
case R.id.saveSlot5:
case R.id.menu_emulation_save_5:
NativeLibrary.SaveState(4);
return true;
// Load state slots
case R.id.loadSlot1:
case R.id.menu_emulation_load_1:
NativeLibrary.LoadState(0);
return true;
case R.id.loadSlot2:
case R.id.menu_emulation_load_2:
NativeLibrary.LoadState(1);
return true;
case R.id.loadSlot3:
case R.id.menu_emulation_load_3:
NativeLibrary.LoadState(2);
return true;
case R.id.loadSlot4:
case R.id.menu_emulation_load_4:
NativeLibrary.LoadState(3);
return true;
case R.id.loadSlot5:
case R.id.menu_emulation_load_5:
NativeLibrary.LoadState(4);
return true;
case R.id.exitEmulation:
{
// Create a confirmation method for quitting the current emulation instance.
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle(R.string.overlay_exit_emulation);
builder.setMessage(R.string.overlay_exit_emulation_confirm);
builder.setNegativeButton(R.string.no, null);
builder.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener()
{
public void onClick(DialogInterface dialog, int which)
{
onDestroy();
}
});
builder.show();
return true;
}
default:
return super.onOptionsItemSelected(item);
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 531 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 341 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 457 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 346 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 257 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 637 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 359 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 534 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 875 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 489 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 781 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 747 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1023 B

View File

@ -1,64 +0,0 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Enable/Disabe Input Overlay -->
<item
android:id="@+id/enableInputOverlay"
android:showAsAction="ifRoom"
android:title="@string/disable_input_overlay"/>
<!-- Save State Slots -->
<item
android:id="@+id/takeScreenshot"
android:showAsAction="ifRoom"
android:title="@string/overlay_screenshot"/>
<item
android:id="@+id/saveStateRoot"
android:showAsAction="never"
android:title="@string/overlay_savestate">
<menu>
<item android:id="@+id/saveSlot1"
android:title="@string/overlay_slot1"/>
<item android:id="@+id/saveSlot2"
android:title="@string/overlay_slot2"/>
<item android:id="@+id/saveSlot3"
android:title="@string/overlay_slot3"/>
<item android:id="@+id/saveSlot4"
android:title="@string/overlay_slot4"/>
<item android:id="@+id/saveSlot5"
android:title="@string/overlay_slot5"/>
</menu>
</item>
<!-- Load State Slots -->
<item
android:id="@+id/loadStateRoot"
android:showAsAction="never"
android:title="@string/overlay_loadstate">
<menu>
<item android:id="@+id/loadSlot1"
android:title="@string/overlay_slot1"/>
<item android:id="@+id/loadSlot2"
android:title="@string/overlay_slot2"/>
<item android:id="@+id/loadSlot3"
android:title="@string/overlay_slot3"/>
<item android:id="@+id/loadSlot4"
android:title="@string/overlay_slot4"/>
<item android:id="@+id/loadSlot5"
android:title="@string/overlay_slot5"/>
</menu>
</item>
<item
android:id="@+id/exitEmulation"
android:showAsAction="ifRoom"
android:title="@string/overlay_exit_emulation">
</item>
</menu>

View File

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:id="@+id/clearGameList"
android:title="@string/clear_game_list"
android:showAsAction="ifRoom|withText" />
</menu>

View File

@ -3,75 +3,87 @@
tools:context="org.dolphinemu.dolphinemu.activities.EmulationActivity">
<!-- Enable/Disabe Input Overlay -->
<item
android:id="@+id/enableInputOverlay"
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"
/>
<!-- Enable/Disable Input Overlay -->
<item
android:id="@+id/menu_emulation_input_overlay"
android:showAsAction="never"
android:title="@string/emulation_toggle_input"/>
<!-- Save State Slots -->
<item
android:id="@+id/takeScreenshot"
android:showAsAction="ifRoom"
android:title="@string/overlay_screenshot"/>
<item
android:id="@+id/saveStateRoot"
android:id="@+id/menu_emulation_save_root"
android:showAsAction="never"
android:title="@string/overlay_savestate">
<menu>
<item
android:id="@+id/saveSlot1"
android:id="@+id/menu_emulation_save_1"
android:title="@string/overlay_slot1"/>
<item
android:id="@+id/saveSlot2"
android:id="@+id/menu_emulation_save_2"
android:title="@string/overlay_slot2"/>
<item
android:id="@+id/saveSlot3"
android:id="@+id/menu_emulation_save_3"
android:title="@string/overlay_slot3"/>
<item
android:id="@+id/saveSlot4"
android:id="@+id/menu_emulation_save_4"
android:title="@string/overlay_slot4"/>
<item
android:id="@+id/saveSlot5"
android:id="@+id/menu_emulation_save_5"
android:title="@string/overlay_slot5"/>
</menu>
</item>
<!-- Load State Slots -->
<item
android:id="@+id/loadStateRoot"
android:id="@+id/menu_emulation_load_root"
android:showAsAction="never"
android:title="@string/overlay_loadstate">
<menu>
<item
android:id="@+id/loadSlot1"
android:id="@+id/menu_emulation_load_1"
android:title="@string/overlay_slot1"/>
<item
android:id="@+id/loadSlot2"
android:id="@+id/menu_emulation_load_2"
android:title="@string/overlay_slot2"/>
<item
android:id="@+id/loadSlot3"
android:id="@+id/menu_emulation_load_3"
android:title="@string/overlay_slot3"/>
<item
android:id="@+id/loadSlot4"
android:id="@+id/menu_emulation_load_4"
android:title="@string/overlay_slot4"/>
<item
android:id="@+id/loadSlot5"
android:id="@+id/menu_emulation_load_5"
android:title="@string/overlay_slot5"/>
</menu>
</item>
<item
android:id="@+id/exitEmulation"
android:showAsAction="ifRoom"
android:title="@string/overlay_exit_emulation">
</item>
</menu>

View File

@ -239,7 +239,10 @@
<string name="preferences_video">Video Settings</string>
<string name="emulation_title">Emulation Activity</string>
<string name="emulation_toggle_input">Toggle Input Overlay</string>
<!-- Emulation Menu -->
<string name="emulation_toggle_input">Toggle Touch Controls</string>
<string name="emulation_quicksave">Quick Save</string>
<string name="emulation_quickload">Quick Load</string>
<!-- Package Names-->
<string name="application_id">org.dolphinemu.dolphinemu</string>