equal
deleted
inserted
replaced
18 |
18 |
19 -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { |
19 -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { |
20 return rotationManager(interfaceOrientation); |
20 return rotationManager(interfaceOrientation); |
21 } |
21 } |
22 |
22 |
23 -(IBAction) buttonPressed:(id) sender { |
23 -(IBAction) buttonPressed:(id) sender { |
24 // works even if it's not actually a button |
24 // works even if it's not actually a button |
25 UIButton *theButton = (UIButton *)sender; |
25 UIButton *theButton = (UIButton *)sender; |
26 switch (theButton.tag) { |
26 switch (theButton.tag) { |
27 case 0: |
27 case 0: |
|
28 playSound(@"backSound"); |
28 if ([mapConfigViewController busy]) { |
29 if ([mapConfigViewController busy]) { |
29 UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Wait for the Preview",@"") |
30 UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Wait for the Preview",@"") |
30 message:NSLocalizedString(@"Before returning the preview needs to be generated",@"") |
31 message:NSLocalizedString(@"Before returning the preview needs to be generated",@"") |
31 delegate:nil |
32 delegate:nil |
32 cancelButtonTitle:NSLocalizedString(@"Ok, got it",@"") |
33 cancelButtonTitle:NSLocalizedString(@"Ok, got it",@"") |
35 [alert release]; |
36 [alert release]; |
36 } else |
37 } else |
37 [[self parentViewController] dismissModalViewControllerAnimated:YES]; |
38 [[self parentViewController] dismissModalViewControllerAnimated:YES]; |
38 break; |
39 break; |
39 case 1: |
40 case 1: |
|
41 playSound(@"clickSound"); |
40 theButton.enabled = NO; |
42 theButton.enabled = NO; |
41 [self startGame:theButton]; |
43 [self startGame:theButton]; |
42 // [self performSelector:@selector(startGame:) |
44 // [self performSelector:@selector(startGame:) |
43 // withObject:theButton |
45 // withObject:theButton |
44 // afterDelay:0.25]; |
46 // afterDelay:0.25]; |
49 } |
51 } |
50 |
52 |
51 -(IBAction) segmentPressed:(id) sender { |
53 -(IBAction) segmentPressed:(id) sender { |
52 UISegmentedControl *theSegment = (UISegmentedControl *)sender; |
54 UISegmentedControl *theSegment = (UISegmentedControl *)sender; |
53 |
55 |
|
56 playSound(@"selSound"); |
54 switch (theSegment.selectedSegmentIndex) { |
57 switch (theSegment.selectedSegmentIndex) { |
55 case 0: |
58 case 0: |
56 // this init here is just aestetic as this controller was already set up in viewDidLoad |
59 // this init here is just aestetic as this controller was already set up in viewDidLoad |
57 if (mapConfigViewController == nil) { |
60 if (mapConfigViewController == nil) { |
58 mapConfigViewController = [[MapConfigViewController alloc] initWithNibName:@"MapConfigViewController-iPhone" bundle:nil]; |
61 mapConfigViewController = [[MapConfigViewController alloc] initWithNibName:@"MapConfigViewController-iPhone" bundle:nil]; |