equal
deleted
inserted
replaced
240 break; |
240 break; |
241 case 7: |
241 case 7: |
242 HW_tab(); |
242 HW_tab(); |
243 break; |
243 break; |
244 case 10: |
244 case 10: |
|
245 HW_pause(); |
245 removeConfirmationInput(); |
246 removeConfirmationInput(); |
246 [self showPopover]; |
247 [self showPopover]; |
247 break; |
248 break; |
248 case 11: |
249 case 11: |
249 removeConfirmationInput(); |
250 removeConfirmationInput(); |
268 } |
269 } |
269 |
270 |
270 // show up a popover containing a popupMenuViewController; we hook it with setPopoverContentSize |
271 // show up a popover containing a popupMenuViewController; we hook it with setPopoverContentSize |
271 // on iphone instead just use the tableViewController directly (and implement manually all animations) |
272 // on iphone instead just use the tableViewController directly (and implement manually all animations) |
272 -(IBAction) showPopover{ |
273 -(IBAction) showPopover{ |
|
274 CGRect screen = [[UIScreen mainScreen] bounds]; |
273 isPopoverVisible = YES; |
275 isPopoverVisible = YES; |
274 |
276 |
275 if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { |
277 if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { |
276 if (popupMenu == nil) |
278 if (popupMenu == nil) |
277 popupMenu = [[InGameMenuViewController alloc] initWithStyle:UITableViewStylePlain]; |
279 popupMenu = [[InGameMenuViewController alloc] initWithStyle:UITableViewStylePlain]; |
279 popoverController = [[UIPopoverController alloc] initWithContentViewController:popupMenu]; |
281 popoverController = [[UIPopoverController alloc] initWithContentViewController:popupMenu]; |
280 [popoverController setPopoverContentSize:CGSizeMake(220, 170) animated:YES]; |
282 [popoverController setPopoverContentSize:CGSizeMake(220, 170) animated:YES]; |
281 [popoverController setPassthroughViews:[NSArray arrayWithObject:self.view]]; |
283 [popoverController setPassthroughViews:[NSArray arrayWithObject:self.view]]; |
282 } |
284 } |
283 |
285 |
284 [popoverController presentPopoverFromRect:CGRectMake(1000, 0, 220, 32) |
286 [popoverController presentPopoverFromRect:CGRectMake(screen.size.height / 2, screen.size.width / 2, 1, 1) |
285 inView:self.view |
287 inView:self.view |
286 permittedArrowDirections:UIPopoverArrowDirectionUp |
288 permittedArrowDirections:UIPopoverArrowDirectionAny |
287 animated:YES]; |
289 animated:YES]; |
288 } else { |
290 } else { |
289 if (popupMenu == nil) |
291 if (popupMenu == nil) |
290 popupMenu = [[InGameMenuViewController alloc] initWithStyle:UITableViewStyleGrouped]; |
292 popupMenu = [[InGameMenuViewController alloc] initWithStyle:UITableViewStyleGrouped]; |
291 |
293 |
297 |
299 |
298 // on ipad just dismiss it, on iphone transtion to the right |
300 // on ipad just dismiss it, on iphone transtion to the right |
299 -(void) dismissPopover { |
301 -(void) dismissPopover { |
300 if (YES == isPopoverVisible) { |
302 if (YES == isPopoverVisible) { |
301 isPopoverVisible = NO; |
303 isPopoverVisible = NO; |
|
304 HW_pause(); |
302 |
305 |
303 if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { |
306 if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { |
304 [(InGameMenuViewController *)popoverController.contentViewController removeChat]; |
307 [(InGameMenuViewController *)popoverController.contentViewController removeChat]; |
305 [popoverController dismissPopoverAnimated:YES]; |
308 [popoverController dismissPopoverAnimated:YES]; |
306 } else { |
309 } else { |