17 */ |
17 */ |
18 |
18 |
19 |
19 |
20 #import "HedgewarsAppDelegate.h" |
20 #import "HedgewarsAppDelegate.h" |
21 #import "MainMenuViewController.h" |
21 #import "MainMenuViewController.h" |
22 |
22 #import "Appirater.h" |
23 |
23 |
24 @implementation SDLUIKitDelegate (customDelegate) |
24 @implementation SDLUIKitDelegate (customDelegate) |
25 |
25 |
26 // hijack the the SDL_UIKitAppDelegate to use the UIApplicationDelegate we implement here |
26 // hijack the the SDL_UIKitAppDelegate to use the UIApplicationDelegate we implement here |
27 +(NSString *)getAppDelegateClassName { |
27 +(NSString *)getAppDelegateClassName { |
48 [uiwindow release]; |
48 [uiwindow release]; |
49 [super dealloc]; |
49 [super dealloc]; |
50 } |
50 } |
51 |
51 |
52 // override the direct execution of SDL_main to allow us to implement our own frontend |
52 // override the direct execution of SDL_main to allow us to implement our own frontend |
53 -(void) postFinishLaunch { |
53 -(void) postFinishLaunch |
|
54 { |
|
55 // Setup Appirater |
|
56 [Appirater setAppId:@"391234866"]; |
|
57 [Appirater setDaysUntilPrompt:3]; |
|
58 [Appirater setUsesUntilPrompt:5]; |
|
59 [Appirater setSignificantEventsUntilPrompt:-1]; |
|
60 [Appirater setTimeBeforeReminding:1]; |
|
61 //[Appirater setDebug:YES]; |
|
62 |
|
63 [self performSelector:@selector(hideLaunchScreen) withObject:nil afterDelay:0.0]; |
|
64 |
54 [[UIApplication sharedApplication] setStatusBarHidden:YES]; |
65 [[UIApplication sharedApplication] setStatusBarHidden:YES]; |
55 |
66 |
56 self.uiwindow = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; |
67 self.uiwindow = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; |
57 self.uiwindow.backgroundColor = [UIColor blackColor]; |
68 self.uiwindow.backgroundColor = [UIColor blackColor]; |
58 |
69 |
59 NSString *controllerName = (IS_IPAD() ? @"MainMenuViewController-iPad" : @"MainMenuViewController-iPhone"); |
70 NSString *controllerName = (IS_IPAD() ? @"MainMenuViewController-iPad" : @"MainMenuViewController-iPhone"); |
60 self.mainViewController = [[MainMenuViewController alloc] initWithNibName:controllerName bundle:nil]; |
71 self.mainViewController = [[MainMenuViewController alloc] initWithNibName:controllerName bundle:nil]; |
61 [self.uiwindow addSubview:self.mainViewController.view]; |
72 self.uiwindow.rootViewController = self.mainViewController; |
62 [self.mainViewController release]; |
73 [self.mainViewController release]; |
63 |
74 |
64 [self.uiwindow makeKeyAndVisible]; |
75 [self.uiwindow makeKeyAndVisible]; |
65 } |
76 } |
66 |
77 |