Merge pull request #9502 from JosJuice/android-dol-elf-details
Android: Adjust logic for DOL/ELF long press
This commit is contained in:
commit
a2fa89b15e
|
@ -155,16 +155,6 @@ public final class GameAdapter extends RecyclerView.Adapter<GameViewHolder> impl
|
||||||
GameViewHolder holder = (GameViewHolder) view.getTag();
|
GameViewHolder holder = (GameViewHolder) view.getTag();
|
||||||
String gameId = holder.gameFile.getGameId();
|
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);
|
GamePropertiesDialog fragment = GamePropertiesDialog.newInstance(holder.gameFile);
|
||||||
((FragmentActivity) view.getContext()).getSupportFragmentManager().beginTransaction()
|
((FragmentActivity) view.getContext()).getSupportFragmentManager().beginTransaction()
|
||||||
.add(fragment, GamePropertiesDialog.TAG).commit();
|
.add(fragment, GamePropertiesDialog.TAG).commit();
|
||||||
|
|
|
@ -53,10 +53,14 @@ public class GamePropertiesDialog extends DialogFragment
|
||||||
final String path = requireArguments().getString(ARG_PATH);
|
final String path = requireArguments().getString(ARG_PATH);
|
||||||
final String gameId = requireArguments().getString(ARG_GAMEID);
|
final String gameId = requireArguments().getString(ARG_GAMEID);
|
||||||
final int revision = requireArguments().getInt(ARG_REVISION);
|
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 =
|
final boolean shouldAllowConversion =
|
||||||
requireArguments().getBoolean(ARG_SHOULD_ALLOW_CONVERSION);
|
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());
|
AlertDialogItemsBuilder itemsBuilder = new AlertDialogItemsBuilder(requireContext());
|
||||||
|
|
||||||
itemsBuilder.add(R.string.properties_details, (dialog, i) ->
|
itemsBuilder.add(R.string.properties_details, (dialog, i) ->
|
||||||
|
@ -69,15 +73,18 @@ public class GamePropertiesDialog extends DialogFragment
|
||||||
ConvertActivity.launch(getContext(), path));
|
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();
|
try (Settings settings = new Settings())
|
||||||
StringSetting.MAIN_DEFAULT_ISO.setString(settings, path);
|
{
|
||||||
settings.saveSettings(null, getContext());
|
settings.loadSettings();
|
||||||
}
|
StringSetting.MAIN_DEFAULT_ISO.setString(settings, path);
|
||||||
});
|
settings.saveSettings(null, getContext());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
itemsBuilder.add(R.string.properties_edit_game_settings, (dialog, i) ->
|
itemsBuilder.add(R.string.properties_edit_game_settings, (dialog, i) ->
|
||||||
SettingsActivity.launch(getContext(), MenuTag.SETTINGS, gameId, revision, isWii));
|
SettingsActivity.launch(getContext(), MenuTag.SETTINGS, gameId, revision, isWii));
|
||||||
|
|
|
@ -322,6 +322,7 @@
|
||||||
<item>Russia</item>
|
<item>Russia</item>
|
||||||
<item>Spain</item>
|
<item>Spain</item>
|
||||||
<item>Taiwan</item>
|
<item>Taiwan</item>
|
||||||
|
<item>World</item>
|
||||||
<item>Unknown</item>
|
<item>Unknown</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue