project_files/HedgewarsMobile/Classes/GameConfigViewController.m
changeset 6636 4450e746dc34
parent 6634 e00762923086
child 6678 beab48f963d5
equal deleted inserted replaced
6634:e00762923086 6636:4450e746dc34
   274         [self.imgContainer addSubview:hog];
   274         [self.imgContainer addSubview:hog];
   275         [hog startAnimating];
   275         [hog startAnimating];
   276         [hog release];
   276         [hog release];
   277     }
   277     }
   278 
   278 
       
   279     // don't place the nice hogs if there is no space for them
       
   280     if ((self.interfaceOrientation == UIInterfaceOrientationPortrait ||
       
   281          self.interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown))
       
   282         self.imgContainer.alpha = 0;
       
   283 
   279     [self.view addSubview:self.imgContainer];
   284     [self.view addSubview:self.imgContainer];
   280     [hogSprite release];
   285     [hogSprite release];
   281     [pool drain];
   286     [pool drain];
   282 }
   287 }
   283 
   288 
   319     if (IS_IPAD() == NO)
   324     if (IS_IPAD() == NO)
   320         return;
   325         return;
   321 
   326 
   322     if ((toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft ||
   327     if ((toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft ||
   323          toInterfaceOrientation == UIInterfaceOrientationLandscapeRight)) {
   328          toInterfaceOrientation == UIInterfaceOrientationLandscapeRight)) {
   324         if (self.imgContainer == nil)
       
   325             [NSThread detachNewThreadSelector:@selector(loadNiceHogs) toTarget:self withObject:nil];
       
   326 
       
   327         self.imgContainer.alpha = 1;
   329         self.imgContainer.alpha = 1;
   328         self.titleImage.frame = CGRectMake(357, 17, 309, 165);
   330         self.titleImage.frame = CGRectMake(357, 17, 309, 165);
   329         self.schemeWeaponConfigViewController.view.frame = CGRectMake(0, 60, 320, 620);
   331         self.schemeWeaponConfigViewController.view.frame = CGRectMake(0, 60, 320, 620);
   330         self.mapConfigViewController.view.frame = CGRectMake(704, 0, 320, 680);
   332         self.mapConfigViewController.view.frame = CGRectMake(704, 0, 320, 680);
   331         self.teamConfigViewController.view.frame = CGRectMake(337, 187, 350, 505);
   333         self.teamConfigViewController.view.frame = CGRectMake(337, 187, 350, 505);
   340         self.teamConfigViewController.view.frame = CGRectMake(170, 590, 428, 366);
   342         self.teamConfigViewController.view.frame = CGRectMake(170, 590, 428, 366);
   341         self.mapConfigViewController.maxLabel.frame = CGRectMake(104, 975, 200, 40);
   343         self.mapConfigViewController.maxLabel.frame = CGRectMake(104, 975, 200, 40);
   342         self.sliderBackground.frame = CGRectMake(465, 975, 200, 40);
   344         self.sliderBackground.frame = CGRectMake(465, 975, 200, 40);
   343         self.mapConfigViewController.slider.frame = CGRectMake(475, 983, 180, 23);
   345         self.mapConfigViewController.slider.frame = CGRectMake(475, 983, 180, 23);
   344     }
   346     }
       
   347 
       
   348     [self.schemeWeaponConfigViewController willAnimateRotationToInterfaceOrientation:toInterfaceOrientation
       
   349                                                                             duration:duration];
   345 }
   350 }
   346 
   351 
   347 -(void) viewWillAppear:(BOOL)animated {
   352 -(void) viewWillAppear:(BOOL)animated {
   348     // load hogs only on iPad and when interface allows enough space
   353     if (IS_IPAD())
   349     if (IS_IPAD() && (self.interfaceOrientation == UIInterfaceOrientationLandscapeLeft ||
       
   350                       self.interfaceOrientation == UIInterfaceOrientationLandscapeRight))
       
   351         [NSThread detachNewThreadSelector:@selector(loadNiceHogs) toTarget:self withObject:nil];
   354         [NSThread detachNewThreadSelector:@selector(loadNiceHogs) toTarget:self withObject:nil];
   352 
   355 
   353     [self.mapConfigViewController viewWillAppear:animated];
   356     [self.mapConfigViewController viewWillAppear:animated];
   354     [self.teamConfigViewController viewWillAppear:animated];
   357     [self.teamConfigViewController viewWillAppear:animated];
   355     [self.schemeWeaponConfigViewController viewWillAppear:animated];
   358     [self.schemeWeaponConfigViewController viewWillAppear:animated];