project_files/HedgewarsMobile/Classes/GameConfigViewController.m
changeset 3632 8e1bd8b5780e
parent 3630 2c7a9d5aa18c
child 3635 38d3e31556d3
equal deleted inserted replaced
3631:159bc2fd7f68 3632:8e1bd8b5780e
   141         [alert show];
   141         [alert show];
   142         [alert release];
   142         [alert release];
   143         return;
   143         return;
   144     }
   144     }
   145     
   145     
   146     /*
   146     // create the configuration file that is going to be sent to engine
   147     NSDictionary *gameDictionary = [[NSDictionary alloc] initWithObjectsAndKeys:mapConfigViewController.seedCommand,@"seed_command",
   147     NSDictionary *gameDictionary = [NSDictionary dictionaryWithObjectsAndKeys: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]];
       
   177     // finally launch game and remove this controller
   157     // finally launch game and remove this controller
   178     DLog(@"sending config %@", gameDictionary);
   158     DLog(@"sending config %@", gameDictionary);
   179     
   159     
   180     if ([[gameDictionary allKeys] count] == 8) {
   160     if ([[gameDictionary allKeys] count] == 8) {
   181         [[SDLUIKitDelegate sharedAppDelegate] startSDLgame:gameDictionary];
   161         [[SDLUIKitDelegate sharedAppDelegate] startSDLgame:gameDictionary];
   182     } else {
   162     } else {
   183         DLog(@"gameconfig data not complete\n%@\nWHY???", gameDictionary);
   163         DLog(@"gameconfig data not complete!!\nmapConfigViewController = %@\nteamConfigViewController = %@\nschemeWeaponConfigViewController = %@\n",
       
   164              mapConfigViewController, teamConfigViewController, schemeWeaponConfigViewController);
   184     }
   165     }
   185 
   166 
   186 }
   167 }
   187 
   168 
   188 -(void) viewDidLoad {
   169 -(void) viewDidLoad {