Add savefile/save state dir settings.

This commit is contained in:
Themaister 2013-01-05 23:39:44 +01:00
parent 5b58df5da0
commit 634132033b
5 changed files with 56 additions and 0 deletions

View File

@ -28,6 +28,8 @@
<activity android:name="org.retroarch.browser.Shader2Activity"></activity>
<activity android:name="org.retroarch.browser.OverlayActivity"></activity>
<activity android:name="org.retroarch.browser.ROMDirActivity"></activity>
<activity android:name="org.retroarch.browser.SRMDirActivity"></activity>
<activity android:name="org.retroarch.browser.StateDirActivity"></activity>
<activity android:name="android.app.NativeActivity" android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale">
<meta-data android:name="android.app.lib_name" android:value="retroarch-activity" />

View File

@ -11,6 +11,31 @@
android:targetPackage="org.retroarch" />
</Preference>
</PreferenceCategory>
<PreferenceCategory android:title="Save files">
<CheckBoxPreference android:title="Enable custom directory"
android:summary="Enables use of custom save file folder. (.srm) save files will be saved and loaded to configured directory. If not enabled, save files will reside in ROM folder."
android:key="savefile_directory_enable"
android:defaultValue="false"/>
<Preference android:title="Savefile directory"
android:summary="Sets directory where to save and load game save files.">
<intent
android:targetClass="org.retroarch.browser.SRMDirActivity"
android:targetPackage="org.retroarch" />
</Preference>
</PreferenceCategory>
<PreferenceCategory android:title="Save states">
<CheckBoxPreference android:title="Enable custom directory"
android:summary="Enables use of custom save state folder. (.state) save states will be saved and loaded to configured directory. If not enabled, save states will reside in ROM folder."
android:key="savestate_directory_enable"
android:defaultValue="false"/>
<Preference android:title="Save state directory"
android:summary="Sets directory where to save and load game save states.">
<intent
android:targetClass="org.retroarch.browser.StateDirActivity"
android:targetPackage="org.retroarch" />
</Preference>
</PreferenceCategory>
</PreferenceScreen>
<PreferenceScreen android:title="System Settings" >
<PreferenceCategory android:title="General" >

View File

@ -255,6 +255,11 @@ public class RetroArch extends Activity implements
} else {
config.setString("input_overlay", "");
}
config.setString("savefile_directory", prefs.getBoolean("savefile_directory_enable", false) ?
prefs.getString("savefile_directory", "") : "");
config.setString("savestate_directory", prefs.getBoolean("savestate_directory_enable", false) ?
prefs.getString("savestate_directory", "") : "");
String confPath = getDefaultConfigPath();
try {

View File

@ -0,0 +1,12 @@
package org.retroarch.browser;
import android.os.Bundle;
public class SRMDirActivity extends DirectoryActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.setPathSettingKey("savefile_directory");
super.setIsDirectoryTarget(true);
super.onCreate(savedInstanceState);
}
}

View File

@ -0,0 +1,12 @@
package org.retroarch.browser;
import android.os.Bundle;
public class StateDirActivity extends DirectoryActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.setPathSettingKey("savestate_directory");
super.setIsDirectoryTarget(true);
super.onCreate(savedInstanceState);
}
}