project_files/HedgewarsMobile/Classes/GameSetup.m
changeset 3898 0a9c3735a713
parent 3895 e7c202c08ac1
child 3902 3aac7ca07b0e
equal deleted inserted replaced
3897:27e115fa1143 3898:0a9c3735a713
    42 
    42 
    43         self.gameConfig = [gameDictionary objectForKey:@"game_dictionary"];
    43         self.gameConfig = [gameDictionary objectForKey:@"game_dictionary"];
    44         isNetGame = [[gameDictionary objectForKey:@"netgame"] boolValue];
    44         isNetGame = [[gameDictionary objectForKey:@"netgame"] boolValue];
    45         NSString *path = [gameDictionary objectForKey:@"savefile"];
    45         NSString *path = [gameDictionary objectForKey:@"savefile"];
    46         // if path is empty it means i have to create a new file, otherwise i read from that file
    46         // if path is empty it means i have to create a new file, otherwise i read from that file
    47         if ([path isEqualToString:@""] == YES)
    47         if ([path isEqualToString:@""] == YES) {
    48             self.savePath = [SAVES_DIRECTORY() stringByAppendingFormat:@"%@.hws", [[NSDate date] description]];
    48             NSDateFormatter *outputFormatter = [[NSDateFormatter alloc] init];
    49         else
    49             [outputFormatter setDateFormat:@"yyyy-MM-dd 'at' HH,mm"];
    50             self.savePath = [SAVES_DIRECTORY() stringByAppendingString:path];
    50             NSString *newDateString = [outputFormatter stringFromDate:[NSDate date]];
       
    51             self.savePath = [SAVES_DIRECTORY() stringByAppendingFormat:@"%@.hws", newDateString];
       
    52             [outputFormatter release];
       
    53         } else
       
    54             self.savePath = path;
    51     }
    55     }
    52     return self;
    56     return self;
    53 }
    57 }
    54 
    58 
    55 -(void) dealloc {
    59 -(void) dealloc {