cocoaTouch/MainMenuViewController.m
changeset 2694 dcd248e04f3d
parent 2687 28b8330b8af1
child 2723 eaa6ac1e95ea
equal deleted inserted replaced
2693:3207e0eacd43 2694:dcd248e04f3d
    24 */
    24 */
    25 
    25 
    26 
    26 
    27 // Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
    27 // Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
    28 -(void) viewDidLoad {
    28 -(void) viewDidLoad {
    29 	self.versionLabel = @"Hedgewars version 0.9.13-dev";
    29 	self.versionLabel.text = @"Hedgewars version 0.9.13-dev";
    30     [super viewDidLoad];
    30     [super viewDidLoad];
    31 }
    31 }
    32 
    32 
    33 /*
    33 /*
    34 // Override to allow orientations other than the default portrait orientation.
    34 // Override to allow orientations other than the default portrait orientation.
    35 - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    35 - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    36     // Return YES for supported orientations
    36     // Return YES for supported orientations
    37     return (interfaceOrientation == UIInterfaceOrientationPortrait);
    37     return (interfaceOrientation == UIInterfaceOrientationPortrait);
    38 }
    38 }
    39 */
    39 */
    40 
    40 /*
    41 - (void)didReceiveMemoryWarning {
    41 - (void)didReceiveMemoryWarning {
    42 	// Releases the view if it doesn't have a superview.
    42 	// Releases the view if it doesn't have a superview.
    43     [super didReceiveMemoryWarning];
    43     [super didReceiveMemoryWarning];
    44 	
    44 	
    45 	// Release any cached data, images, etc that aren't in use.
    45 	// Release any cached data, images, etc that aren't in use.
    46 }
    46 }
       
    47 */
    47 
    48 
    48 - (void)viewDidUnload {
    49 - (void)viewDidUnload {
    49 	// Release any retained subviews of the main view.
    50 	// Release any retained subviews of the main view.
    50 	self.passandplayButton = nil;
    51 	self.passandplayButton = nil;
    51 	self.netplayButton = nil;
    52 	self.netplayButton = nil;
    59 	[storeButton release];
    60 	[storeButton release];
    60 	[versionLabel release];
    61 	[versionLabel release];
    61     [super dealloc];
    62     [super dealloc];
    62 }
    63 }
    63 
    64 
       
    65 // disable the buttons when to prevent launching twice the game
       
    66 -(void) viewWillDisappear:(BOOL)animated {
       
    67 	passandplayButton.enabled = NO;
       
    68 	netplayButton.enabled = NO;
       
    69 	storeButton.enabled = NO;
       
    70 	[super viewWillDisappear:animated];
       
    71 }
       
    72 
       
    73 -(void) viewWillAppear:(BOOL)animated {
       
    74 	passandplayButton.enabled = YES;
       
    75 	netplayButton.enabled = YES;
       
    76 	storeButton.enabled = YES;
       
    77 	[super viewWillAppear:animated];
       
    78 }
       
    79 
    64 -(IBAction) startPlaying {
    80 -(IBAction) startPlaying {
    65 	// TODO: support IPC and start a thread
       
    66 	
       
    67 	[[SDLUIKitDelegate sharedAppDelegate] startSDLgame];
    81 	[[SDLUIKitDelegate sharedAppDelegate] startSDLgame];
    68 }
    82 }
    69 
    83 
    70 -(IBAction) notYetImplemented {
    84 -(IBAction) notYetImplemented {
    71 	UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Not Yet Implemented"
    85 	UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Not Yet Implemented"