project_files/HedgewarsMobile/Classes/GameConfigViewController.m
changeset 3629 86212d2b116a
parent 3626 19f78afa0188
child 3630 2c7a9d5aa18c
equal deleted inserted replaced
3628:2b4d878ba565 3629:86212d2b116a
   153                                                                       schemeWeaponConfigViewController.selectedScheme,@"scheme",
   153                                                                       schemeWeaponConfigViewController.selectedScheme,@"scheme",
   154                                                                       schemeWeaponConfigViewController.selectedWeapon,@"weapon",
   154                                                                       schemeWeaponConfigViewController.selectedWeapon,@"weapon",
   155                                                                       nil];
   155                                                                       nil];
   156 
   156 
   157     // finally launch game and remove this controller
   157     // finally launch game and remove this controller
       
   158     DLog(@"sending config %@", gameDictionary);
       
   159 
   158     [[SDLUIKitDelegate sharedAppDelegate] startSDLgame:gameDictionary];
   160     [[SDLUIKitDelegate sharedAppDelegate] startSDLgame:gameDictionary];
   159     [gameDictionary release];
   161     [gameDictionary release];
   160     //[[self parentViewController] dismissModalViewControllerAnimated:YES];
   162     //[[self parentViewController] dismissModalViewControllerAnimated:YES];
   161 }
   163 }
   162 
   164 
   163 -(void) viewDidLoad {
   165 -(void) viewDidLoad {
       
   166     self.view.backgroundColor = [UIColor blackColor];
       
   167     
   164     CGRect screen = [[UIScreen mainScreen] bounds];
   168     CGRect screen = [[UIScreen mainScreen] bounds];
   165     self.view.frame = CGRectMake(0, 0, screen.size.height, screen.size.width);
   169     self.view.frame = CGRectMake(0, 0, screen.size.height, screen.size.width);
   166 
   170 
   167     if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
   171     if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
   168         if (mapConfigViewController == nil)
   172         if (mapConfigViewController == nil)
   183             }
   187             }
   184         }
   188         }
   185     } else {
   189     } else {
   186         // this is the visible controller
   190         // this is the visible controller
   187         mapConfigViewController = [[MapConfigViewController alloc] initWithNibName:@"MapConfigViewController-iPhone" bundle:nil];
   191         mapConfigViewController = [[MapConfigViewController alloc] initWithNibName:@"MapConfigViewController-iPhone" bundle:nil];
   188         // this must be loaded to auto set default scheme and ammo
   192         // this must be loaded & added to auto set default scheme and ammo
   189         schemeWeaponConfigViewController = [[SchemeWeaponConfigViewController alloc] initWithStyle:UITableViewStyleGrouped];
   193         schemeWeaponConfigViewController = [[SchemeWeaponConfigViewController alloc] initWithStyle:UITableViewStyleGrouped];
       
   194         [self.view addSubview:schemeWeaponConfigViewController.view];
   190     }
   195     }
   191     activeController = mapConfigViewController;
   196     activeController = mapConfigViewController;
   192     
   197     
   193     [self.view addSubview:mapConfigViewController.view];
   198     [self.view addSubview:mapConfigViewController.view];
   194     
   199