7 // |
7 // |
8 |
8 |
9 #import "GameConfigViewController.h" |
9 #import "GameConfigViewController.h" |
10 #import "SDL_uikitappdelegate.h" |
10 #import "SDL_uikitappdelegate.h" |
11 #import "CommodityFunctions.h" |
11 #import "CommodityFunctions.h" |
12 #import "MapConfigViewController.h" |
|
13 #import "TeamConfigViewController.h" |
12 #import "TeamConfigViewController.h" |
14 #import "SchemeWeaponConfigViewController.h" |
13 #import "SchemeWeaponConfigViewController.h" |
15 |
14 |
16 // draw background image in uitoolbar |
15 |
17 /*@implementation UIToolbar (CustomImage) |
|
18 -(void) drawRect:(CGRect)rect { |
|
19 UIImage *image = [UIImage imageWithContentsOfFile:@"toolbarBackground.png"]; |
|
20 [image drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)]; |
|
21 } |
|
22 @end |
|
23 */ |
|
24 @implementation GameConfigViewController |
16 @implementation GameConfigViewController |
25 |
17 |
26 |
18 |
27 -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { |
19 -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { |
28 return rotationManager(interfaceOrientation); |
20 return rotationManager(interfaceOrientation); |
195 self.view.frame = CGRectMake(0, 0, screen.size.height, screen.size.width); |
187 self.view.frame = CGRectMake(0, 0, screen.size.height, screen.size.width); |
196 |
188 |
197 if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { |
189 if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { |
198 if (mapConfigViewController == nil) |
190 if (mapConfigViewController == nil) |
199 mapConfigViewController = [[MapConfigViewController alloc] initWithNibName:@"MapConfigViewController-iPad" bundle:nil]; |
191 mapConfigViewController = [[MapConfigViewController alloc] initWithNibName:@"MapConfigViewController-iPad" bundle:nil]; |
|
192 mapConfigViewController.delegate = self; |
200 if (teamConfigViewController == nil) |
193 if (teamConfigViewController == nil) |
201 teamConfigViewController = [[TeamConfigViewController alloc] initWithStyle:UITableViewStyleGrouped]; |
194 teamConfigViewController = [[TeamConfigViewController alloc] initWithStyle:UITableViewStyleGrouped]; |
202 teamConfigViewController.view.frame = CGRectMake(10, 225, 300, 470); |
195 teamConfigViewController.view.frame = CGRectMake(10, 70, 300, 600); |
203 teamConfigViewController.view.backgroundColor = [UIColor clearColor]; |
196 teamConfigViewController.view.backgroundColor = [UIColor clearColor]; |
204 [mapConfigViewController.view addSubview:teamConfigViewController.view]; |
197 [mapConfigViewController.view addSubview:teamConfigViewController.view]; |
205 if (schemeWeaponConfigViewController == nil) |
198 if (schemeWeaponConfigViewController == nil) |
206 schemeWeaponConfigViewController = [[SchemeWeaponConfigViewController alloc] initWithStyle:UITableViewStyleGrouped]; |
199 schemeWeaponConfigViewController = [[SchemeWeaponConfigViewController alloc] initWithStyle:UITableViewStyleGrouped]; |
207 schemeWeaponConfigViewController.view.frame = CGRectMake(362, 230, 300, 470); |
200 schemeWeaponConfigViewController.view.frame = CGRectMake(362, 200, 300, 480); |
208 [mapConfigViewController.view addSubview:schemeWeaponConfigViewController.view]; |
201 [mapConfigViewController.view addSubview:schemeWeaponConfigViewController.view]; |
209 for (UIView *oneView in self.view.subviews) { |
202 for (UIView *oneView in self.view.subviews) { |
210 if ([oneView isMemberOfClass:[UIToolbar class]]) { |
203 if ([oneView isMemberOfClass:[UIToolbar class]]) { |
211 [oneView setHidden:YES]; |
204 [oneView setHidden:YES]; |
212 break; |
205 break; |