project_files/HedgewarsMobile/Classes/MainMenuViewController.m
changeset 6000 dbcebcd3d79f
parent 5984 6fd40d866342
child 6008 215f0c9719e3
equal deleted inserted replaced
5998:e8f44e9433f0 6000:dbcebcd3d79f
    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 "Appirater.h"
    31 #import "ServerSetup.h"
    31 #import "ServerSetup.h"
       
    32 
    32 
    33 
    33 @implementation MainMenuViewController
    34 @implementation MainMenuViewController
    34 @synthesize gameConfigViewController, settingsViewController, aboutViewController, savedGamesViewController, restoreViewController;
    35 @synthesize gameConfigViewController, settingsViewController, aboutViewController, savedGamesViewController, restoreViewController;
    35 
    36 
    36 -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation {
    37 -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation {
   104     // get the version number that we've been tracking
   105     // get the version number that we've been tracking
   105     NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
   106     NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
   106     NSString *trackingVersion = [userDefaults stringForKey:@"HedgeVersion"];
   107     NSString *trackingVersion = [userDefaults stringForKey:@"HedgeVersion"];
   107 
   108 
   108     if ([[userDefaults objectForKey:@"music"] boolValue])
   109     if ([[userDefaults objectForKey:@"music"] boolValue])
   109         [HedgewarsAppDelegate playBackgroundMusic];
   110         [AudioManagerController playBackgroundMusic];
   110 
   111 
   111     if (trackingVersion == nil || [trackingVersion isEqualToString:version] == NO) {
   112     if (trackingVersion == nil || [trackingVersion isEqualToString:version] == NO) {
   112         // remove any reminder of previous games as saves are going to be wiped out
   113         // remove any reminder of previous games as saves are going to be wiped out
   113         [userDefaults setObject:@"" forKey:@"savedGamePath"];
   114         [userDefaults setObject:@"" forKey:@"savedGamePath"];
   114         // update the tracking version with the new one
   115         // update the tracking version with the new one
   154     UIButton *button = (UIButton *)sender;
   155     UIButton *button = (UIButton *)sender;
   155     UIAlertView *alert;
   156     UIAlertView *alert;
   156     NSString *xib = nil;
   157     NSString *xib = nil;
   157     NSString *debugStr = nil;
   158     NSString *debugStr = nil;
   158 
   159 
   159     playSound(@"clickSound");
   160     [AudioManagerController playClickSound];
   160     switch (button.tag) {
   161     switch (button.tag) {
   161         case 0:
   162         case 0:
   162             if (nil == self.gameConfigViewController) {
   163             if (nil == self.gameConfigViewController) {
   163                 xib = IS_IPAD() ? nil : @"GameConfigViewController";
   164                 xib = IS_IPAD() ? nil : @"GameConfigViewController";
   164 
   165