project_files/HedgewarsMobile/Classes/SavedGamesViewController.m
changeset 5158 4941df038b95
parent 5157 a5a6ffc56141
child 5208 878e551f0b4a
equal deleted inserted replaced
5157:a5a6ffc56141 5158:4941df038b95
   212     GameInterfaceBridge *bridge = [[GameInterfaceBridge alloc] initWithController:self];
   212     GameInterfaceBridge *bridge = [[GameInterfaceBridge alloc] initWithController:self];
   213 
   213 
   214     NSString *filePath = [[NSString alloc] initWithFormat:@"%@/%@",SAVES_DIRECTORY(),[self.listOfSavegames objectAtIndex:[indexPath row]]];
   214     NSString *filePath = [[NSString alloc] initWithFormat:@"%@/%@",SAVES_DIRECTORY(),[self.listOfSavegames objectAtIndex:[indexPath row]]];
   215     [bridge startSaveGame:filePath];
   215     [bridge startSaveGame:filePath];
   216     [filePath release];
   216     [filePath release];
       
   217 
   217     [bridge release];
   218     [bridge release];
   218 
       
   219     // reload needed because when ending game the entry remains there
       
   220     [self viewWillAppear:YES];
       
   221 
       
   222     /* // also modify GameConfigViewController.m
       
   223     StatsPageViewController *statsPage = [[StatsPageViewController alloc] initWithStyle:UITableViewStyleGrouped];
       
   224     statsPage.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
       
   225     if ([statsPage respondsToSelector:@selector(setModalPresentationStyle:)])
       
   226         statsPage.modalPresentationStyle = UIModalPresentationPageSheet;
       
   227     // avoid showing the stat page immediately, but wait for 3 seconds
       
   228     [self performSelector:@selector(presentModalViewController:animated:) withObject:statsPage afterDelay:3];
       
   229 
       
   230     NSArray *stats;
       
   231     if (IS_DUALHEAD()) {
       
   232         stats = [[HedgewarsAppDelegate sharedAppDelegate] startSDLgame:allDataNecessary];
       
   233         [self presentModalViewController:statsPage animated:NO];
       
   234     } else {
       
   235         [self performSelector:@selector(presentModalViewController:animated:) withObject:statsPage afterDelay:3];
       
   236         stats = [[HedgewarsAppDelegate sharedAppDelegate] startSDLgame:allDataNecessary];
       
   237     }
       
   238 
       
   239     if ([stats count] <= 1) {
       
   240         DLog(@"%@",stats);
       
   241         [statsPage dismissModalViewControllerAnimated:NO];
       
   242     } else {
       
   243         statsPage.statsArray = stats;
       
   244         [statsPage.tableView reloadData];
       
   245         [statsPage viewWillAppear:YES];
       
   246     }*/
       
   247 
       
   248 }
   219 }
   249 
   220 
   250 #pragma mark -
   221 #pragma mark -
   251 #pragma mark editableCellView delegate
   222 #pragma mark editableCellView delegate
   252 // rename old file if names differ
   223 // rename old file if names differ