From 606e6ca3bab05bd5bef72a6ab9f1b2bd88d44941 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Thu, 11 Feb 2021 22:32:20 +0100 Subject: [PATCH 1/2] Android: Adjust logic for DOL/ELF long press Android follow-up for 83c1277. Removes some now unnecessary code and disables "Set as Default ISO" for DOL, ELF and WAD files. --- .../dolphinemu/adapters/GameAdapter.java | 10 -------- .../dialogs/GamePropertiesDialog.java | 23 ++++++++++++------- 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/adapters/GameAdapter.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/adapters/GameAdapter.java index f83aaeb575..66ddd567fc 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/adapters/GameAdapter.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/adapters/GameAdapter.java @@ -155,16 +155,6 @@ public final class GameAdapter extends RecyclerView.Adapter impl GameViewHolder holder = (GameViewHolder) view.getTag(); String gameId = holder.gameFile.getGameId(); - if (gameId.isEmpty()) - { - AlertDialog.Builder builder = new AlertDialog.Builder(activity, R.style.DolphinDialogBase); - builder.setTitle("Game Settings"); - builder.setMessage("Files without game IDs don't support game-specific settings."); - - builder.show(); - return true; - } - GamePropertiesDialog fragment = GamePropertiesDialog.newInstance(holder.gameFile); ((FragmentActivity) view.getContext()).getSupportFragmentManager().beginTransaction() .add(fragment, GamePropertiesDialog.TAG).commit(); diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/dialogs/GamePropertiesDialog.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/dialogs/GamePropertiesDialog.java index 8ac4990421..8ef63c3d6a 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/dialogs/GamePropertiesDialog.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/dialogs/GamePropertiesDialog.java @@ -53,10 +53,14 @@ public class GamePropertiesDialog extends DialogFragment final String path = requireArguments().getString(ARG_PATH); final String gameId = requireArguments().getString(ARG_GAMEID); final int revision = requireArguments().getInt(ARG_REVISION); - final boolean isWii = requireArguments().getInt(ARG_PLATFORM) != Platform.GAMECUBE.toInt(); + final int platform = requireArguments().getInt(ARG_PLATFORM); final boolean shouldAllowConversion = requireArguments().getBoolean(ARG_SHOULD_ALLOW_CONVERSION); + final boolean isDisc = platform == Platform.GAMECUBE.toInt() || + platform == Platform.WII.toInt(); + final boolean isWii = platform != Platform.GAMECUBE.toInt(); + AlertDialogItemsBuilder itemsBuilder = new AlertDialogItemsBuilder(requireContext()); itemsBuilder.add(R.string.properties_details, (dialog, i) -> @@ -69,15 +73,18 @@ public class GamePropertiesDialog extends DialogFragment ConvertActivity.launch(getContext(), path)); } - itemsBuilder.add(R.string.properties_set_default_iso, (dialog, i) -> + if (isDisc) { - try (Settings settings = new Settings()) + itemsBuilder.add(R.string.properties_set_default_iso, (dialog, i) -> { - settings.loadSettings(); - StringSetting.MAIN_DEFAULT_ISO.setString(settings, path); - settings.saveSettings(null, getContext()); - } - }); + try (Settings settings = new Settings()) + { + settings.loadSettings(); + StringSetting.MAIN_DEFAULT_ISO.setString(settings, path); + settings.saveSettings(null, getContext()); + } + }); + } itemsBuilder.add(R.string.properties_edit_game_settings, (dialog, i) -> SettingsActivity.launch(getContext(), MenuTag.SETTINGS, gameId, revision, isWii)); From 296efad2e39599649b080b0cc2a700253ae20fb1 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Thu, 11 Feb 2021 22:35:18 +0100 Subject: [PATCH 2/2] Android: Add missing "World" entry in country list Fixes an IndexOutOfBoundsException. (Yeah, attempts at having cross-language enums are kinda fragile...) --- Source/Android/app/src/main/res/values/arrays.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/Android/app/src/main/res/values/arrays.xml b/Source/Android/app/src/main/res/values/arrays.xml index 0f86b9ba6d..c08a518e5f 100644 --- a/Source/Android/app/src/main/res/values/arrays.xml +++ b/Source/Android/app/src/main/res/values/arrays.xml @@ -322,6 +322,7 @@ Russia Spain Taiwan + World Unknown