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 dialog: AlertDialog? = null
|
||||||
var adapter: SaveStateListAdapter? = null
|
var adapter: SaveStateListAdapter? = null
|
||||||
|
|
||||||
adapter = SaveStateListAdapter(slots, picasso, dateFormatter, timeFormatter, {
|
adapter = SaveStateListAdapter(
|
||||||
dialog?.cancel()
|
slots = slots,
|
||||||
onSlotPicked(it)
|
picasso = picasso,
|
||||||
}) {
|
dateFormat = dateFormatter,
|
||||||
viewModel.deleteSaveStateSlot(it)?.let { newSlots ->
|
timeFormat = timeFormatter,
|
||||||
adapter?.updateSaveStateSlots(newSlots)
|
onSlotSelected = {
|
||||||
}
|
dialog?.dismiss()
|
||||||
}
|
onSlotPicked(it)
|
||||||
|
},
|
||||||
|
onDeletedSlot = {
|
||||||
|
viewModel.deleteSaveStateSlot(it)?.let { newSlots ->
|
||||||
|
adapter?.updateSaveStateSlots(newSlots)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
activeOverlays.addActiveOverlay(EmulatorOverlay.SAVE_STATES_DIALOG)
|
activeOverlays.addActiveOverlay(EmulatorOverlay.SAVE_STATES_DIALOG)
|
||||||
dialog = AlertDialog.Builder(this)
|
dialog = AlertDialog.Builder(this)
|
||||||
|
Loading…
Reference in New Issue
Block a user