Skip to content

Commit

Permalink
Android: Add Set as Default ISO to UI
Browse files Browse the repository at this point in the history
  • Loading branch information
Ebola16 committed Jan 5, 2020
1 parent fca5ab5 commit 4ff54a0
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@

import android.widget.Toast;

import org.dolphinemu.dolphinemu.NativeLibrary;
import org.dolphinemu.dolphinemu.R;
import org.dolphinemu.dolphinemu.features.settings.model.Settings;
import org.dolphinemu.dolphinemu.features.settings.ui.MenuTag;
import org.dolphinemu.dolphinemu.features.settings.ui.SettingsActivity;
import org.dolphinemu.dolphinemu.features.settings.utils.SettingsFile;
import org.dolphinemu.dolphinemu.ui.platform.Platform;
import org.dolphinemu.dolphinemu.utils.DirectoryInitialization;

Expand Down Expand Up @@ -61,22 +64,28 @@ public Dialog onCreateDialog(Bundle savedInstanceState)
.getSupportFragmentManager(), "game_details");
break;
case 1:
SettingsActivity.launch(getContext(), MenuTag.CONFIG, gameId);
NativeLibrary.SetConfig(SettingsFile.FILE_NAME_DOLPHIN + ".ini",
Settings.SECTION_INI_CORE, SettingsFile.KEY_DEFAULT_ISO, path);
NativeLibrary.ReloadConfig();
Toast.makeText(getContext(), "Default ISO set", Toast.LENGTH_SHORT).show();
break;
case 2:
SettingsActivity.launch(getContext(), MenuTag.GRAPHICS, gameId);
SettingsActivity.launch(getContext(), MenuTag.CONFIG, gameId);
break;
case 3:
SettingsActivity.launch(getContext(), MenuTag.GCPAD_TYPE, gameId);
SettingsActivity.launch(getContext(), MenuTag.GRAPHICS, gameId);
break;
case 4:
SettingsActivity.launch(getContext(), MenuTag.GCPAD_TYPE, gameId);
break;
case 5:
// Clear option for GC, Wii controls for else
if (platform == Platform.GAMECUBE.toInt())
clearGameSettings(gameId);
else
SettingsActivity.launch(getActivity(), MenuTag.WIIMOTE, gameId);
break;
case 5:
case 6:
clearGameSettings(gameId);
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public final class SettingsFile
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_DEFAULT_ISO = "DefaultISO";

public static final String KEY_ANALYTICS_ENABLED = "Enabled";
public static final String KEY_ANALYTICS_PERMISSION_ASKED = "PermissionAsked";
Expand Down
2 changes: 2 additions & 0 deletions Source/Android/app/src/main/res/values/arrays.xml
Original file line number Diff line number Diff line change
Expand Up @@ -337,13 +337,15 @@

<string-array name="gameSettingsMenusGC">
<item>Details</item>
<item>Set as Default ISO</item>
<item>Core Settings</item>
<item>GFX Settings</item>
<item>GameCube Controller Settings</item>
<item>Clear Game Settings</item>
</string-array>
<string-array name="gameSettingsMenusWii">
<item>Details</item>
<item>Set as Default ISO</item>
<item>Core Settings</item>
<item>GFX Settings</item>
<item>GameCube Controller Settings</item>
Expand Down

0 comments on commit 4ff54a0

Please sign in to comment.