Android: Add Quicksave/Load functionality, and cleanup in-game menu.
|
@ -1,8 +1,6 @@
|
||||||
package org.dolphinemu.dolphinemu.activities;
|
package org.dolphinemu.dolphinemu.activities;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.AlertDialog;
|
|
||||||
import android.content.DialogInterface;
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
|
@ -167,7 +165,7 @@ public final class EmulationActivity extends Activity
|
||||||
switch (item.getItemId())
|
switch (item.getItemId())
|
||||||
{
|
{
|
||||||
// Enable/Disable input overlay.
|
// Enable/Disable input overlay.
|
||||||
case R.id.enableInputOverlay:
|
case R.id.menu_emulation_input_overlay:
|
||||||
{
|
{
|
||||||
EmulationFragment emulationFragment = (EmulationFragment) getFragmentManager()
|
EmulationFragment emulationFragment = (EmulationFragment) getFragmentManager()
|
||||||
.findFragmentByTag(EmulationFragment.FRAGMENT_TAG);
|
.findFragmentByTag(EmulationFragment.FRAGMENT_TAG);
|
||||||
|
@ -178,70 +176,61 @@ public final class EmulationActivity extends Activity
|
||||||
}
|
}
|
||||||
|
|
||||||
// Screenshot capturing
|
// Screenshot capturing
|
||||||
case R.id.takeScreenshot:
|
case R.id.menu_emulation_screenshot:
|
||||||
NativeLibrary.SaveScreenShot();
|
NativeLibrary.SaveScreenShot();
|
||||||
return true;
|
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
|
// Save state slots
|
||||||
case R.id.saveSlot1:
|
case R.id.menu_emulation_save_1:
|
||||||
NativeLibrary.SaveState(0);
|
NativeLibrary.SaveState(0);
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case R.id.saveSlot2:
|
case R.id.menu_emulation_save_2:
|
||||||
NativeLibrary.SaveState(1);
|
NativeLibrary.SaveState(1);
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case R.id.saveSlot3:
|
case R.id.menu_emulation_save_3:
|
||||||
NativeLibrary.SaveState(2);
|
NativeLibrary.SaveState(2);
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case R.id.saveSlot4:
|
case R.id.menu_emulation_save_4:
|
||||||
NativeLibrary.SaveState(3);
|
NativeLibrary.SaveState(3);
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case R.id.saveSlot5:
|
case R.id.menu_emulation_save_5:
|
||||||
NativeLibrary.SaveState(4);
|
NativeLibrary.SaveState(4);
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// Load state slots
|
// Load state slots
|
||||||
case R.id.loadSlot1:
|
case R.id.menu_emulation_load_1:
|
||||||
NativeLibrary.LoadState(0);
|
NativeLibrary.LoadState(0);
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case R.id.loadSlot2:
|
case R.id.menu_emulation_load_2:
|
||||||
NativeLibrary.LoadState(1);
|
NativeLibrary.LoadState(1);
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case R.id.loadSlot3:
|
case R.id.menu_emulation_load_3:
|
||||||
NativeLibrary.LoadState(2);
|
NativeLibrary.LoadState(2);
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case R.id.loadSlot4:
|
case R.id.menu_emulation_load_4:
|
||||||
NativeLibrary.LoadState(3);
|
NativeLibrary.LoadState(3);
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case R.id.loadSlot5:
|
case R.id.menu_emulation_load_5:
|
||||||
NativeLibrary.LoadState(4);
|
NativeLibrary.LoadState(4);
|
||||||
return true;
|
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:
|
default:
|
||||||
return super.onOptionsItemSelected(item);
|
return super.onOptionsItemSelected(item);
|
||||||
}
|
}
|
||||||
|
|
After Width: | Height: | Size: 531 B |
After Width: | Height: | Size: 341 B |
After Width: | Height: | Size: 457 B |
After Width: | Height: | Size: 346 B |
After Width: | Height: | Size: 257 B |
After Width: | Height: | Size: 326 B |
After Width: | Height: | Size: 637 B |
After Width: | Height: | Size: 359 B |
After Width: | Height: | Size: 534 B |
After Width: | Height: | Size: 875 B |
After Width: | Height: | Size: 489 B |
After Width: | Height: | Size: 781 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 747 B |
After Width: | Height: | Size: 1023 B |
|
@ -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>
|
|
|
@ -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>
|
|
|
@ -3,75 +3,87 @@
|
||||||
tools:context="org.dolphinemu.dolphinemu.activities.EmulationActivity">
|
tools:context="org.dolphinemu.dolphinemu.activities.EmulationActivity">
|
||||||
|
|
||||||
|
|
||||||
<!-- Enable/Disabe Input Overlay -->
|
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/enableInputOverlay"
|
android:id="@+id/menu_emulation_screenshot"
|
||||||
android:showAsAction="ifRoom"
|
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"/>
|
android:title="@string/emulation_toggle_input"/>
|
||||||
|
|
||||||
<!-- Save State Slots -->
|
<!-- Save State Slots -->
|
||||||
<item
|
<item
|
||||||
android:id="@+id/takeScreenshot"
|
android:id="@+id/menu_emulation_save_root"
|
||||||
android:showAsAction="ifRoom"
|
|
||||||
android:title="@string/overlay_screenshot"/>
|
|
||||||
<item
|
|
||||||
android:id="@+id/saveStateRoot"
|
|
||||||
android:showAsAction="never"
|
android:showAsAction="never"
|
||||||
android:title="@string/overlay_savestate">
|
android:title="@string/overlay_savestate">
|
||||||
<menu>
|
<menu>
|
||||||
<item
|
<item
|
||||||
android:id="@+id/saveSlot1"
|
android:id="@+id/menu_emulation_save_1"
|
||||||
android:title="@string/overlay_slot1"/>
|
android:title="@string/overlay_slot1"/>
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/saveSlot2"
|
android:id="@+id/menu_emulation_save_2"
|
||||||
android:title="@string/overlay_slot2"/>
|
android:title="@string/overlay_slot2"/>
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/saveSlot3"
|
android:id="@+id/menu_emulation_save_3"
|
||||||
android:title="@string/overlay_slot3"/>
|
android:title="@string/overlay_slot3"/>
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/saveSlot4"
|
android:id="@+id/menu_emulation_save_4"
|
||||||
android:title="@string/overlay_slot4"/>
|
android:title="@string/overlay_slot4"/>
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/saveSlot5"
|
android:id="@+id/menu_emulation_save_5"
|
||||||
android:title="@string/overlay_slot5"/>
|
android:title="@string/overlay_slot5"/>
|
||||||
</menu>
|
</menu>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
<!-- Load State Slots -->
|
<!-- Load State Slots -->
|
||||||
<item
|
<item
|
||||||
android:id="@+id/loadStateRoot"
|
android:id="@+id/menu_emulation_load_root"
|
||||||
android:showAsAction="never"
|
android:showAsAction="never"
|
||||||
android:title="@string/overlay_loadstate">
|
android:title="@string/overlay_loadstate">
|
||||||
<menu>
|
<menu>
|
||||||
<item
|
<item
|
||||||
android:id="@+id/loadSlot1"
|
android:id="@+id/menu_emulation_load_1"
|
||||||
android:title="@string/overlay_slot1"/>
|
android:title="@string/overlay_slot1"/>
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/loadSlot2"
|
android:id="@+id/menu_emulation_load_2"
|
||||||
android:title="@string/overlay_slot2"/>
|
android:title="@string/overlay_slot2"/>
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/loadSlot3"
|
android:id="@+id/menu_emulation_load_3"
|
||||||
android:title="@string/overlay_slot3"/>
|
android:title="@string/overlay_slot3"/>
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/loadSlot4"
|
android:id="@+id/menu_emulation_load_4"
|
||||||
android:title="@string/overlay_slot4"/>
|
android:title="@string/overlay_slot4"/>
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/loadSlot5"
|
android:id="@+id/menu_emulation_load_5"
|
||||||
android:title="@string/overlay_slot5"/>
|
android:title="@string/overlay_slot5"/>
|
||||||
</menu>
|
</menu>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
<item
|
|
||||||
android:id="@+id/exitEmulation"
|
|
||||||
android:showAsAction="ifRoom"
|
|
||||||
android:title="@string/overlay_exit_emulation">
|
|
||||||
</item>
|
|
||||||
</menu>
|
</menu>
|
||||||
|
|
|
@ -239,7 +239,10 @@
|
||||||
<string name="preferences_video">Video Settings</string>
|
<string name="preferences_video">Video Settings</string>
|
||||||
<string name="emulation_title">Emulation Activity</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-->
|
<!-- Package Names-->
|
||||||
<string name="application_id">org.dolphinemu.dolphinemu</string>
|
<string name="application_id">org.dolphinemu.dolphinemu</string>
|
||||||
|
|