diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/EmulationActivity.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/EmulationActivity.java
index bfb891bc8d..226e022988 100644
--- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/EmulationActivity.java
+++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/EmulationActivity.java
@@ -33,6 +33,9 @@ import com.squareup.picasso.Picasso;
import org.dolphinemu.dolphinemu.NativeLibrary;
import org.dolphinemu.dolphinemu.R;
+import org.dolphinemu.dolphinemu.features.settings.model.BooleanSetting;
+import org.dolphinemu.dolphinemu.features.settings.model.Settings;
+import org.dolphinemu.dolphinemu.features.settings.utils.SettingsFile;
import org.dolphinemu.dolphinemu.fragments.EmulationFragment;
import org.dolphinemu.dolphinemu.fragments.MenuFragment;
import org.dolphinemu.dolphinemu.fragments.SaveLoadStateFragment;
@@ -65,6 +68,8 @@ public final class EmulationActivity extends AppCompatActivity
private SharedPreferences mPreferences;
private ControllerMappingHelper mControllerMappingHelper;
+ private Settings mSettings;
+
// So that MainActivity knows which view to invalidate before the return animation.
private int mPosition;
@@ -212,6 +217,8 @@ public final class EmulationActivity extends AppCompatActivity
mPlatform = gameToEmulate.getIntExtra(EXTRA_PLATFORM, 0);
mScreenPath = gameToEmulate.getStringExtra(EXTRA_SCREEN_PATH);
mPosition = gameToEmulate.getIntExtra(EXTRA_GRID_POSITION, -1);
+ mSettings = new Settings();
+ mSettings.loadSettings(null);
activityRecreated = false;
}
else
@@ -476,6 +483,17 @@ public final class EmulationActivity extends AppCompatActivity
getMenuInflater().inflate(R.menu.menu_emulation_wii, menu);
}
+ BooleanSetting enableSaveStates =
+ (BooleanSetting) mSettings.getSection(Settings.SECTION_INI_CORE)
+ .getSetting(SettingsFile.KEY_ENABLE_SAVE_STATES);
+ if (enableSaveStates != null && enableSaveStates.getValue())
+ {
+ menu.findItem(R.id.menu_quicksave).setVisible(true);
+ menu.findItem(R.id.menu_quickload).setVisible(true);
+ menu.findItem(R.id.menu_emulation_save_root).setVisible(true);
+ menu.findItem(R.id.menu_emulation_load_root).setVisible(true);
+ }
+
// Populate the checkbox value for joystick center on touch
menu.findItem(R.id.menu_emulation_joystick_rel_center)
.setChecked(mPreferences.getBoolean("joystickRelCenter", true));
@@ -929,4 +947,9 @@ public final class EmulationActivity extends AppCompatActivity
{
return activityRecreated;
}
+
+ public Settings getSettings()
+ {
+ return mSettings;
+ }
}
diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsFragmentPresenter.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsFragmentPresenter.java
index 1aaf8eb4a3..b3585f8512 100644
--- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsFragmentPresenter.java
+++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsFragmentPresenter.java
@@ -211,6 +211,7 @@ public final class SettingsFragmentPresenter
Setting speedLimit = null;
Setting audioStretch = null;
Setting analytics = null;
+ Setting enableSaveState;
SettingSection coreSection = mSettings.getSection(Settings.SECTION_INI_CORE);
SettingSection analyticsSection = mSettings.getSection(Settings.SECTION_ANALYTICS);
@@ -221,6 +222,7 @@ public final class SettingsFragmentPresenter
speedLimit = coreSection.getSetting(SettingsFile.KEY_SPEED_LIMIT);
audioStretch = coreSection.getSetting(SettingsFile.KEY_AUDIO_STRETCH);
analytics = analyticsSection.getSetting(SettingsFile.KEY_ANALYTICS_ENABLED);
+ enableSaveState = coreSection.getSetting(SettingsFile.KEY_ENABLE_SAVE_STATES);
// TODO: Having different emuCoresEntries/emuCoresValues for each architecture is annoying.
// The proper solution would be to have one emuCoresEntries and one emuCoresValues
@@ -257,6 +259,9 @@ public final class SettingsFragmentPresenter
R.string.speed_limit, 0, 200, "%", 100, speedLimit));
sl.add(new CheckBoxSetting(SettingsFile.KEY_AUDIO_STRETCH, Settings.SECTION_INI_CORE,
R.string.audio_stretch, R.string.audio_stretch_description, false, audioStretch));
+ sl.add(new CheckBoxSetting(SettingsFile.KEY_ENABLE_SAVE_STATES, Settings.SECTION_INI_CORE,
+ R.string.enable_save_states, R.string.enable_save_states_description, false,
+ enableSaveState));
sl.add(new CheckBoxSetting(SettingsFile.KEY_ANALYTICS_ENABLED, Settings.SECTION_ANALYTICS,
R.string.analytics, 0, false, analytics));
}
diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/utils/SettingsFile.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/utils/SettingsFile.java
index e86b68af69..1d74e68ab7 100644
--- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/utils/SettingsFile.java
+++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/utils/SettingsFile.java
@@ -49,6 +49,7 @@ public final class SettingsFile
public static final String KEY_OVERRIDE_GAME_CUBE_LANGUAGE = "OverrideGCLang";
public static final String KEY_SLOT_A_DEVICE = "SlotA";
public static final String KEY_SLOT_B_DEVICE = "SlotB";
+ public static final String KEY_ENABLE_SAVE_STATES = "EnableSaveStates";
public static final String KEY_ANALYTICS_ENABLED = "Enabled";
public static final String KEY_ANALYTICS_PERMISSION_ASKED = "PermissionAsked";
diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/MenuFragment.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/MenuFragment.java
index fab99e6e70..7296946346 100644
--- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/MenuFragment.java
+++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/MenuFragment.java
@@ -13,6 +13,9 @@ import android.widget.TextView;
import org.dolphinemu.dolphinemu.R;
import org.dolphinemu.dolphinemu.activities.EmulationActivity;
+import org.dolphinemu.dolphinemu.features.settings.model.BooleanSetting;
+import org.dolphinemu.dolphinemu.features.settings.model.Settings;
+import org.dolphinemu.dolphinemu.features.settings.utils.SettingsFile;
public final class MenuFragment extends Fragment implements View.OnClickListener
{
@@ -53,6 +56,20 @@ public final class MenuFragment extends Fragment implements View.OnClickListener
View rootView = inflater.inflate(R.layout.fragment_ingame_menu, container, false);
LinearLayout options = (LinearLayout) rootView.findViewById(R.id.layout_options);
+
+ BooleanSetting enableSaveStates =
+ (BooleanSetting) ((EmulationActivity) getActivity()).getSettings()
+ .getSection(Settings.SECTION_INI_CORE)
+ .getSetting(SettingsFile.KEY_ENABLE_SAVE_STATES);
+
+ if (enableSaveStates != null && enableSaveStates.getValue())
+ {
+ options.findViewById(R.id.menu_quicksave).setVisibility(View.VISIBLE);
+ options.findViewById(R.id.menu_quickload).setVisibility(View.VISIBLE);
+ options.findViewById(R.id.menu_emulation_save_root).setVisibility(View.VISIBLE);
+ options.findViewById(R.id.menu_emulation_load_root).setVisibility(View.VISIBLE);
+ }
+
for (int childIndex = 0; childIndex < options.getChildCount(); childIndex++)
{
Button button = (Button) options.getChildAt(childIndex);
diff --git a/Source/Android/app/src/main/res/layout/fragment_ingame_menu.xml b/Source/Android/app/src/main/res/layout/fragment_ingame_menu.xml
index 8415a2045b..450ab32272 100644
--- a/Source/Android/app/src/main/res/layout/fragment_ingame_menu.xml
+++ b/Source/Android/app/src/main/res/layout/fragment_ingame_menu.xml
@@ -35,22 +35,26 @@
+ style="@style/InGameMenuOption"
+ android:visibility="gone"/>
+ style="@style/InGameMenuOption"
+ android:visibility="gone"/>
+ style="@style/InGameMenuOption"
+ android:visibility="gone"/>
+ style="@style/InGameMenuOption"
+ android:visibility="gone"/>
+ android:title="@string/emulation_quicksave"
+ android:visible="false"/>
+ android:title="@string/emulation_quickload"
+ android:visible="false"/>
-
+ android:title="@string/emulation_savestate"
+ android:visible="false">