--- a/project_files/HedgewarsMobile/Classes/OverlayViewController.m Tue Jul 06 03:33:01 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/OverlayViewController.m Wed Jul 07 02:52:11 2010 +0200
@@ -26,16 +26,6 @@
return rotationManager(interfaceOrientation);
}
-
--(void) didReceiveMemoryWarning {
- // Releases the view if it doesn't have a superview.
- [super didReceiveMemoryWarning];
- // Release any cached data, images, etc that aren't in use.
- if (popupMenu.view.superview == nil)
- popupMenu = nil;
- MSG_MEMCLEAN();
-}
-
-(void) didRotate:(NSNotification *)notification {
UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation];
CGRect rect = [[UIScreen mainScreen] bounds];
@@ -148,6 +138,7 @@
[self didRotate:[NSNotification notificationWithName:UIDeviceOrientationDidChangeNotification object:nil]];
}
+/* these are causing problems at reloading so let's remove 'em
-(void) viewDidUnload {
[popoverController dismissPopoverAnimated:NO];
[dimTimer invalidate];
@@ -159,6 +150,16 @@
MSG_DIDUNLOAD();
}
+-(void) didReceiveMemoryWarning {
+ // Releases the view if it doesn't have a superview.
+ [super didReceiveMemoryWarning];
+ // Release any cached data, images, etc that aren't in use.
+ if (popupMenu.view.superview == nil)
+ popupMenu = nil;
+ MSG_MEMCLEAN();
+}
+*/
+
-(void) dealloc {
[writeChatTextField release];
[popupMenu release];
@@ -170,12 +171,6 @@
#pragma mark -
#pragma mark Overlay actions and members
-// dim the overlay when there's no more input for a certain amount of time
--(IBAction) buttonReleased:(id) sender {
- HW_allKeysUp();
- [dimTimer setFireDate:HIDING_TIME_DEFAULT];
-}
-
// nice transition for dimming, should be called only by the timer himself
-(void) dimOverlay {
if (canDim) {
@@ -192,6 +187,30 @@
[dimTimer setFireDate:HIDING_TIME_NEVER];
}
+// dim the overlay when there's no more input for a certain amount of time
+-(IBAction) buttonReleased:(id) sender {
+ UIButton *theButton = (UIButton *)sender;
+
+ switch (theButton.tag) {
+ case 0:
+ case 1:
+ case 2:
+ case 3:
+ HW_walkingKeysUp();
+ break;
+ case 4:
+ case 5:
+ case 6:
+ HW_otherKeysUp();
+ break;
+ default:
+ NSLog(@"Nope");
+ break;
+ }
+
+ [dimTimer setFireDate:HIDING_TIME_DEFAULT];
+}
+
// issue certain action based on the tag of the button
-(IBAction) buttonPressed:(id) sender {
[self activateOverlay];
@@ -232,7 +251,7 @@
HW_ammoMenu();
break;
default:
- NSLog(@"Nope");
+ DLog(@"Nope");
break;
}
}