project_files/HedgewarsMobile/Classes/GameConfigViewController.m
branchios-revival
changeset 11123 bd58a851eb8d
parent 11122 2b4e89e5203b
child 11132 ccf095d96ef4
equal deleted inserted replaced
11122:2b4e89e5203b 11123:bd58a851eb8d
   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     if ((toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft ||
   328     [self updateUIForInterfaceOrientation:toInterfaceOrientation];
   329          toInterfaceOrientation == UIInterfaceOrientationLandscapeRight)) {
   329 
       
   330     [self.schemeWeaponConfigViewController willAnimateRotationToInterfaceOrientation:toInterfaceOrientation
       
   331                                                                             duration:duration];
       
   332     if (self.helpPage)
       
   333     {
       
   334         self.helpPage.view.frame = self.view.frame;
       
   335     }
       
   336 }
       
   337 
       
   338 - (void)updateUIForInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
       
   339 {
       
   340     if ((interfaceOrientation == UIInterfaceOrientationLandscapeLeft ||
       
   341          interfaceOrientation == UIInterfaceOrientationLandscapeRight)) {
   330         self.imgContainer.alpha = 1;
   342         self.imgContainer.alpha = 1;
   331         self.titleImage.frame = CGRectMake(357, 17, 309, 165);
   343         self.titleImage.frame = CGRectMake(357, 17, 309, 165);
   332         self.schemeWeaponConfigViewController.view.frame = CGRectMake(0, 60, 320, 620);
   344         self.schemeWeaponConfigViewController.view.frame = CGRectMake(0, 60, 320, 620);
   333         self.mapConfigViewController.view.frame = CGRectMake(704, 0, 320, 680);
   345         self.mapConfigViewController.view.frame = CGRectMake(704, 0, 320, 680);
   334         self.teamConfigViewController.view.frame = CGRectMake(337, 187, 350, 505);
   346         self.teamConfigViewController.view.frame = CGRectMake(337, 187, 350, 505);
   343         self.teamConfigViewController.view.frame = CGRectMake(170, 590, 428, 366);
   355         self.teamConfigViewController.view.frame = CGRectMake(170, 590, 428, 366);
   344         self.mapConfigViewController.maxLabel.frame = CGRectMake(104, 975, 200, 40);
   356         self.mapConfigViewController.maxLabel.frame = CGRectMake(104, 975, 200, 40);
   345         self.sliderBackground.frame = CGRectMake(465, 975, 200, 40);
   357         self.sliderBackground.frame = CGRectMake(465, 975, 200, 40);
   346         self.mapConfigViewController.slider.frame = CGRectMake(475, 983, 180, 23);
   358         self.mapConfigViewController.slider.frame = CGRectMake(475, 983, 180, 23);
   347     }
   359     }
   348 
       
   349     [self.schemeWeaponConfigViewController willAnimateRotationToInterfaceOrientation:toInterfaceOrientation
       
   350                                                                             duration:duration];
       
   351     if (self.helpPage)
       
   352     {
       
   353         self.helpPage.view.frame = self.view.frame;
       
   354     }
       
   355 }
   360 }
   356 
   361 
   357 -(void) viewWillAppear:(BOOL)animated {
   362 -(void) viewWillAppear:(BOOL)animated {
   358 //    if (IS_IPAD())
   363 //    if (IS_IPAD())
   359 //        [NSThread detachNewThreadSelector:@selector(loadNiceHogs) toTarget:self withObject:nil];
   364 //        [NSThread detachNewThreadSelector:@selector(loadNiceHogs) toTarget:self withObject:nil];
   360 
   365     
       
   366     // we assume here what 'statusBarOrientation' will never be changed manually!
       
   367     UIInterfaceOrientation currentOrientation = [[UIApplication sharedApplication] statusBarOrientation];
       
   368     [self updateUIForInterfaceOrientation:currentOrientation];
       
   369     
   361     [self.mapConfigViewController viewWillAppear:animated];
   370     [self.mapConfigViewController viewWillAppear:animated];
   362     [self.teamConfigViewController viewWillAppear:animated];
   371     [self.teamConfigViewController viewWillAppear:animated];
   363     [self.schemeWeaponConfigViewController viewWillAppear:animated];
   372     [self.schemeWeaponConfigViewController viewWillAppear:animated];
   364     // add other controllers here and below
   373     // add other controllers here and below
   365 
   374