project_files/HedgewarsMobile/Classes/OverlayViewController.m
changeset 3779 3351a017d4ad
parent 3765 ebfe7c9b3085
child 3783 8e9daf967406
equal deleted inserted replaced
3778:2e61bb50cc57 3779:3351a017d4ad
   216     }
   216     }
   217 
   217 
   218     if (!isGameRunning)
   218     if (!isGameRunning)
   219         return;
   219         return;
   220 
   220 
       
   221     if (HW_isWaiting())
       
   222         HW_shoot();
       
   223     
   221     UIButton *theButton = (UIButton *)sender;
   224     UIButton *theButton = (UIButton *)sender;
   222 
       
   223     switch (theButton.tag) {
   225     switch (theButton.tag) {
   224         case 0:
   226         case 0:
   225             if (isAttacking == NO)
   227             if (isAttacking == NO)
   226                 HW_walkLeft();
   228                 HW_walkLeft();
   227             break;
   229             break;
   365     NSSet *allTouches = [event allTouches];
   367     NSSet *allTouches = [event allTouches];
   366     CGPoint currentPosition = [[[allTouches allObjects] objectAtIndex:0] locationInView:self.view];
   368     CGPoint currentPosition = [[[allTouches allObjects] objectAtIndex:0] locationInView:self.view];
   367 
   369 
   368     switch ([allTouches count]) {
   370     switch ([allTouches count]) {
   369         case 1:
   371         case 1:
       
   372             // this dismisses the "get ready"
       
   373             if (HW_isWaiting())
       
   374                 HW_shoot();
       
   375 
   370             // if we're in the menu we just click in the point
   376             // if we're in the menu we just click in the point
   371             if (HW_isAmmoOpen()) {
   377             if (HW_isAmmoOpen()) {
   372                 HW_setCursor(HWXZ(currentPosition.x), HWYZ(currentPosition.y));
   378                 HW_setCursor(HWXZ(currentPosition.x), HWYZ(currentPosition.y));
   373                 // this click doesn't need any wrapping because the ammoMenu already limits the cursor
   379                 // this click doesn't need any wrapping because the ammoMenu already limits the cursor
   374                 HW_click();
   380                 HW_click();