3356
|
1 |
//
|
|
2 |
// GameConfigViewController.m
|
|
3 |
// HedgewarsMobile
|
|
4 |
//
|
|
5 |
// Created by Vittorio on 18/04/10.
|
|
6 |
// Copyright 2010 __MyCompanyName__. All rights reserved.
|
|
7 |
//
|
|
8 |
|
|
9 |
#import "GameConfigViewController.h"
|
|
10 |
#import "SDL_uikitappdelegate.h"
|
|
11 |
#import "CommodityFunctions.h"
|
|
12 |
|
|
13 |
@implementation GameConfigViewController
|
|
14 |
@synthesize availableTeamsTableView, backButton, weaponsButton, schemesButton, mapButton, randomButton, startButton;
|
|
15 |
|
|
16 |
|
|
17 |
-(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
|
|
18 |
return rotationManager(interfaceOrientation);
|
|
19 |
}
|
|
20 |
|
|
21 |
|
|
22 |
-(IBAction) buttonPressed:(id) sender {
|
|
23 |
UIButton *theButton = (UIButton *)sender;
|
|
24 |
switch (theButton.tag) {
|
|
25 |
case 0:
|
|
26 |
[[NSNotificationCenter defaultCenter] postNotificationName:@"dismissModalView" object:nil];
|
|
27 |
break;
|
|
28 |
case 1:
|
|
29 |
[[NSNotificationCenter defaultCenter] postNotificationName:@"dismissModalView" object:nil];
|
|
30 |
[self performSelector:@selector(startSDLgame)
|
|
31 |
withObject:nil
|
|
32 |
afterDelay:0.4];
|
|
33 |
break;
|
|
34 |
}
|
|
35 |
}
|
|
36 |
|
|
37 |
-(void) startSDLgame {
|
|
38 |
[[SDLUIKitDelegate sharedAppDelegate] startSDLgame];
|
|
39 |
}
|
|
40 |
|
|
41 |
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
|
|
42 |
- (void)viewDidLoad {
|
|
43 |
self.view.frame = CGRectMake(0, 0, 1024, 1024);
|
|
44 |
[super viewDidLoad];
|
|
45 |
}
|
|
46 |
|
|
47 |
-(void) didReceiveMemoryWarning {
|
|
48 |
// Releases the view if it doesn't have a superview.
|
|
49 |
[super didReceiveMemoryWarning];
|
|
50 |
// Release any cached data, images, etc that aren't in use.
|
|
51 |
}
|
|
52 |
|
|
53 |
|
|
54 |
-(void) viewDidUnload {
|
|
55 |
self.availableTeamsTableView = nil;
|
|
56 |
self.backButton = nil;
|
|
57 |
self.weaponsButton = nil;
|
|
58 |
self.schemesButton = nil;
|
|
59 |
self.mapButton = nil;
|
|
60 |
self.randomButton = nil;
|
|
61 |
self.startButton = nil;
|
|
62 |
[super viewDidUnload];
|
|
63 |
}
|
|
64 |
|
|
65 |
|
|
66 |
-(void) dealloc {
|
|
67 |
[availableTeamsTableView release];
|
|
68 |
[backButton release];
|
|
69 |
[weaponsButton release];
|
|
70 |
[schemesButton release];
|
|
71 |
[mapButton release];
|
|
72 |
[randomButton release];
|
|
73 |
[startButton release];
|
|
74 |
[super dealloc];
|
|
75 |
}
|
|
76 |
|
|
77 |
|
|
78 |
@end
|