project_files/HedgewarsMobile/Classes/GameConfigViewController.m
changeset 3630 2c7a9d5aa18c
parent 3629 86212d2b116a
child 3632 8e1bd8b5780e
--- a/project_files/HedgewarsMobile/Classes/GameConfigViewController.m	Thu Jul 08 02:23:10 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/GameConfigViewController.m	Thu Jul 08 23:06:21 2010 +0200
@@ -143,7 +143,7 @@
         return;
     }
     
-    // create the configuration file that is going to be sent to engine
+    /*
     NSDictionary *gameDictionary = [[NSDictionary alloc] initWithObjectsAndKeys:mapConfigViewController.seedCommand,@"seed_command",
                                                                       mapConfigViewController.templateFilterCommand,@"templatefilter_command",
                                                                       mapConfigViewController.mapGenCommand,@"mapgen_command",
@@ -153,13 +153,36 @@
                                                                       schemeWeaponConfigViewController.selectedScheme,@"scheme",
                                                                       schemeWeaponConfigViewController.selectedWeapon,@"weapon",
                                                                       nil];
-
+    */
+    
+    // create the configuration file that is going to be sent to engine
+    NSDictionary *gameDictionary = [NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:
+                                                                        mapConfigViewController.seedCommand,
+                                                                        mapConfigViewController.templateFilterCommand,
+                                                                        mapConfigViewController.mapGenCommand,
+                                                                        mapConfigViewController.mazeSizeCommand,
+                                                                        mapConfigViewController.themeCommand,
+                                                                        teamConfigViewController.listOfSelectedTeams,
+                                                                        schemeWeaponConfigViewController.selectedScheme,
+                                                                        schemeWeaponConfigViewController.selectedWeapon,nil]
+                                                               forKeys:[NSArray arrayWithObjects:
+                                                                        @"seed_command",
+                                                                        @"templatefilter_command",
+                                                                        @"mapgen_command",
+                                                                        @"mazesize_command",
+                                                                        @"theme_command",
+                                                                        @"teams_list",
+                                                                        @"scheme",
+                                                                        @"weapon",nil]];
     // finally launch game and remove this controller
     DLog(@"sending config %@", gameDictionary);
+    
+    if ([[gameDictionary allKeys] count] == 8) {
+        [[SDLUIKitDelegate sharedAppDelegate] startSDLgame:gameDictionary];
+    } else {
+        DLog(@"gameconfig data not complete\n%@\nWHY???", gameDictionary);
+    }
 
-    [[SDLUIKitDelegate sharedAppDelegate] startSDLgame:gameDictionary];
-    [gameDictionary release];
-    //[[self parentViewController] dismissModalViewControllerAnimated:YES];
 }
 
 -(void) viewDidLoad {