project_files/HedgewarsMobile/Classes/OverlayViewController.m
changeset 3935 5ca27a0e9a63
parent 3933 1a873262f5dd
child 3940 cc29628976cc
equal deleted inserted replaced
3933:1a873262f5dd 3935:5ca27a0e9a63
    41 #define ACTIVITYINDICATOR_TAG 987654
    41 #define ACTIVITYINDICATOR_TAG 987654
    42 #define ANIMATION_DURATION 0.25
    42 #define ANIMATION_DURATION 0.25
    43 #define removeConfirmationInput()   [[self.view viewWithTag:CONFIRMATION_TAG] removeFromSuperview];
    43 #define removeConfirmationInput()   [[self.view viewWithTag:CONFIRMATION_TAG] removeFromSuperview];
    44 
    44 
    45 @implementation OverlayViewController
    45 @implementation OverlayViewController
    46 @synthesize popoverController, popupMenu, helpPage, amvc;
    46 @synthesize popoverController, popupMenu, helpPage, amvc, isNetGame, useClassicMenu;
    47 
    47 
    48 -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation {
    48 -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation {
    49     return rotationManager(interfaceOrientation);
    49     return rotationManager(interfaceOrientation);
    50 }
    50 }
    51 
    51 
   305             HW_backjump();
   305             HW_backjump();
   306             break;
   306             break;
   307         case 10:
   307         case 10:
   308             playSound(@"clickSound");
   308             playSound(@"clickSound");
   309             HW_pause();
   309             HW_pause();
   310             if (amvc.isVisible) {
   310             if (self.amvc.isVisible) {
   311                 doDim();
   311                 doDim();
   312                 [amvc disappear];
   312                 [self.amvc disappear];
   313             }
   313             }
   314             removeConfirmationInput();
   314             removeConfirmationInput();
   315             [self showPopover];
   315             [self showPopover];
   316             break;
   316             break;
   317         case 11:
   317         case 11:
   318             playSound(@"clickSound");
   318             playSound(@"clickSound");
   319             removeConfirmationInput();
   319             removeConfirmationInput();
   320             HW_ammoMenu();
       
   321             
   320             
   322             // TODO: removal and multimonitor experience
   321             if (self.useClassicMenu)
   323             if (self.amvc == nil)
   322                 HW_ammoMenu();
   324                 self.amvc = [[AmmoMenuViewController alloc] init];
   323             else {
   325 
   324                 // TODO: removal and multimonitor experience
   326             if (self.amvc.isVisible) {
   325                 if (self.amvc == nil)
   327                 doDim();
   326                     self.amvc = [[AmmoMenuViewController alloc] init];
   328                 [self.amvc disappear];
   327                 
   329             } else {
   328                 if (self.amvc.isVisible) {
   330                 doNotDim();
   329                     doDim();
   331                 [self.amvc appearInView:self.view];
   330                     [self.amvc disappear];
       
   331                 } else {
       
   332                     doNotDim();
       
   333                     [self.amvc appearInView:self.view];
       
   334                 }
   332             }
   335             }
   333             
       
   334             break;
   336             break;
   335         default:
   337         default:
   336             DLog(@"Nope");
   338             DLog(@"Nope");
   337             break;
   339             break;
   338     }
   340     }