change order of statspage/gamerun when running in dual screen
authorkoda
Thu, 03 Feb 2011 00:23:41 +0100
changeset 4912 862b134284b2
parent 4911 5d10bd725efe
child 4913 f0d48df35f86
change order of statspage/gamerun when running in dual screen
project_files/HedgewarsMobile/Classes/GameConfigViewController.m
project_files/HedgewarsMobile/Classes/InGameMenuViewController.m
project_files/HedgewarsMobile/Classes/SavedGamesViewController.m
--- a/project_files/HedgewarsMobile/Classes/GameConfigViewController.m	Wed Feb 02 23:38:44 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/GameConfigViewController.m	Thu Feb 03 00:23:41 2011 +0100
@@ -239,10 +239,16 @@
     statsPage.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
     if ([statsPage respondsToSelector:@selector(setModalPresentationStyle:)])
         statsPage.modalPresentationStyle = UIModalPresentationPageSheet;
-    // avoid showing the stat page immediately, but wait for 3 seconds
-    [self performSelector:@selector(presentModalViewController:animated:) withObject:statsPage afterDelay:3];
 
-    NSArray *stats = [[SDLUIKitDelegate sharedAppDelegate] startSDLgame:allDataNecessary];
+    NSArray *stats;
+    if (IS_DUALHEAD()) {
+        stats = [[SDLUIKitDelegate sharedAppDelegate] startSDLgame:allDataNecessary];
+        [self presentModalViewController:statsPage animated:NO];
+    } else {
+        [self performSelector:@selector(presentModalViewController:animated:) withObject:statsPage afterDelay:3];
+        stats = [[SDLUIKitDelegate sharedAppDelegate] startSDLgame:allDataNecessary];
+    }
+
     if ([stats count] <= 1) {
         DLog(@"%@",stats);
         [statsPage dismissModalViewControllerAnimated:NO];
--- a/project_files/HedgewarsMobile/Classes/InGameMenuViewController.m	Wed Feb 02 23:38:44 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/InGameMenuViewController.m	Thu Feb 03 00:23:41 2011 +0100
@@ -96,11 +96,13 @@
 }
 
 -(void) dismiss {
-    CGRect screen = [[UIScreen mainScreen] bounds];
-    [UIView beginAnimations:@"hiding popover" context:NULL];
-    [UIView setAnimationDuration:0.35];
-    self.view.frame = CGRectMake(screen.size.height, 0, 200, 170);
-    [UIView commitAnimations];
+    if (IS_IPAD() == NO) {
+        CGRect screen = [[UIScreen mainScreen] bounds];
+        [UIView beginAnimations:@"hiding popover" context:NULL];
+        [UIView setAnimationDuration:0.35];
+        self.view.frame = CGRectMake(screen.size.height, 0, 200, 170);
+        [UIView commitAnimations];
+    }
 
     [self.view performSelector:@selector(removeFromSuperview) withObject:nil afterDelay:0.35];
 
@@ -185,7 +187,7 @@
 #pragma mark -
 #pragma mark actionSheet methods
 -(void) actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger) buttonIndex {
-    if (IS_IPAD() == NO){
+    if (IS_IPAD() == NO) {
         CGRect screen = [[UIScreen mainScreen] bounds];
         [UIView beginAnimations:@"table width less" context:NULL];
         [UIView setAnimationDuration:0.2];
--- a/project_files/HedgewarsMobile/Classes/SavedGamesViewController.m	Wed Feb 02 23:38:44 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/SavedGamesViewController.m	Thu Feb 03 00:23:41 2011 +0100
@@ -226,7 +226,15 @@
     // avoid showing the stat page immediately, but wait for 3 seconds
     [self performSelector:@selector(presentModalViewController:animated:) withObject:statsPage afterDelay:3];
 
-    NSArray *stats = [[SDLUIKitDelegate sharedAppDelegate] startSDLgame:allDataNecessary];
+    NSArray *stats;
+    if (IS_DUALHEAD()) {
+        stats = [[SDLUIKitDelegate sharedAppDelegate] startSDLgame:allDataNecessary];
+        [self presentModalViewController:statsPage animated:NO];
+    } else {
+        [self performSelector:@selector(presentModalViewController:animated:) withObject:statsPage afterDelay:3];
+        stats = [[SDLUIKitDelegate sharedAppDelegate] startSDLgame:allDataNecessary];
+    }
+
     if ([stats count] <= 1) {
         DLog(@"%@",stats);
         [statsPage dismissModalViewControllerAnimated:NO];