Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android: Fix in-game settings changes not getting saved #9454

Merged
merged 1 commit into from Jan 27, 2021

Conversation

JosJuice
Copy link
Member

EmulationActivity has an instance of Settings. If you go to SettingsActivity from EmulationActivity and change some settings, the changes get saved to disk, but EmulationActivity's Settings instance still contains the old settings in its map of all settings (assuming the EmulationActivity was not killed by the system to save memory). Then, once you're done playing your game and exit EmulationActivity, EmulationActivity calls Settings.saveSettings. This call to saveSettings first overwrites the entire INI file with its map of all settings (which is outdated) in order to save any legacy settings that have changed (which they haven't, since the GUI doesn't let you change legacy settings while a game is running). Then, it asks the new config system to write the most up-to-date values available for non-legacy settings, which should make all the settings be up-to-date again. The problem here is that the new config system would skip writing to disk if no settings changes had been made since the last time we asked it to write to disk (i.e. since SettingsActivity exited).

NB: Calling Settings.loadSettings in EmulationActivity.onResume is not a working solution. I assume this is because SettingsActivity saves its settings in onStop and not onPause.

EmulationActivity has an instance of Settings. If you go to
SettingsActivity from EmulationActivity and change some settings,
the changes get saved to disk, but EmulationActivity's Settings
instance still contains the old settings in its map of all
settings (assuming the EmulationActivity was not killed by the
system to save memory). Then, once you're done playing your
game and exit EmulationActivity, EmulationActivity calls
Settings.saveSettings. This call to saveSettings first overwrites
the entire INI file with its map of all settings (which is
outdated) in order to save any legacy settings that have changed
(which they haven't, since the GUI doesn't let you change legacy
settings while a game is running). Then, it asks the new config
system to write the most up-to-date values available for non-legacy
settings, which should make all the settings be up-to-date again.
The problem here is that the new config system would skip writing
to disk if no settings changes had been made since the last time
we asked it to write to disk (i.e. since SettingsActivity exited).

NB: Calling Settings.loadSettings in EmulationActivity.onResume
is not a working solution. I assume this is because
SettingsActivity saves its settings in onStop and not onPause.
@leoetlino leoetlino merged commit 70447d0 into dolphin-emu:master Jan 27, 2021
10 checks passed
@JosJuice JosJuice deleted the android-ingame-settings-save branch January 27, 2021 18:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants