equal
deleted
inserted
replaced
25 #import "GameConfigViewController.h" |
25 #import "GameConfigViewController.h" |
26 #import "SplitViewRootController.h" |
26 #import "SplitViewRootController.h" |
27 #import "AboutViewController.h" |
27 #import "AboutViewController.h" |
28 #import "SavedGamesViewController.h" |
28 #import "SavedGamesViewController.h" |
29 #import "RestoreViewController.h" |
29 #import "RestoreViewController.h" |
|
30 #import "Appirater.h" |
30 #import "ServerSetup.h" |
31 #import "ServerSetup.h" |
31 |
32 |
32 @implementation MainMenuViewController |
33 @implementation MainMenuViewController |
33 @synthesize gameConfigViewController, settingsViewController, aboutViewController, savedGamesViewController, restoreViewController; |
34 @synthesize gameConfigViewController, settingsViewController, aboutViewController, savedGamesViewController, restoreViewController; |
34 |
35 |
70 // SCHEMES - always overwrite and delete custom ones |
71 // SCHEMES - always overwrite and delete custom ones |
71 if ([[NSFileManager defaultManager] fileExistsAtPath:SCHEMES_DIRECTORY()] == YES) |
72 if ([[NSFileManager defaultManager] fileExistsAtPath:SCHEMES_DIRECTORY()] == YES) |
72 [[NSFileManager defaultManager] removeItemAtPath:SCHEMES_DIRECTORY() error:NULL]; |
73 [[NSFileManager defaultManager] removeItemAtPath:SCHEMES_DIRECTORY() error:NULL]; |
73 NSString *baseSchemesDir = [[NSString alloc] initWithFormat:@"%@/Settings/Schemes/",resourcesDir]; |
74 NSString *baseSchemesDir = [[NSString alloc] initWithFormat:@"%@/Settings/Schemes/",resourcesDir]; |
74 [[NSFileManager defaultManager] copyItemAtPath:baseSchemesDir toPath:SCHEMES_DIRECTORY() error:NULL]; |
75 [[NSFileManager defaultManager] copyItemAtPath:baseSchemesDir toPath:SCHEMES_DIRECTORY() error:NULL]; |
75 |
76 [baseSchemesDir release]; |
76 |
77 |
77 // WEAPONS - always overwrite |
78 // WEAPONS - always overwrite |
78 if ([[NSFileManager defaultManager] fileExistsAtPath:WEAPONS_DIRECTORY()] == NO) |
79 if ([[NSFileManager defaultManager] fileExistsAtPath:WEAPONS_DIRECTORY()] == NO) |
79 [[NSFileManager defaultManager] createDirectoryAtPath:WEAPONS_DIRECTORY() |
80 [[NSFileManager defaultManager] createDirectoryAtPath:WEAPONS_DIRECTORY() |
80 withIntermediateDirectories:YES |
81 withIntermediateDirectories:YES |
119 restored.modalPresentationStyle = UIModalPresentationFormSheet; |
120 restored.modalPresentationStyle = UIModalPresentationFormSheet; |
120 self.restoreViewController = restored; |
121 self.restoreViewController = restored; |
121 [restored release]; |
122 [restored release]; |
122 } |
123 } |
123 [self performSelector:@selector(presentModalViewController:animated:) withObject:self.restoreViewController afterDelay:0.35]; |
124 [self performSelector:@selector(presentModalViewController:animated:) withObject:self.restoreViewController afterDelay:0.35]; |
124 } |
125 } else { |
|
126 // let's not prompt for rating when app crashed >_> |
|
127 [Appirater appLaunched]; |
|
128 } |
|
129 |
125 |
130 |
126 /* |
131 /* |
127 ServerSetup *setup = [[ServerSetup alloc] init]; |
132 ServerSetup *setup = [[ServerSetup alloc] init]; |
128 if ([setup isNetworkReachable]) { |
133 if (isNetworkReachable()) { |
129 DLog(@"network is reachable"); |
134 DLog(@"network is reachable"); |
130 [NSThread detachNewThreadSelector:@selector(serverProtocol) |
135 [NSThread detachNewThreadSelector:@selector(serverProtocol) |
131 toTarget:setup |
136 toTarget:setup |
132 withObject:nil]; |
137 withObject:nil]; |
133 } |
138 } |