--- a/project_files/HedgewarsMobile/Classes/MainMenuViewController.m Sun Feb 21 20:20:40 2016 +0100
+++ b/project_files/HedgewarsMobile/Classes/MainMenuViewController.m Sun Feb 21 22:21:59 2016 +0100
@@ -26,6 +26,7 @@
#import "SavedGamesViewController.h"
#import "RestoreViewController.h"
#import "MissionTrainingViewController.h"
+#import "CampaignsViewController.h"
#import "Appirater.h"
#import "ServerProtocolNetwork.h"
#import "GameInterfaceBridge.h"
@@ -89,8 +90,7 @@
{
NSString *xibName = [@"RestoreViewController-" stringByAppendingString:(IS_IPAD() ? @"iPad" : @"iPhone")];
RestoreViewController *restored = [[RestoreViewController alloc] initWithNibName:xibName bundle:nil];
- if ([restored respondsToSelector:@selector(setModalPresentationStyle:)])
- restored.modalPresentationStyle = UIModalPresentationFormSheet;
+ restored.modalPresentationStyle = UIModalPresentationFormSheet;
[self performSelector:@selector(presentViewController:) withObject:restored afterDelay:0.25];
}
@@ -219,8 +219,7 @@
{
AboutViewController *about = [[AboutViewController alloc] initWithNibName:@"AboutViewController" bundle:nil];
about.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
- if ([about respondsToSelector:@selector(setModalPresentationStyle:)])
- about.modalPresentationStyle = UIModalPresentationFormSheet;
+ about.modalPresentationStyle = UIModalPresentationFormSheet;
[self presentViewController:about animated:YES completion:nil];
[about release];
@@ -231,8 +230,7 @@
{
SavedGamesViewController *savedgames = [[SavedGamesViewController alloc] initWithNibName:@"SavedGamesViewController" bundle:nil];
savedgames.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
- if ([savedgames respondsToSelector:@selector(setModalPresentationStyle:)])
- savedgames.modalPresentationStyle = UIModalPresentationPageSheet;
+ savedgames.modalPresentationStyle = UIModalPresentationPageSheet;
[self presentViewController:savedgames animated:YES completion:nil];
[savedgames release];
@@ -243,8 +241,7 @@
xib = IS_IPAD() ? @"MissionTrainingViewController-iPad" : @"MissionTrainingViewController-iPhone";
MissionTrainingViewController *missions = [[MissionTrainingViewController alloc] initWithNibName:xib bundle:nil];
missions.modalTransitionStyle = IS_IPAD() ? UIModalTransitionStyleCoverVertical : UIModalTransitionStyleCrossDissolve;
- if ([missions respondsToSelector:@selector(setModalPresentationStyle:)])
- missions.modalPresentationStyle = UIModalPresentationPageSheet;
+ missions.modalPresentationStyle = UIModalPresentationPageSheet;
[self presentViewController:missions animated:YES completion:nil];
[missions release];
@@ -254,6 +251,20 @@
[GameInterfaceBridge registerCallingController:self];
[GameInterfaceBridge startSimpleGame];
break;
+ case 7:
+ {
+ xib = IS_IPAD() ? @"CampaignsViewController-iPad" : @"CampaignsViewController-iPhone";
+ CampaignsViewController *campaigns = [[CampaignsViewController alloc] initWithNibName:xib bundle:nil];
+ UINavigationController *campaignNavigationController = [[UINavigationController alloc] initWithRootViewController:campaigns];
+ [campaigns release];
+
+ campaignNavigationController.modalTransitionStyle = IS_IPAD() ? UIModalTransitionStyleCoverVertical : UIModalTransitionStyleCrossDissolve;
+ campaignNavigationController.modalPresentationStyle = UIModalPresentationPageSheet;
+
+ [self presentViewController:campaignNavigationController animated:YES completion:nil];
+ [campaignNavigationController release];
+ }
+ break;
default:
alert = [[UIAlertView alloc] initWithTitle:@"Not Yet Implemented"
message:@"Sorry, this feature is not yet implemented"