project_files/HedgewarsMobile/Classes/GameConfigViewController.m
changeset 3619 1155d8970646
parent 3616 85d69ddb41b6
child 3623 f14db208f2fa
equal deleted inserted replaced
3618:337a27d62016 3619:1155d8970646
    10 #import "SDL_uikitappdelegate.h"
    10 #import "SDL_uikitappdelegate.h"
    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 #import "SchemeWeaponConfigViewController.h"
    14 #import "SchemeWeaponConfigViewController.h"
       
    15 
       
    16 // draw background image in uitoolbar
       
    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
    15 
    23 
    16 @implementation GameConfigViewController
    24 @implementation GameConfigViewController
    17 
    25 
    18 
    26 
    19 -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    27 -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
   153         teamConfigViewController.view.backgroundColor = [UIColor clearColor];
   161         teamConfigViewController.view.backgroundColor = [UIColor clearColor];
   154         [mapConfigViewController.view addSubview:teamConfigViewController.view];
   162         [mapConfigViewController.view addSubview:teamConfigViewController.view];
   155         if (schemeWeaponConfigViewController == nil)
   163         if (schemeWeaponConfigViewController == nil)
   156             schemeWeaponConfigViewController = [[SchemeWeaponConfigViewController alloc] initWithStyle:UITableViewStyleGrouped];
   164             schemeWeaponConfigViewController = [[SchemeWeaponConfigViewController alloc] initWithStyle:UITableViewStyleGrouped];
   157         schemeWeaponConfigViewController.view.frame = CGRectMake(362, 224, 300, 500);
   165         schemeWeaponConfigViewController.view.frame = CGRectMake(362, 224, 300, 500);
   158         schemeWeaponConfigViewController.view.backgroundColor = [UIColor clearColor];
       
   159         [mapConfigViewController.view addSubview:schemeWeaponConfigViewController.view];
   166         [mapConfigViewController.view addSubview:schemeWeaponConfigViewController.view];
   160         for (UIView *oneView in self.view.subviews) {
   167         for (UIView *oneView in self.view.subviews) {
   161             if ([oneView isMemberOfClass:[UIToolbar class]]) {
   168             if ([oneView isMemberOfClass:[UIToolbar class]]) {
   162                 [[oneView viewWithTag:12345] setHidden:YES];
   169                 [[oneView viewWithTag:12345] setHidden:YES];
   163                 break;
   170                 break;