project_files/HedgewarsMobile/Classes/GameConfigViewController.m
branchios-revival
changeset 11132 ccf095d96ef4
parent 11123 bd58a851eb8d
child 11137 14f50dde3e8c
equal deleted inserted replaced
11125:432601e160b4 11132:ccf095d96ef4
   323 
   323 
   324 -(void) willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval) duration {
   324 -(void) willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval) duration {
   325     if (IS_IPAD() == NO)
   325     if (IS_IPAD() == NO)
   326         return;
   326         return;
   327 
   327 
   328     [self updateUIForInterfaceOrientation:toInterfaceOrientation];
   328     [self updateiPadUIForInterfaceOrientation:toInterfaceOrientation];
   329 
   329 
   330     [self.schemeWeaponConfigViewController willAnimateRotationToInterfaceOrientation:toInterfaceOrientation
   330     [self.schemeWeaponConfigViewController willAnimateRotationToInterfaceOrientation:toInterfaceOrientation
   331                                                                             duration:duration];
   331                                                                             duration:duration];
   332     if (self.helpPage)
   332     if (self.helpPage)
   333     {
   333     {
   334         self.helpPage.view.frame = self.view.frame;
   334         self.helpPage.view.frame = self.view.frame;
   335     }
   335     }
   336 }
   336 }
   337 
   337 
   338 - (void)updateUIForInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
   338 - (void)updateiPadUIForInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
   339 {
   339 {
   340     if ((interfaceOrientation == UIInterfaceOrientationLandscapeLeft ||
   340     if ((interfaceOrientation == UIInterfaceOrientationLandscapeLeft ||
   341          interfaceOrientation == UIInterfaceOrientationLandscapeRight)) {
   341          interfaceOrientation == UIInterfaceOrientationLandscapeRight)) {
   342         self.imgContainer.alpha = 1;
   342         self.imgContainer.alpha = 1;
   343         self.titleImage.frame = CGRectMake(357, 17, 309, 165);
   343         self.titleImage.frame = CGRectMake(357, 17, 309, 165);
   361 
   361 
   362 -(void) viewWillAppear:(BOOL)animated {
   362 -(void) viewWillAppear:(BOOL)animated {
   363 //    if (IS_IPAD())
   363 //    if (IS_IPAD())
   364 //        [NSThread detachNewThreadSelector:@selector(loadNiceHogs) toTarget:self withObject:nil];
   364 //        [NSThread detachNewThreadSelector:@selector(loadNiceHogs) toTarget:self withObject:nil];
   365     
   365     
   366     // we assume here what 'statusBarOrientation' will never be changed manually!
   366     if (IS_IPAD())
   367     UIInterfaceOrientation currentOrientation = [[UIApplication sharedApplication] statusBarOrientation];
   367     {
   368     [self updateUIForInterfaceOrientation:currentOrientation];
   368         // we assume here what 'statusBarOrientation' will never be changed manually!
       
   369         UIInterfaceOrientation currentOrientation = [[UIApplication sharedApplication] statusBarOrientation];
       
   370         [self updateiPadUIForInterfaceOrientation:currentOrientation];
       
   371     }
   369     
   372     
   370     [self.mapConfigViewController viewWillAppear:animated];
   373     [self.mapConfigViewController viewWillAppear:animated];
   371     [self.teamConfigViewController viewWillAppear:animated];
   374     [self.teamConfigViewController viewWillAppear:animated];
   372     [self.schemeWeaponConfigViewController viewWillAppear:animated];
   375     [self.schemeWeaponConfigViewController viewWillAppear:animated];
   373     // add other controllers here and below
   376     // add other controllers here and below