project_files/HedgewarsMobile/Classes/SavedGamesViewController.m
changeset 5156 641abe679bf0
parent 5002 a9c44a8ffec8
child 5157 a5a6ffc56141
--- a/project_files/HedgewarsMobile/Classes/SavedGamesViewController.m	Sun Apr 17 22:38:24 2011 +0200
+++ b/project_files/HedgewarsMobile/Classes/SavedGamesViewController.m	Mon Apr 18 02:45:51 2011 +0200
@@ -20,7 +20,7 @@
 
 
 #import "SavedGamesViewController.h"
-#import "StatsPageViewController.h"
+#import "GameInterfaceBridge.h"
 #import "CommodityFunctions.h"
 
 @implementation SavedGamesViewController
@@ -208,16 +208,14 @@
         [self updateTable];
 
     [(EditableCellView *)[self.tableView cellForRowAtIndexPath:indexPath] save:nil];
-    
-    NSString *filePath = [NSString stringWithFormat:@"%@/%@",SAVES_DIRECTORY(),[self.listOfSavegames objectAtIndex:[indexPath row]]];
-    
-    NSDictionary *allDataNecessary = [NSDictionary dictionaryWithObjectsAndKeys:
-                                      filePath,@"savefile",
-                                      [NSNumber numberWithBool:NO],@"netgame",
-                                      [NSDictionary dictionaryWithObject:[NSNumber numberWithInt:self.interfaceOrientation] forKey:@"orientation"],@"game_dictionary",
-                                      nil];
+
+    GameInterfaceBridge *bridge = [[GameInterfaceBridge alloc] initWithController:self];
 
-    // also modify GameConfigViewController.m
+    NSString *filePath = [[NSString alloc] initWithFormat:@"%@/%@",SAVES_DIRECTORY(),[self.listOfSavegames objectAtIndex:[indexPath row]]];
+    [bridge startSaveGame:filePath];
+    [filePath release];
+    [bridge release];
+   /* // also modify GameConfigViewController.m
     StatsPageViewController *statsPage = [[StatsPageViewController alloc] initWithStyle:UITableViewStyleGrouped];
     statsPage.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
     if ([statsPage respondsToSelector:@selector(setModalPresentationStyle:)])
@@ -241,7 +239,7 @@
         statsPage.statsArray = stats;
         [statsPage.tableView reloadData];
         [statsPage viewWillAppear:YES];
-    }
+    }*/
     // reload needed because when ending game the entry remains there
     [self.tableView reloadData];
 }