project_files/HedgewarsMobile/Classes/GameSetup.m
changeset 3978 9660600e43cb
parent 3976 abaf741a4e21
child 3996 eb549fd864a5
equal deleted inserted replaced
3977:9df7b4812da9 3978:9660600e43cb
    50         // is it a Save?
    50         // is it a Save?
    51         NSString *path = [gameDictionary objectForKey:@"savefile"];
    51         NSString *path = [gameDictionary objectForKey:@"savefile"];
    52         // if path is empty it means that you have to create a new file, otherwise read from that file
    52         // if path is empty it means that you have to create a new file, otherwise read from that file
    53         if ([path isEqualToString:@""] == YES) {
    53         if ([path isEqualToString:@""] == YES) {
    54             NSDateFormatter *outputFormatter = [[NSDateFormatter alloc] init];
    54             NSDateFormatter *outputFormatter = [[NSDateFormatter alloc] init];
    55             [outputFormatter setDateFormat:@"yyyy.MM.dd '@' HH-mm"];
    55             [outputFormatter setDateFormat:@"yyyy-MM-dd '@' HH.mm"];
    56             NSString *newDateString = [outputFormatter stringFromDate:[NSDate date]];
    56             NSString *newDateString = [outputFormatter stringFromDate:[NSDate date]];
    57             self.savePath = [SAVES_DIRECTORY() stringByAppendingFormat:@"%@.hws", newDateString];
    57             self.savePath = [SAVES_DIRECTORY() stringByAppendingFormat:@"%@.hws", newDateString];
    58             [outputFormatter release];
    58             [outputFormatter release];
    59         } else
    59         } else
    60             self.savePath = path;
    60             self.savePath = path;
   414                 }
   414                 }
   415                 break;
   415                 break;
   416             case 'q':
   416             case 'q':
   417                 // game ended, can remove the savefile
   417                 // game ended, can remove the savefile
   418                 [[NSFileManager defaultManager] removeItemAtPath:self.savePath error:nil];
   418                 [[NSFileManager defaultManager] removeItemAtPath:self.savePath error:nil];
   419                 // so update the relative viewcontroler and the overlay
   419                 //[[NSNotificationCenter defaultCenter] postNotificationName:@"removedSave" object:nil];
   420                 [[NSNotificationCenter defaultCenter] postNotificationName:@"removedSave" object:nil];
       
   421                 // and remove + disable the overlay
   420                 // and remove + disable the overlay
   422                 [[NSNotificationCenter defaultCenter] postNotificationName:@"remove overlay" object:nil];
   421                 [[NSNotificationCenter defaultCenter] postNotificationName:@"remove overlay" object:nil];
   423                 setGameRunning(NO);
   422                 setGameRunning(NO);
   424                 break;
   423                 break;
   425             default:
   424             default: