project_files/HedgewarsMobile/Classes/OverlayViewController.m
changeset 3649 bc35f8fee587
parent 3648 2477029463ed
child 3650 ec90e573f47a
equal deleted inserted replaced
3648:2477029463ed 3649:bc35f8fee587
   181     switch (theButton.tag) {
   181     switch (theButton.tag) {
   182         case 0:
   182         case 0:
   183         case 1:
   183         case 1:
   184         case 2:
   184         case 2:
   185         case 3:
   185         case 3:
       
   186             [NSObject cancelPreviousPerformRequestsWithTarget:self
       
   187                                                      selector:@selector(unsetPreciseStatus)
       
   188                                                        object:nil];
   186             HW_walkingKeysUp();
   189             HW_walkingKeysUp();
   187             break;
   190             break;
   188         case 4:
   191         case 4:
   189         case 5:
   192         case 5:
   190         case 6:
   193         case 6:
   216             break;
   219             break;
   217         case 1:
   220         case 1:
   218             HW_walkRight();
   221             HW_walkRight();
   219             break;
   222             break;
   220         case 2:
   223         case 2:
       
   224             [self performSelector:@selector(unsetPreciseStatus) withObject:nil afterDelay:0.8];
       
   225             HW_preciseSet(YES);
   221             HW_aimUp();
   226             HW_aimUp();
   222             break;
   227             break;
   223         case 3:
   228         case 3:
       
   229             [self performSelector:@selector(unsetPreciseStatus) withObject:nil afterDelay:0.8];
       
   230             HW_preciseSet(YES);
   224             HW_aimDown();
   231             HW_aimDown();
   225             break;
   232             break;
   226         case 4:
   233         case 4:
   227             HW_shoot();
   234             HW_shoot();
   228             break;
   235             break;
   245             break;
   252             break;
   246         default:
   253         default:
   247             DLog(@"Nope");
   254             DLog(@"Nope");
   248             break;
   255             break;
   249     }
   256     }
       
   257 }
       
   258 
       
   259 -(void) unsetPreciseStatus {
       
   260     HW_preciseSet(NO);
   250 }
   261 }
   251 
   262 
   252 // present a further check before closing game
   263 // present a further check before closing game
   253 -(void) actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger) buttonIndex {
   264 -(void) actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger) buttonIndex {
   254     if ([actionSheet cancelButtonIndex] != buttonIndex)
   265     if ([actionSheet cancelButtonIndex] != buttonIndex)