project_files/HedgewarsMobile/Classes/GameConfigViewController.m
changeset 4757 7ca9ebb6895d
parent 4754 a0fd8211c00f
child 4760 224c31b3ce7d
equal deleted inserted replaced
4754:a0fd8211c00f 4757:7ca9ebb6895d
    23 #import "SDL_uikitappdelegate.h"
    23 #import "SDL_uikitappdelegate.h"
    24 #import "MapConfigViewController.h"
    24 #import "MapConfigViewController.h"
    25 #import "TeamConfigViewController.h"
    25 #import "TeamConfigViewController.h"
    26 #import "SchemeWeaponConfigViewController.h"
    26 #import "SchemeWeaponConfigViewController.h"
    27 #import "HelpPageViewController.h"
    27 #import "HelpPageViewController.h"
       
    28 #import "StatsPageViewController.h"
    28 #import "CommodityFunctions.h"
    29 #import "CommodityFunctions.h"
    29 #import "UIImageExtra.h"
    30 #import "UIImageExtra.h"
    30 #import "PascalImports.h"
    31 #import "PascalImports.h"
    31 
    32 
    32 @implementation GameConfigViewController
    33 @implementation GameConfigViewController
   224                                     self.schemeWeaponConfigViewController.selectedScheme,@"scheme",
   225                                     self.schemeWeaponConfigViewController.selectedScheme,@"scheme",
   225                                     self.schemeWeaponConfigViewController.selectedWeapon,@"weapon",
   226                                     self.schemeWeaponConfigViewController.selectedWeapon,@"weapon",
   226                                     [NSNumber numberWithInt:self.interfaceOrientation],@"orientation",
   227                                     [NSNumber numberWithInt:self.interfaceOrientation],@"orientation",
   227                                     nil];
   228                                     nil];
   228 
   229 
   229     NSDictionary *allDataNecessary = [NSDictionary dictionaryWithObjectsAndKeys:gameDictionary,@"game_dictionary",
   230     NSDictionary *allDataNecessary = [NSDictionary dictionaryWithObjectsAndKeys:
       
   231                                       gameDictionary,@"game_dictionary",
       
   232                                       [NSNumber numberWithBool:NO],@"netgame",
   230                                       @"",@"savefile",
   233                                       @"",@"savefile",
   231                                       [NSNumber numberWithBool:NO],@"netgame",
       
   232                                       nil];
   234                                       nil];
   233     if (IS_IPAD())
   235     if (IS_IPAD())
   234         [[SDLUIKitDelegate sharedAppDelegate] startSDLgame:allDataNecessary];
   236         [[SDLUIKitDelegate sharedAppDelegate] startSDLgame:allDataNecessary];
   235     else {
   237     else {
   236         // this causes a sporadic crash on the ipad but without this rotation doesn't work on iphone
   238         // this causes a sporadic crash on the ipad but without this rotation doesn't work on iphone
   237         UIViewController *dummy = [[UIViewController alloc] init];
   239         StatsPageViewController *statsPage = [[StatsPageViewController alloc] initWithStyle:UITableViewStyleGrouped];
   238         [self presentModalViewController:dummy animated:NO];
   240         [self presentModalViewController:statsPage animated:NO];
   239         [[SDLUIKitDelegate sharedAppDelegate] startSDLgame:allDataNecessary];
   241 
   240         [self dismissModalViewControllerAnimated:NO];
   242         statsPage.statsDictionary = [[SDLUIKitDelegate sharedAppDelegate] startSDLgame:allDataNecessary];
   241         [dummy release];
   243         if (statsPage.statsDictionary == nil)
       
   244             [statsPage dismissModalViewControllerAnimated:NO];
       
   245         else
       
   246             [statsPage.tableView reloadData];
       
   247         DLog(@"%@",statsPage.statsDictionary);
       
   248         [statsPage release];
   242     }
   249     }
   243 
   250 
   244 }
   251 }
   245 
   252 
   246 -(void) loadNiceHogs {
   253 -(void) loadNiceHogs {