project_files/HedgewarsMobile/Classes/GameConfigViewController.m
changeset 6078 8c0cc07731e5
parent 6000 dbcebcd3d79f
child 6079 c10767edcd58
equal deleted inserted replaced
6077:d8fa5a85d24f 6078:8c0cc07731e5
    23 #import "MapConfigViewController.h"
    23 #import "MapConfigViewController.h"
    24 #import "TeamConfigViewController.h"
    24 #import "TeamConfigViewController.h"
    25 #import "SchemeWeaponConfigViewController.h"
    25 #import "SchemeWeaponConfigViewController.h"
    26 #import "HelpPageViewController.h"
    26 #import "HelpPageViewController.h"
    27 #import "GameInterfaceBridge.h"
    27 #import "GameInterfaceBridge.h"
    28 #import "CommodityFunctions.h"
    28 
    29 #import "UIImageExtra.h"
       
    30 #import "PascalImports.h"
       
    31 
    29 
    32 @implementation GameConfigViewController
    30 @implementation GameConfigViewController
    33 @synthesize imgContainer, helpPage, mapConfigViewController, teamConfigViewController, schemeWeaponConfigViewController, interfaceBridge;
    31 @synthesize imgContainer, helpPage, mapConfigViewController, teamConfigViewController, schemeWeaponConfigViewController, interfaceBridge;
    34 
    32 
    35 
    33 
   277 
   275 
   278     CGRect screen = [[UIScreen mainScreen] bounds];
   276     CGRect screen = [[UIScreen mainScreen] bounds];
   279     self.view.frame = CGRectMake(0, 0, screen.size.height, screen.size.width);
   277     self.view.frame = CGRectMake(0, 0, screen.size.height, screen.size.width);
   280 
   278 
   281     if (IS_IPAD()) {
   279     if (IS_IPAD()) {
   282         // load other controllers
   280         // load other controllers and the background
   283         if (self.mapConfigViewController == nil)
   281         if (self.mapConfigViewController == nil)
   284             self.mapConfigViewController = [[MapConfigViewController alloc] initWithNibName:@"MapConfigViewController-iPad" bundle:nil];
   282             self.mapConfigViewController = [[MapConfigViewController alloc] initWithNibName:@"MapConfigViewController-iPad" bundle:nil];
   285 
   283 
   286         UILabel *leftBackground = createLabelWithParams(nil, CGRectMake(0, 60, 320, 620), 2.7f, UICOLOR_HW_YELLOW_BODER, UICOLOR_HW_ALPHABLUE);
   284         UILabel *theLabel;
   287         [self.mapConfigViewController.view addSubview:leftBackground];
   285         // left column
   288         [leftBackground release];
   286         theLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 60, 320, 620) andTitle:nil withBorderWidth:2.7f];
   289         UILabel *middleBackground = createLabelWithParams(nil, CGRectMake(337, 187, 350, 505), 2.7f, UICOLOR_HW_YELLOW_BODER, UICOLOR_HW_ALPHABLUE);
   287         [self.mapConfigViewController.view addSubview:theLabel];
   290         [self.mapConfigViewController.view addSubview:middleBackground];
   288         releaseAndNil(theLabel);
   291         [middleBackground release];
   289         // center column
   292         UILabel *rightBackground = createLabelWithParams(nil, CGRectMake(704, 214, 320, 464), 2.7f, UICOLOR_HW_YELLOW_BODER, UICOLOR_HW_ALPHABLUE);
   290         theLabel = [[UILabel alloc] initWithFrame:CGRectMake(337, 187, 350, 505) andTitle:nil withBorderWidth:2.7f];
   293         [self.mapConfigViewController.view addSubview:rightBackground];
   291         [self.mapConfigViewController.view addSubview:theLabel];
   294         [rightBackground release];
   292         releaseAndNil(theLabel);
   295         UILabel *topBackground = createLabelWithParams(nil, CGRectMake(714, 14, 300, 190), 2.3f, UICOLOR_HW_YELLOW_BODER, UICOLOR_HW_ALPHABLUE);
   293         // right column
   296         [self.mapConfigViewController.view addSubview:topBackground];
   294         theLabel = [[UILabel alloc] initWithFrame:CGRectMake(704, 214, 320, 464) andTitle:nil withBorderWidth:2.7f];
   297         [topBackground release];
   295         [self.mapConfigViewController.view addSubview:theLabel];
   298         UILabel *bottomLeftBackground = createLabelWithParams(nil, CGRectMake(106, 714, 320, 40), 2.0f, UICOLOR_HW_YELLOW_BODER, UICOLOR_HW_ALPHABLUE);
   296         releaseAndNil(theLabel);
   299         [self.mapConfigViewController.view addSubview:bottomLeftBackground];
   297         // top right column (map)
   300         [bottomLeftBackground release];
   298         theLabel = [[UILabel alloc] initWithFrame:CGRectMake(714, 14, 300, 190) andTitle:nil withBorderWidth:2.3f];
   301         UILabel *bottomRightBackground = createLabelWithParams(NSLocalizedString(@"Max Hogs:                 ",@""), CGRectMake(594, 714, 320, 40), 2.0f, UICOLOR_HW_YELLOW_BODER, UICOLOR_HW_ALPHABLUE);
   299         [self.mapConfigViewController.view addSubview:theLabel];
   302         bottomRightBackground.font = [UIFont italicSystemFontOfSize:[UIFont labelFontSize]];
   300         releaseAndNil(theLabel);
   303         [self.mapConfigViewController.view addSubview:bottomRightBackground];
   301         // bottom left
   304         [bottomRightBackground release];
   302         theLabel = [[UILabel alloc] initWithFrame:CGRectMake(106, 714, 320, 40) andTitle:nil withBorderWidth:2.0f];
       
   303         [self.mapConfigViewController.view addSubview:theLabel];
       
   304         releaseAndNil(theLabel);
       
   305         // bottom right
       
   306         theLabel = [[UILabel alloc] initWithFrame:CGRectMake(594, 714, 320, 40)
       
   307                                          andTitle:NSLocalizedString(@"Max Hogs:                 ",@"")
       
   308                                   withBorderWidth:2.0f];
       
   309         theLabel.font = [UIFont italicSystemFontOfSize:[UIFont labelFontSize]];
       
   310         [self.mapConfigViewController.view addSubview:theLabel];
       
   311         releaseAndNil(theLabel);
       
   312 
   305         [self.mapConfigViewController.view bringSubviewToFront:self.mapConfigViewController.maxLabel];
   313         [self.mapConfigViewController.view bringSubviewToFront:self.mapConfigViewController.maxLabel];
   306         [self.mapConfigViewController.view bringSubviewToFront:self.mapConfigViewController.sizeLabel];
   314         [self.mapConfigViewController.view bringSubviewToFront:self.mapConfigViewController.sizeLabel];
   307         [self.mapConfigViewController.view bringSubviewToFront:self.mapConfigViewController.segmentedControl];
   315         [self.mapConfigViewController.view bringSubviewToFront:self.mapConfigViewController.segmentedControl];
   308         [self.mapConfigViewController.view bringSubviewToFront:self.mapConfigViewController.previewButton];
   316         [self.mapConfigViewController.view bringSubviewToFront:self.mapConfigViewController.previewButton];
   309         [self.mapConfigViewController.view bringSubviewToFront:self.mapConfigViewController.slider];
   317         [self.mapConfigViewController.view bringSubviewToFront:self.mapConfigViewController.slider];