project_files/HedgewarsMobile/Classes/GameConfigViewController.m
changeset 3630 2c7a9d5aa18c
parent 3629 86212d2b116a
child 3632 8e1bd8b5780e
equal deleted inserted replaced
3629:86212d2b116a 3630:2c7a9d5aa18c
   141         [alert show];
   141         [alert show];
   142         [alert release];
   142         [alert release];
   143         return;
   143         return;
   144     }
   144     }
   145     
   145     
   146     // create the configuration file that is going to be sent to engine
   146     /*
   147     NSDictionary *gameDictionary = [[NSDictionary alloc] initWithObjectsAndKeys:mapConfigViewController.seedCommand,@"seed_command",
   147     NSDictionary *gameDictionary = [[NSDictionary alloc] initWithObjectsAndKeys:mapConfigViewController.seedCommand,@"seed_command",
   148                                                                       mapConfigViewController.templateFilterCommand,@"templatefilter_command",
   148                                                                       mapConfigViewController.templateFilterCommand,@"templatefilter_command",
   149                                                                       mapConfigViewController.mapGenCommand,@"mapgen_command",
   149                                                                       mapConfigViewController.mapGenCommand,@"mapgen_command",
   150                                                                       mapConfigViewController.mazeSizeCommand,@"mazesize_command",
   150                                                                       mapConfigViewController.mazeSizeCommand,@"mazesize_command",
   151                                                                       mapConfigViewController.themeCommand,@"theme_command",
   151                                                                       mapConfigViewController.themeCommand,@"theme_command",
   152                                                                       teamConfigViewController.listOfSelectedTeams,@"teams_list",
   152                                                                       teamConfigViewController.listOfSelectedTeams,@"teams_list",
   153                                                                       schemeWeaponConfigViewController.selectedScheme,@"scheme",
   153                                                                       schemeWeaponConfigViewController.selectedScheme,@"scheme",
   154                                                                       schemeWeaponConfigViewController.selectedWeapon,@"weapon",
   154                                                                       schemeWeaponConfigViewController.selectedWeapon,@"weapon",
   155                                                                       nil];
   155                                                                       nil];
   156 
   156     */
       
   157     
       
   158     // create the configuration file that is going to be sent to engine
       
   159     NSDictionary *gameDictionary = [NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:
       
   160                                                                         mapConfigViewController.seedCommand,
       
   161                                                                         mapConfigViewController.templateFilterCommand,
       
   162                                                                         mapConfigViewController.mapGenCommand,
       
   163                                                                         mapConfigViewController.mazeSizeCommand,
       
   164                                                                         mapConfigViewController.themeCommand,
       
   165                                                                         teamConfigViewController.listOfSelectedTeams,
       
   166                                                                         schemeWeaponConfigViewController.selectedScheme,
       
   167                                                                         schemeWeaponConfigViewController.selectedWeapon,nil]
       
   168                                                                forKeys:[NSArray arrayWithObjects:
       
   169                                                                         @"seed_command",
       
   170                                                                         @"templatefilter_command",
       
   171                                                                         @"mapgen_command",
       
   172                                                                         @"mazesize_command",
       
   173                                                                         @"theme_command",
       
   174                                                                         @"teams_list",
       
   175                                                                         @"scheme",
       
   176                                                                         @"weapon",nil]];
   157     // finally launch game and remove this controller
   177     // finally launch game and remove this controller
   158     DLog(@"sending config %@", gameDictionary);
   178     DLog(@"sending config %@", gameDictionary);
   159 
   179     
   160     [[SDLUIKitDelegate sharedAppDelegate] startSDLgame:gameDictionary];
   180     if ([[gameDictionary allKeys] count] == 8) {
   161     [gameDictionary release];
   181         [[SDLUIKitDelegate sharedAppDelegate] startSDLgame:gameDictionary];
   162     //[[self parentViewController] dismissModalViewControllerAnimated:YES];
   182     } else {
       
   183         DLog(@"gameconfig data not complete\n%@\nWHY???", gameDictionary);
       
   184     }
       
   185 
   163 }
   186 }
   164 
   187 
   165 -(void) viewDidLoad {
   188 -(void) viewDidLoad {
   166     self.view.backgroundColor = [UIColor blackColor];
   189     self.view.backgroundColor = [UIColor blackColor];
   167     
   190