project_files/HedgewarsMobile/Classes/GameConfigViewController.m
changeset 6108 7a8da11a6144
parent 6080 ce02ddfe8aa1
child 6115 485cfecadc9a
equal deleted inserted replaced
6107:0741c0f0203e 6108:7a8da11a6144
    70         case 2:
    70         case 2:
    71             [AudioManagerController playClickSound];
    71             [AudioManagerController playClickSound];
    72             if (self.helpPage == nil)
    72             if (self.helpPage == nil)
    73                 self.helpPage = [[HelpPageViewController alloc] initWithNibName:@"HelpPageLobbyViewController-iPad" bundle:nil];
    73                 self.helpPage = [[HelpPageViewController alloc] initWithNibName:@"HelpPageLobbyViewController-iPad" bundle:nil];
    74             self.helpPage.view.alpha = 0;
    74             self.helpPage.view.alpha = 0;
    75             [self.view addSubview:helpPage.view];
    75             [self.view addSubview:self.helpPage.view];
    76             [UIView beginAnimations:@"helplobby" context:NULL];
    76             [UIView beginAnimations:@"helplobby" context:NULL];
    77             self.helpPage.view.alpha = 1;
    77             self.helpPage.view.alpha = 1;
    78             [UIView commitAnimations];
    78             [UIView commitAnimations];
    79             break;
    79             break;
    80         default:
    80         default:
   303         // load other controllers and the background
   303         // load other controllers and the background
   304         if (self.mapConfigViewController == nil)
   304         if (self.mapConfigViewController == nil)
   305             self.mapConfigViewController = [[MapConfigViewController alloc] initWithNibName:@"MapConfigViewController-iPad" bundle:nil];
   305             self.mapConfigViewController = [[MapConfigViewController alloc] initWithNibName:@"MapConfigViewController-iPad" bundle:nil];
   306 
   306 
   307         UILabel *theLabel;
   307         UILabel *theLabel;
   308         // left column
       
   309         theLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 60, 320, 620) andTitle:nil withBorderWidth:2.7f];
       
   310         [self.mapConfigViewController.view addSubview:theLabel];
       
   311         releaseAndNil(theLabel);
       
   312         // center column
       
   313         theLabel = [[UILabel alloc] initWithFrame:CGRectMake(337, 187, 350, 505) andTitle:nil withBorderWidth:2.7f];
       
   314         [self.mapConfigViewController.view addSubview:theLabel];
       
   315         releaseAndNil(theLabel);
       
   316         // right column
       
   317         theLabel = [[UILabel alloc] initWithFrame:CGRectMake(704, 214, 320, 466) andTitle:nil withBorderWidth:2.7f];
       
   318         [self.mapConfigViewController.view addSubview:theLabel];
       
   319         releaseAndNil(theLabel);
       
   320         // top right column (map)
   308         // top right column (map)
   321         theLabel = [[UILabel alloc] initWithFrame:CGRectMake(714, 14, 300, 190) andTitle:nil withBorderWidth:2.3f];
   309         theLabel = [[UILabel alloc] initWithFrame:CGRectMake(714, 14, 300, 190) andTitle:nil withBorderWidth:2.3f];
   322         [self.mapConfigViewController.view addSubview:theLabel];
   310         [self.mapConfigViewController.view addSubview:theLabel];
   323         releaseAndNil(theLabel);
   311         releaseAndNil(theLabel);
   324         // bottom left
   312         // bottom left
   325         theLabel = [[UILabel alloc] initWithFrame:CGRectMake(110, 714, 320, 40) andTitle:nil withBorderWidth:2.0f];
   313         theLabel = [[UILabel alloc] initWithFrame:CGRectMake(116, 714, 310, 40) andTitle:nil withBorderWidth:2.0f];
   326         [self.mapConfigViewController.view addSubview:theLabel];
   314         [self.mapConfigViewController.view addSubview:theLabel];
   327         releaseAndNil(theLabel);
   315         releaseAndNil(theLabel);
   328         // bottom right
   316         // bottom right
   329         theLabel = [[UILabel alloc] initWithFrame:CGRectMake(596, 714, 320, 40)
   317         theLabel = [[UILabel alloc] initWithFrame:CGRectMake(598, 714, 310, 40)
   330                                          andTitle:NSLocalizedString(@"          Max Hogs:",@"")
   318                                          andTitle:NSLocalizedString(@"          Max Hogs:",@"")
   331                                   withBorderWidth:2.0f];
   319                                   withBorderWidth:2.0f];
   332         theLabel.font = [UIFont italicSystemFontOfSize:[UIFont labelFontSize]];
   320         theLabel.font = [UIFont italicSystemFontOfSize:[UIFont labelFontSize]];
   333         theLabel.textColor = [UIColor lightYellowColor];
   321         theLabel.textColor = [UIColor whiteColor];
   334         theLabel.textAlignment = UITextAlignmentLeft;
   322         theLabel.textAlignment = UITextAlignmentLeft;
   335         [self.mapConfigViewController.view addSubview:theLabel];
   323         [self.mapConfigViewController.view addSubview:theLabel];
   336         releaseAndNil(theLabel);
   324         releaseAndNil(theLabel);
   337 
   325 
   338         [self.mapConfigViewController.view bringSubviewToFront:self.mapConfigViewController.maxLabel];
   326         [self.mapConfigViewController.view bringSubviewToFront:self.mapConfigViewController.maxLabel];
   346             self.teamConfigViewController = [[TeamConfigViewController alloc] initWithStyle:UITableViewStyleGrouped];
   334             self.teamConfigViewController = [[TeamConfigViewController alloc] initWithStyle:UITableViewStyleGrouped];
   347         [self.mapConfigViewController.view addSubview:self.teamConfigViewController.view];
   335         [self.mapConfigViewController.view addSubview:self.teamConfigViewController.view];
   348         if (self.schemeWeaponConfigViewController == nil)
   336         if (self.schemeWeaponConfigViewController == nil)
   349             self.schemeWeaponConfigViewController = [[SchemeWeaponConfigViewController alloc] initWithStyle:UITableViewStyleGrouped];
   337             self.schemeWeaponConfigViewController = [[SchemeWeaponConfigViewController alloc] initWithStyle:UITableViewStyleGrouped];
   350         [self.mapConfigViewController.view addSubview:schemeWeaponConfigViewController.view];
   338         [self.mapConfigViewController.view addSubview:schemeWeaponConfigViewController.view];
       
   339 
   351         self.mapConfigViewController.view.frame = CGRectMake(0, 0, screen.size.height, screen.size.width);
   340         self.mapConfigViewController.view.frame = CGRectMake(0, 0, screen.size.height, screen.size.width);
   352         self.teamConfigViewController.view.frame = CGRectMake(348, 200, 328, 480);
   341         self.schemeWeaponConfigViewController.view.frame = CGRectMake(0, 60, 320, 620);
   353         self.schemeWeaponConfigViewController.view.frame = CGRectMake(10, 70, 300, 600);
   342         self.teamConfigViewController.view.frame = CGRectMake(337, 187, 350, 505);
   354 
   343 
   355         self.mapConfigViewController.parentController = self;
   344         self.mapConfigViewController.parentController = self;
   356     } else {
   345     } else {
   357         // this is the visible controller
   346         // this is the visible controller
   358         if (self.mapConfigViewController == nil)
   347         if (self.mapConfigViewController == nil)