mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2026-04-25 20:04:56 +02:00
[android, intent] Run restoreContentForGame for shortcut launching + Improve custom settings context for shortcut launching (based on normal launch) (#3854)
intended to fix two bugs identified by Pavel upon android shortcut launching (and prolly all FEs since the rely on intent launching too): 1. external content not loading: fixed by running restoreContentForGame for per game mount in content path. 2. custom settings no loading: that was proven to be user side, but adjustments were made to match normal launch. should be harmless for normal usage. once validated can be merged. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3854 Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Co-authored-by: xbzk <xbzk@eden-emu.dev> Co-committed-by: xbzk <xbzk@eden-emu.dev>
This commit is contained in:
@@ -291,13 +291,23 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback {
|
|||||||
// Game launched via intent (check for existing custom config)
|
// Game launched via intent (check for existing custom config)
|
||||||
intentGame != null -> {
|
intentGame != null -> {
|
||||||
game?.let { gameInstance ->
|
game?.let { gameInstance ->
|
||||||
|
runCatching { GameHelper.restoreContentForGame(gameInstance) }
|
||||||
|
.onFailure {
|
||||||
|
Log.warning(
|
||||||
|
"[EmulationFragment] Failed to restore content for intent launch: ${it.message}"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
val customConfigFile = SettingsFile.getCustomSettingsFile(gameInstance)
|
val customConfigFile = SettingsFile.getCustomSettingsFile(gameInstance)
|
||||||
if (customConfigFile.exists()) {
|
if (customConfigFile.exists()) {
|
||||||
|
shouldUseCustom = true
|
||||||
Log.info(
|
Log.info(
|
||||||
"[EmulationFragment] Found existing custom settings for ${gameInstance.title}, loading them"
|
"[EmulationFragment] Found existing custom settings for ${gameInstance.title}, loading them"
|
||||||
)
|
)
|
||||||
SettingsFile.loadCustomConfig(gameInstance)
|
SettingsFile.loadCustomConfig(gameInstance)
|
||||||
|
NativeConfig.unloadPerGameConfig()
|
||||||
} else {
|
} else {
|
||||||
|
shouldUseCustom = false
|
||||||
Log.info(
|
Log.info(
|
||||||
"[EmulationFragment] No custom settings found for ${gameInstance.title}, using global settings"
|
"[EmulationFragment] No custom settings found for ${gameInstance.title}, using global settings"
|
||||||
)
|
)
|
||||||
@@ -871,7 +881,7 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback {
|
|||||||
if (drawerView == binding.quickSettingsSheet) {
|
if (drawerView == binding.quickSettingsSheet) {
|
||||||
isQuickSettingsMenuOpen = true
|
isQuickSettingsMenuOpen = true
|
||||||
if (shouldUseCustom) {
|
if (shouldUseCustom) {
|
||||||
SettingsFile.loadCustomConfig(args.game!!)
|
SettingsFile.loadCustomConfig(game!!)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user