mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-09-08 06:30:44 +02:00
Ask for confirmation before reset
This commit is contained in:
@@ -978,10 +978,23 @@ static void rumbleCallback(GB_gameboy_t *gb, double amp)
|
|||||||
|
|
||||||
- (void)reset
|
- (void)reset
|
||||||
{
|
{
|
||||||
[self stop];
|
UIAlertControllerStyle style = [UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad?
|
||||||
_skipAutoLoad = true;
|
UIAlertControllerStyleAlert : UIAlertControllerStyleActionSheet;
|
||||||
GB_reset(&_gb);
|
UIAlertController *menu = [UIAlertController alertControllerWithTitle:@"Reset Emulation?"
|
||||||
[self start];
|
message:@"Unsaved progress will be lost."
|
||||||
|
preferredStyle:style];
|
||||||
|
[menu addAction:[UIAlertAction actionWithTitle:@"Reset"
|
||||||
|
style:UIAlertActionStyleDestructive
|
||||||
|
handler:^(UIAlertAction *action) {
|
||||||
|
[self stop];
|
||||||
|
_skipAutoLoad = true;
|
||||||
|
GB_reset(&_gb);
|
||||||
|
[self start];
|
||||||
|
}]];
|
||||||
|
[menu addAction:[UIAlertAction actionWithTitle:@"Cancel"
|
||||||
|
style:UIAlertActionStyleCancel
|
||||||
|
handler:nil]];
|
||||||
|
[self presentViewController:menu animated:true completion:nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)openLibrary
|
- (void)openLibrary
|
||||||
|
Reference in New Issue
Block a user