project_files/HedgewarsMobile/Classes/MainMenuViewController.m
changeset 3703 12d17c6e8855
parent 3701 8c449776ebe6
child 3737 2ba6ac8a114b
equal deleted inserted replaced
3701:8c449776ebe6 3703:12d17c6e8855
     5 //  Created by Vittorio on 08/01/10.
     5 //  Created by Vittorio on 08/01/10.
     6 //  Copyright 2010 __MyCompanyName__. All rights reserved.
     6 //  Copyright 2010 __MyCompanyName__. All rights reserved.
     7 //
     7 //
     8 
     8 
     9 #import "MainMenuViewController.h"
     9 #import "MainMenuViewController.h"
       
    10 #import "CommodityFunctions.h"
    10 #import "SDL_uikitappdelegate.h"
    11 #import "SDL_uikitappdelegate.h"
       
    12 #import "SDL_mixer.h"
    11 #import "PascalImports.h"
    13 #import "PascalImports.h"
    12 #import "GameConfigViewController.h"
    14 #import "GameConfigViewController.h"
    13 #import "SplitViewRootController.h"
    15 #import "SplitViewRootController.h"
    14 #import "CommodityFunctions.h"
    16 #import "AboutViewController.h"
    15 #import "SDL_mixer.h"
       
    16 
    17 
    17 @implementation MainMenuViewController
    18 @implementation MainMenuViewController
    18 @synthesize versionLabel, gameConfigViewController, settingsViewController;
    19 @synthesize versionLabel, gameConfigViewController, settingsViewController, aboutViewController;
    19 
    20 
    20 -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation {
    21 -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation {
    21     return rotationManager(interfaceOrientation);
    22     return rotationManager(interfaceOrientation);
    22 }
    23 }
    23 
    24 
   135             }
   136             }
   136 
   137 
   137             [self presentModalViewController:self.settingsViewController animated:YES];
   138             [self presentModalViewController:self.settingsViewController animated:YES];
   138             break;
   139             break;
   139         case 3:
   140         case 3:
       
   141             if (nil == self.aboutViewController) {
       
   142                 AboutViewController *about = [[AboutViewController alloc] initWithNibName:@"AboutViewController" bundle:nil];
       
   143                 about.modalTransitionStyle = UIModalPresentationFormSheet;
       
   144                 self.aboutViewController = about;
       
   145                 [about release];
       
   146             }
       
   147             
       
   148             [self presentModalViewController:self.aboutViewController animated:YES];
       
   149             /*
   140             debugStr = [[NSString alloc] initWithContentsOfFile:DEBUG_FILE()];
   150             debugStr = [[NSString alloc] initWithContentsOfFile:DEBUG_FILE()];
   141             UITextView *scroll = [[UITextView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.height, self.view.frame.size.width)];
   151             UITextView *scroll = [[UITextView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.height, self.view.frame.size.width)];
   142             scroll.text = debugStr;
   152             scroll.text = debugStr;
   143             [debugStr release];
   153             [debugStr release];
   144             scroll.editable = NO;
   154             scroll.editable = NO;
   148             btn.backgroundColor = [UIColor blackColor];
   158             btn.backgroundColor = [UIColor blackColor];
   149             btn.frame = CGRectMake(self.view.frame.size.height-70, 0, 70, 70);
   159             btn.frame = CGRectMake(self.view.frame.size.height-70, 0, 70, 70);
   150             [scroll addSubview:btn];
   160             [scroll addSubview:btn];
   151             [self.view addSubview:scroll];
   161             [self.view addSubview:scroll];
   152             [scroll release];
   162             [scroll release];
       
   163             */
   153             break;
   164             break;
   154         default:
   165         default:
   155             alert = [[UIAlertView alloc] initWithTitle:@"Not Yet Implemented"
   166             alert = [[UIAlertView alloc] initWithTitle:@"Not Yet Implemented"
   156                                                message:@"Sorry, this feature is not yet implemented"
   167                                                message:@"Sorry, this feature is not yet implemented"
   157                                               delegate:nil
   168                                               delegate:nil
   170 
   181 
   171 -(void) viewDidUnload {
   182 -(void) viewDidUnload {
   172     self.versionLabel = nil;
   183     self.versionLabel = nil;
   173     self.gameConfigViewController = nil;
   184     self.gameConfigViewController = nil;
   174     self.settingsViewController = nil;
   185     self.settingsViewController = nil;
       
   186     self.aboutViewController = nil;
   175     MSG_DIDUNLOAD();
   187     MSG_DIDUNLOAD();
   176     [super viewDidUnload];
   188     [super viewDidUnload];
   177 }
   189 }
   178 
   190 
   179 -(void) dealloc {
   191 -(void) dealloc {
   180     [versionLabel release];
   192     [versionLabel release];
   181     [settingsViewController release];
   193     [settingsViewController release];
   182     [gameConfigViewController release];
   194     [gameConfigViewController release];
       
   195     [aboutViewController release];
   183     [super dealloc];
   196     [super dealloc];
   184 }
   197 }
   185 
   198 
   186 @end
   199 @end