project_files/HedgewarsMobile/Classes/GameConfigViewController.m
changeset 4763 c228a4841e3f
parent 4760 224c31b3ce7d
child 4856 dbc256913b35
equal deleted inserted replaced
4760:224c31b3ce7d 4763:c228a4841e3f
   230     NSDictionary *allDataNecessary = [NSDictionary dictionaryWithObjectsAndKeys:
   230     NSDictionary *allDataNecessary = [NSDictionary dictionaryWithObjectsAndKeys:
   231                                       gameDictionary,@"game_dictionary",
   231                                       gameDictionary,@"game_dictionary",
   232                                       [NSNumber numberWithBool:NO],@"netgame",
   232                                       [NSNumber numberWithBool:NO],@"netgame",
   233                                       @"",@"savefile",
   233                                       @"",@"savefile",
   234                                       nil];
   234                                       nil];
   235     if (IS_IPAD())
   235 
   236         [[SDLUIKitDelegate sharedAppDelegate] startSDLgame:allDataNecessary];
   236 
       
   237     StatsPageViewController *statsPage = [[StatsPageViewController alloc] initWithStyle:UITableViewStyleGrouped];
       
   238     statsPage.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
       
   239     if ([statsPage respondsToSelector:@selector(setModalPresentationStyle:)])
       
   240         statsPage.modalPresentationStyle = UIModalPresentationPageSheet;
       
   241     [self presentModalViewController:statsPage animated:NO];
       
   242 
       
   243     NSArray *stats = [[SDLUIKitDelegate sharedAppDelegate] startSDLgame:allDataNecessary];
       
   244     if ([stats count] == 0)
       
   245         [statsPage dismissModalViewControllerAnimated:NO];
   237     else {
   246     else {
   238         // this causes a sporadic crash on the ipad but without this rotation doesn't work on iphone
   247         statsPage.statsArray = stats;
   239         StatsPageViewController *statsPage = [[StatsPageViewController alloc] initWithStyle:UITableViewStyleGrouped];
   248         [statsPage.tableView reloadData];
   240         [self presentModalViewController:statsPage animated:NO];
   249         [statsPage viewWillAppear:YES];
   241 
   250     }
   242         NSArray *stats = [[SDLUIKitDelegate sharedAppDelegate] startSDLgame:allDataNecessary];
   251 
   243         if ([stats count] == 0)
   252 
   244             [statsPage dismissModalViewControllerAnimated:NO];
   253     [statsPage release];
   245         else {
       
   246             statsPage.statsArray = stats;
       
   247             [statsPage.tableView reloadData];
       
   248             [statsPage viewWillAppear:YES];
       
   249         }
       
   250 
       
   251         [statsPage release];
       
   252     }
       
   253 
       
   254 }
   254 }
   255 
   255 
   256 -(void) loadNiceHogs {
   256 -(void) loadNiceHogs {
   257     NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
   257     NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
   258     NSString *filePath = [NSString stringWithFormat:@"%@/Hedgehog.png",GRAPHICS_DIRECTORY()];
   258     NSString *filePath = [NSString stringWithFormat:@"%@/Hedgehog.png",GRAPHICS_DIRECTORY()];