cocoaTouch/GameConfigViewController.m
changeset 3374 0d522416d97f
parent 3373 c1ff724a5c34
child 3487 b1d00f1950c8
equal deleted inserted replaced
3373:c1ff724a5c34 3374:0d522416d97f
    11 #import "CommodityFunctions.h"
    11 #import "CommodityFunctions.h"
    12 #import "MapConfigViewController.h"
    12 #import "MapConfigViewController.h"
    13 #import "TeamConfigViewController.h"
    13 #import "TeamConfigViewController.h"
    14 
    14 
    15 @implementation GameConfigViewController
    15 @implementation GameConfigViewController
    16 @synthesize availableTeamsTableView, weaponsButton, schemesButton, mapButton, randomButton, startButton;
       
    17 
    16 
    18 
    17 
    19 -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    18 -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    20     return rotationManager(interfaceOrientation);
    19     return rotationManager(interfaceOrientation);
    21 }
    20 }
   103     [[self parentViewController] dismissModalViewControllerAnimated:YES];
   102     [[self parentViewController] dismissModalViewControllerAnimated:YES];
   104     [[SDLUIKitDelegate sharedAppDelegate] startSDLgame];
   103     [[SDLUIKitDelegate sharedAppDelegate] startSDLgame];
   105 }
   104 }
   106 
   105 
   107 -(void) viewDidLoad {
   106 -(void) viewDidLoad {
   108     mapConfigViewController = [[MapConfigViewController alloc] initWithNibName:@"MapConfigViewController-iPhone" bundle:nil];
   107     if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
       
   108         mapConfigViewController = [[MapConfigViewController alloc] initWithNibName:@"MapConfigViewController-iPad" bundle:nil];
       
   109         teamConfigViewController = [[TeamConfigViewController alloc] initWithStyle:UITableViewStylePlain];
       
   110         teamConfigViewController.view.frame = CGRectMake(0, 224, 300, 500);
       
   111         teamConfigViewController.view.backgroundColor = [UIColor clearColor];
       
   112         [mapConfigViewController.view addSubview:teamConfigViewController.view];
       
   113     } else
       
   114         mapConfigViewController = [[MapConfigViewController alloc] initWithNibName:@"MapConfigViewController-iPhone" bundle:nil];
   109     activeController = mapConfigViewController;
   115     activeController = mapConfigViewController;
   110     
   116     
   111     [self.view addSubview:mapConfigViewController.view];
   117     [self.view addSubview:mapConfigViewController.view];
   112     
   118     
   113     [super viewDidLoad];
   119     [super viewDidLoad];
   137 -(void) viewDidUnload {
   143 -(void) viewDidUnload {
   138     NSLog(@"unloading");
   144     NSLog(@"unloading");
   139     activeController = nil;
   145     activeController = nil;
   140     mapConfigViewController = nil;
   146     mapConfigViewController = nil;
   141     teamConfigViewController = nil;
   147     teamConfigViewController = nil;
   142     self.availableTeamsTableView = nil;
       
   143     self.weaponsButton = nil;
       
   144     self.schemesButton = nil;
       
   145     self.mapButton = nil;
       
   146     self.randomButton = nil;
       
   147     self.startButton = nil;
       
   148     [super viewDidUnload];
   148     [super viewDidUnload];
   149 }
   149 }
   150 
   150 
   151 
   151 
   152 -(void) dealloc {
   152 -(void) dealloc {
   153     [activeController release];
   153     [activeController release];
   154     [mapConfigViewController release];
   154     [mapConfigViewController release];
   155     [teamConfigViewController release];
   155     [teamConfigViewController release];
   156     [availableTeamsTableView release];
       
   157     [weaponsButton release];
       
   158     [schemesButton release];
       
   159     [mapButton release];
       
   160     [randomButton release];
       
   161     [startButton release];
       
   162     [super dealloc];
   156     [super dealloc];
   163 }
   157 }
   164 
   158 
   165 @end
   159 @end