mirror of
https://github.com/rafaelvcaetano/melonDS-android.git
synced 2024-11-23 05:39:41 +00:00
Fix save states not saving or loading properly
This was happening because the emulator was being resumed while the state was being saved/loaded, which corrupted the final emulator state
This commit is contained in:
parent
4b67d6c3be
commit
bebaa6632c
@ -730,14 +730,21 @@ class EmulatorActivity : AppCompatActivity() {
|
||||
var dialog: AlertDialog? = null
|
||||
var adapter: SaveStateListAdapter? = null
|
||||
|
||||
adapter = SaveStateListAdapter(slots, picasso, dateFormatter, timeFormatter, {
|
||||
dialog?.cancel()
|
||||
onSlotPicked(it)
|
||||
}) {
|
||||
viewModel.deleteSaveStateSlot(it)?.let { newSlots ->
|
||||
adapter?.updateSaveStateSlots(newSlots)
|
||||
}
|
||||
}
|
||||
adapter = SaveStateListAdapter(
|
||||
slots = slots,
|
||||
picasso = picasso,
|
||||
dateFormat = dateFormatter,
|
||||
timeFormat = timeFormatter,
|
||||
onSlotSelected = {
|
||||
dialog?.dismiss()
|
||||
onSlotPicked(it)
|
||||
},
|
||||
onDeletedSlot = {
|
||||
viewModel.deleteSaveStateSlot(it)?.let { newSlots ->
|
||||
adapter?.updateSaveStateSlots(newSlots)
|
||||
}
|
||||
},
|
||||
)
|
||||
|
||||
activeOverlays.addActiveOverlay(EmulatorOverlay.SAVE_STATES_DIALOG)
|
||||
dialog = AlertDialog.Builder(this)
|
||||
|
Loading…
Reference in New Issue
Block a user