project_files/HedgewarsMobile/Classes/AmmoMenuViewController.m
changeset 5662 99083392cd4f
parent 5208 878e551f0b4a
child 5976 306cedbeb213
equal deleted inserted replaced
5660:1647244b3ffe 5662:99083392cd4f
    67     [self viewWillAppear:YES];
    67     [self viewWillAppear:YES];
    68     [container addSubview:self.view];
    68     [container addSubview:self.view];
    69 
    69 
    70     if (placingPoint.x == -1 || placingPoint.y == -1)
    70     if (placingPoint.x == -1 || placingPoint.y == -1)
    71         placingPoint = container.center;
    71         placingPoint = container.center;
    72     if (IS_DUALHEAD() == YES) {
    72     self.view.center = placingPoint;
    73         UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation];
       
    74         if (orientation == UIDeviceOrientationLandscapeLeft || orientation == UIDeviceOrientationLandscapeRight)
       
    75             self.view.center = CGPointMake(placingPoint.y, placingPoint.x);
       
    76         else
       
    77             self.view.center = CGPointMake(placingPoint.x, placingPoint.y);
       
    78     } else
       
    79         self.view.center = CGPointMake(placingPoint.y, placingPoint.x);
       
    80 
    73 
    81     self.isVisible = YES;
    74     self.isVisible = YES;
    82     if (IS_IPAD() == NO)
    75     if (IS_IPAD() == NO)
    83         HW_pause();
    76         HW_pause();
    84 }
    77 }
    85 
    78 
    86 -(void) disappear {
    79 -(void) disappear {
    87     if (self.isVisible)
    80     if (self.isVisible)
    88         [self.view removeFromSuperview];
    81         [self.view removeFromSuperview];
    89     self.isVisible = NO;
    82     self.isVisible = NO;
    90     placingPoint.x = self.view.center.y;
    83     placingPoint = self.view.center;
    91     placingPoint.y = self.view.center.x;
       
    92     if (IS_IPAD() == NO)
    84     if (IS_IPAD() == NO)
    93         HW_pauseToggle();
    85         HW_pauseToggle();
    94 }
    86 }
    95 
    87 
    96 #pragma mark -
    88 #pragma mark -