project_files/HedgewarsMobile/Classes/RestoreViewController.m
changeset 6000 dbcebcd3d79f
parent 5699 1a9a6a7662aa
child 6008 215f0c9719e3
equal deleted inserted replaced
5998:e8f44e9433f0 6000:dbcebcd3d79f
    34 -(IBAction) buttonReleased:(id) sender {
    34 -(IBAction) buttonReleased:(id) sender {
    35     UIButton *theButton = (UIButton *)sender;
    35     UIButton *theButton = (UIButton *)sender;
    36     NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
    36     NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
    37 
    37 
    38     if (theButton.tag != 0) {
    38     if (theButton.tag != 0) {
    39         playSound(@"clickSound");
    39         [AudioManagerController playClickSound];
    40         if (self.interfaceBridge == nil) {
    40         if (self.interfaceBridge == nil) {
    41             GameInterfaceBridge *bridge = [[GameInterfaceBridge alloc] initWithController:self.parentViewController];
    41             GameInterfaceBridge *bridge = [[GameInterfaceBridge alloc] initWithController:self.parentViewController];
    42             self.interfaceBridge = bridge;
    42             self.interfaceBridge = bridge;
    43             [bridge release];
    43             [bridge release];
    44         }
    44         }
    45         [self.parentViewController dismissModalViewControllerAnimated:NO];
    45         [self.parentViewController dismissModalViewControllerAnimated:NO];
    46         [self.interfaceBridge startSaveGame:[defaults objectForKey:@"savedGamePath"]];
    46         [self.interfaceBridge startSaveGame:[defaults objectForKey:@"savedGamePath"]];
    47     } else {
    47     } else {
    48         playSound(@"backSound");
    48         [AudioManagerController playBackSound];
    49         [defaults setObject:@"" forKey:@"savedGamePath"];
    49         [defaults setObject:@"" forKey:@"savedGamePath"];
    50         [defaults synchronize];
    50         [defaults synchronize];
    51         [self.parentViewController dismissModalViewControllerAnimated:YES];
    51         [self.parentViewController dismissModalViewControllerAnimated:YES];
    52     }
    52     }
    53 }
    53 }