cocoaTouch/GameConfigViewController.m
author smxx
Mon, 19 Apr 2010 13:31:08 +0000
changeset 3359 d17b9f6adae5
parent 3356 3ae3fccb439e
child 3361 cfc6cd502f85
permissions -rw-r--r--
Engine: * Let gears collide once they significantly leave visible area (might need more testing) * Added skipping sound to gears skipping on water surface Frontend: * Fixed loading/saving of control bindings
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3356
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
     1
    //
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
     2
//  GameConfigViewController.m
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
     3
//  HedgewarsMobile
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
     4
//
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
     5
//  Created by Vittorio on 18/04/10.
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
     6
//  Copyright 2010 __MyCompanyName__. All rights reserved.
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
     7
//
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
     8
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
     9
#import "GameConfigViewController.h"
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    10
#import "SDL_uikitappdelegate.h"
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    11
#import "CommodityFunctions.h"
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    12
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    13
@implementation GameConfigViewController
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    14
@synthesize availableTeamsTableView, backButton, weaponsButton, schemesButton, mapButton, randomButton, startButton;
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    15
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    16
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    17
-(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    18
    return rotationManager(interfaceOrientation);
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    19
}
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    20
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    21
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    22
-(IBAction) buttonPressed:(id) sender {
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    23
    UIButton *theButton = (UIButton *)sender;
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    24
    switch (theButton.tag) {
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    25
        case 0:
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    26
            [[NSNotificationCenter defaultCenter] postNotificationName:@"dismissModalView" object:nil];
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    27
            break;
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    28
        case 1:
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    29
            [[NSNotificationCenter defaultCenter] postNotificationName:@"dismissModalView" object:nil];
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    30
            [self performSelector:@selector(startSDLgame)
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    31
                       withObject:nil
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    32
                       afterDelay:0.4];
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    33
            break;
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    34
    }
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    35
}
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    36
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    37
-(void) startSDLgame {
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    38
    [[SDLUIKitDelegate sharedAppDelegate] startSDLgame];
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    39
}
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    40
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    41
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    42
- (void)viewDidLoad {
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    43
    self.view.frame = CGRectMake(0, 0, 1024, 1024);
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    44
    [super viewDidLoad];
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    45
}
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    46
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    47
-(void) didReceiveMemoryWarning {
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    48
    // Releases the view if it doesn't have a superview.
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    49
    [super didReceiveMemoryWarning];
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    50
    // Release any cached data, images, etc that aren't in use.
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    51
}
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    52
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    53
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    54
-(void) viewDidUnload {
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    55
    self.availableTeamsTableView = nil;
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    56
    self.backButton = nil;
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    57
    self.weaponsButton = nil;
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    58
    self.schemesButton = nil;
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    59
    self.mapButton = nil;
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    60
    self.randomButton = nil;
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    61
    self.startButton = nil;
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    62
    [super viewDidUnload];
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    63
}
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    64
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    65
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    66
-(void) dealloc {
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    67
    [availableTeamsTableView release];
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    68
    [backButton release];
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    69
    [weaponsButton release];
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    70
    [schemesButton release];
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    71
    [mapButton release];
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    72
    [randomButton release];
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    73
    [startButton release];
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    74
    [super dealloc];
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    75
}
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    76
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    77
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    78
@end