merge
authorkoda
Sun, 18 Jul 2010 03:58:06 +0200
changeset 3652 df76ccda0648
parent 3651 7058ca178f3b (diff)
parent 3645 c0b3f1bb9316 (current diff)
child 3653 c0d94fedbd86
merge
--- a/hedgewars/PascalExports.pas	Sat Jul 17 23:44:42 2010 +0400
+++ b/hedgewars/PascalExports.pas	Sun Jul 18 03:58:06 2010 +0200
@@ -13,7 +13,7 @@
 unit PascalExports;
 
 interface
-uses uKeys, GLunit, uWorld, uMisc, uGears, uConsole, uTeams, uConsts, hwengine;
+uses uKeys, GLunit, uWorld, uMisc, uConsole, uTeams, uConsts, uChat, uGears, hwengine;
 
 {$INCLUDE "config.inc"}
 
@@ -23,7 +23,7 @@
 var xx, yy: LongInt;
 
 // retrieve protocol information
-procedure HW_versionInfo(netProto: PShortInt; versionStr: Ppchar); cdecl; export;
+procedure HW_versionInfo(netProto: PShortInt; versionStr: PPChar); cdecl; export;
 begin
 // http://bugs.freepascal.org/view.php?id=16156
     if netProto <> nil then netProto^:= cNetProtoVersion;
@@ -63,6 +63,7 @@
     rightKey:= false;
     upKey:= false;
     downKey:= false;
+    preciseKey:= false;
 end;
 
 procedure HW_otherKeysUp; cdecl; export;
@@ -88,6 +89,11 @@
     rightKey:= true;
 end;
 
+procedure HW_preciseSet(status:boolean); cdecl; export;
+begin
+    preciseKey:= status;
+end;
+
 procedure HW_aimUp; cdecl; export;
 begin
     upKey:= true;
@@ -113,14 +119,20 @@
     backspaceKey:= true;
 end;
 
+procedure HW_tab; cdecl; export;
+begin
+    tabKey:= true;
+end;
+
 procedure HW_chat; cdecl; export;
 begin
     chatAction:= true;
 end;
 
-procedure HW_tab; cdecl; export;
+procedure HW_chatEnd; cdecl; export;
 begin
-    switchAction:= true;
+    KeyPressChat(27); // esc - cleans buffer
+    KeyPressChat(13); // enter - removes chat
 end;
 
 procedure HW_pause; cdecl; export;
@@ -128,30 +140,6 @@
     pauseAction:= true;
 end;
 
-procedure HW_cursorUp(coefficient:LongInt); cdecl; export;
-begin
-    coeff:= coefficient;
-    cursorUp:= true;
-end;
-
-procedure HW_cursorDown(coefficient:LongInt); cdecl; export;
-begin
-    coeff:= coefficient;
-    cursorDown:= true;
-end;
-
-procedure HW_cursorLeft(coefficient:LongInt); cdecl; export;
-begin
-    coeff:= coefficient;
-    cursorLeft:= true;
-end;
-
-procedure HW_cursorRight(coefficient:LongInt); cdecl; export;
-begin
-    coeff:= coefficient;
-    cursorRight:= true;
-end;
-
 procedure HW_terminate(closeFrontend: boolean); cdecl; export;
 begin
     isTerminated:= true;
@@ -200,6 +188,27 @@
     exit( (CurrentHedgehog^.Gear^.State and gstHHChooseTarget) <> 0 )
 end;
 
+function HW_isWeaponTimerable: boolean; cdecl; export;
+var CurSlot, CurAmmo: LongWord;
+begin
+    CurSlot:= CurrentHedgehog^.CurSlot;
+    CurAmmo:= CurrentHedgehog^.CurAmmo;
+    exit( (CurrentHedgehog^.Ammo^[CurSlot, CurAmmo].Propz and ammoprop_Timerable) <> 0)
+end;
+
+function HW_isWeaponSwitch: boolean cdecl; export;
+begin
+    if CurAmmoGear <> nil then
+        exit(CurAmmoGear^.AmmoType = amSwitch) 
+    else
+        exit(false)
+end;
+
+procedure HW_setGrenadeTime(time: LongInt); cdecl; export;
+begin
+    ParseCommand('/timer ' + inttostr(time), true);
+end;
+
 //amSwitch
 {$ENDIF}
 
--- a/hedgewars/hwengine.pas	Sat Jul 17 23:44:42 2010 +0400
+++ b/hedgewars/hwengine.pas	Sun Jul 18 03:58:06 2010 +0200
@@ -151,7 +151,13 @@
         while SDL_PollEvent(@event) <> 0 do
         begin
             case event.type_ of
-                SDL_KEYDOWN: if GameState = gsChat then KeyPressChat(event.key.keysym.unicode);
+                SDL_KEYDOWN: if GameState = gsChat then
+{$IFDEF IPHONEOS}
+                    // sdl on iphone supports only ashii keyboards and the unicode field is deprecated in sdl 1.3
+                    KeyPressChat(event.key.keysym.sym);
+{$ELSE}
+                    KeyPressChat(event.key.keysym.unicode);
+{$ENDIF}
 {$IFDEF SDL13}
                 SDL_WINDOWEVENT:
                     if event.wevent.event = SDL_WINDOWEVENT_SHOWN then
--- a/hedgewars/uKeys.pas	Sat Jul 17 23:44:42 2010 +0400
+++ b/hedgewars/uKeys.pas	Sun Jul 18 03:58:06 2010 +0200
@@ -70,7 +70,8 @@
     downKey: boolean;
     rightKey: boolean;
     leftKey: boolean;
-
+    preciseKey: boolean;
+    
     backspaceKey: boolean;
     spaceKey: boolean;
     enterKey: boolean;
@@ -78,12 +79,7 @@
     
     chatAction: boolean;
     pauseAction: boolean;
-    switchAction: boolean;
     
-    cursorUp: boolean;
-    cursorDown: boolean;
-    cursorLeft: boolean;
-    cursorRight: boolean;
 {$IFDEF IPHONEOS}    
 procedure setiPhoneBinds;
 {$ENDIF}
@@ -342,12 +338,9 @@
 DefaultBinds[24]:= '+down';
 DefaultBinds[25]:= '+left';
 DefaultBinds[26]:= '+right';
+DefaultBinds[27]:= '+precise';
 DefaultBinds[44]:= 'chat';
 DefaultBinds[55]:= 'pause';
-DefaultBinds[66]:= '+cur_u';
-DefaultBinds[67]:= '+cur_d';
-DefaultBinds[68]:= '+cur_l';
-DefaultBinds[69]:= '+cur_r';
 {$ELSE}
 DefaultBinds[KeyNameToCode('up')]:= '+up';
 DefaultBinds[KeyNameToCode('down')]:= '+down';
@@ -380,6 +373,7 @@
     tkbdn[24]:= ord(downKey);
     tkbdn[25]:= ord(leftKey);
     tkbdn[26]:= ord(rightKey);
+    tkbdn[27]:= ord(preciseKey);
 
     tkbdn[ 8]:= ord(backspaceKey);
     tkbdn[ 9]:= ord(tabKey);
@@ -388,12 +382,6 @@
 
     tkbdn[44]:= ord(chatAction);
     tkbdn[55]:= ord(pauseAction);
-    //tkbdn[100]:= ord(switchAction);
-    
-    tkbdn[66]:= ord(cursorUp);
-    tkbdn[67]:= ord(cursorDown);
-    tkbdn[68]:= ord(cursorLeft);
-    tkbdn[69]:= ord(cursorRight);
     
     // set to false the keys that only need one stoke
     leftClick:= false;
@@ -406,7 +394,6 @@
     
     chatAction:= false;
     pauseAction:= false;
-    //switchAction:= false;
 end;
 {$ENDIF}
 
@@ -520,6 +507,7 @@
     downKey:= false;
     rightKey:= false;
     leftKey:= false;
+    preciseKey:= false;
 
     // action key emulation
     backspaceKey:= false;
@@ -530,14 +518,6 @@
     // other key emulation
     chatAction:= false;
     pauseAction:= false;
-    switchAction:= false;
-
-    // cursor emulation
-    cursorUp:= false;
-    cursorDown:= false;
-    cursorLeft:= false;
-    cursorRight:= false;
-    
 {$ENDIF}
 end;
 
--- a/hedgewars/uMisc.pas	Sat Jul 17 23:44:42 2010 +0400
+++ b/hedgewars/uMisc.pas	Sun Jul 18 03:58:06 2010 +0200
@@ -738,8 +738,8 @@
         
     GameState       := Low(TGameState);
     GameType        := gmtLocal;
-    zoom            := 2.0;
-    ZoomValue       := 2.0;
+    zoom            := cDefaultZoomLevel;
+    ZoomValue       := cDefaultZoomLevel;
     WeaponTooltipTex:= nil;
     cLaserSighting  := false;
     cVampiric       := false;
--- a/project_files/HedgewarsMobile/Classes/GameConfigViewController.m	Sat Jul 17 23:44:42 2010 +0400
+++ b/project_files/HedgewarsMobile/Classes/GameConfigViewController.m	Sun Jul 18 03:58:06 2010 +0200
@@ -164,6 +164,26 @@
         DLog(@"gameconfig data not complete!!\nmapConfigViewController = %@\nteamConfigViewController = %@\nschemeWeaponConfigViewController = %@\n",
              mapConfigViewController, teamConfigViewController, schemeWeaponConfigViewController);
         [self.parentViewController dismissModalViewControllerAnimated:YES];
+        
+        // present an alert to the user, with an image on the ipad (too big for the iphone)
+        NSString *msg = NSLocalizedString(@"Something went wrong with your configuration. Please try again.",@"");
+        if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
+            msg = [msg stringByAppendingString:@"\n\n\n\n\n\n\n\n"];    // this makes space for the image
+        
+        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Whoops"
+                                                        message:msg
+                                                       delegate:nil
+                                              cancelButtonTitle:@"Ok"
+                                              otherButtonTitles:nil];
+        
+        if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
+            UIImageView *deniedImg = [[UIImageView alloc] initWithImage:[UIImage imageWithContentsOfFile:@"denied.png"]];
+            deniedImg.frame = CGRectMake(25, 80, 240, 160);
+            [alert addSubview:deniedImg];
+            [deniedImg release];
+        }
+        [alert show];
+        [alert release];
     }
 
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/HedgewarsMobile/Classes/InGameMenuViewController.h	Sun Jul 18 03:58:06 2010 +0200
@@ -0,0 +1,24 @@
+//
+//  popupMenuViewController.h
+//  HedgewarsMobile
+//
+//  Created by Vittorio on 25/03/10.
+//  Copyright 2010 __MyCompanyName__. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+
+@interface InGameMenuViewController : UITableViewController <UIActionSheetDelegate> {
+    NSArray *menuList;
+    BOOL isPaused;
+    SDL_Window *sdlwindow;
+}
+
+@property (nonatomic,retain) NSArray *menuList;
+
+-(void) present;
+-(void) dismiss;
+-(void) removeChat;
+
+@end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/HedgewarsMobile/Classes/InGameMenuViewController.m	Sun Jul 18 03:58:06 2010 +0200
@@ -0,0 +1,175 @@
+    //
+//  popupMenuViewController.m
+//  HedgewarsMobile
+//
+//  Created by Vittorio on 25/03/10.
+//  Copyright 2010 __MyCompanyName__. All rights reserved.
+//
+
+#import "SDL_uikitappdelegate.h"
+#import "InGameMenuViewController.h"
+#import "PascalImports.h"
+#import "CommodityFunctions.h"
+#import "SDL_sysvideo.h"
+
+@implementation InGameMenuViewController
+@synthesize menuList;
+
+
+-(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation {
+    return rotationManager(interfaceOrientation);
+}
+
+-(void) didReceiveMemoryWarning {
+    // Releases the view if it doesn't have a superview.
+    [super didReceiveMemoryWarning];
+}
+
+-(void) viewDidLoad {
+    isPaused = NO;
+
+    NSArray *array = [[NSArray alloc] initWithObjects:
+                      NSLocalizedString(@"Pause Game", @""),
+                      NSLocalizedString(@"Chat", @""),
+                      NSLocalizedString(@"End Game", @""),
+                      nil];
+    self.menuList = array;
+    [array release];
+    
+    // save the sdl window (!= uikit window) for future reference
+    SDL_VideoDevice *_this = SDL_GetVideoDevice();
+    SDL_VideoDisplay *display = &_this->displays[0];
+    sdlwindow = display->windows;
+        
+    [super viewDidLoad];
+}
+
+-(void) viewDidUnload {
+    self.menuList = nil;
+    [super viewDidUnload];
+    MSG_DIDUNLOAD();
+}
+
+-(void) dealloc {
+    [menuList release];
+    [super dealloc];
+}
+
+#pragma mark -
+#pragma mark animating
+-(void) present {
+    CGRect screen = [[UIScreen mainScreen] bounds];
+    self.view.backgroundColor = [UIColor clearColor];
+    self.view.frame = CGRectMake(screen.size.height, 0, 200, 170);
+    
+    [UIView beginAnimations:@"showing popover" context:NULL];
+    [UIView setAnimationDuration:0.35];
+    self.view.frame = CGRectMake(screen.size.height-200, 0, 200, 170);
+    [UIView commitAnimations];
+}
+
+-(void) dismiss {
+    CGRect screen = [[UIScreen mainScreen] bounds];
+    [UIView beginAnimations:@"hiding popover" context:NULL];
+    [UIView setAnimationDuration:0.35];
+    self.view.frame = CGRectMake(screen.size.height, 0, 200, 170);
+    [UIView commitAnimations];
+        
+    [self.view performSelector:@selector(removeFromSuperview) withObject:nil afterDelay:0.35];
+    
+    [self removeChat];
+}
+
+#pragma mark -
+#pragma mark tableView methods
+-(NSInteger) numberOfSectionsInTableView:(UITableView *)tableView {
+    return 1;
+}
+
+-(NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
+    return 3;
+}
+
+-(UITableViewCell *)tableView:(UITableView *)aTableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
+    static NSString *cellIdentifier = @"CellIdentifier";
+    
+    UITableViewCell *cell = [aTableView dequeueReusableCellWithIdentifier:cellIdentifier];
+    if (nil == cell) {
+        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
+                                       reuseIdentifier:cellIdentifier] autorelease];
+    }
+    cell.textLabel.text = [menuList objectAtIndex:[indexPath row]];
+    
+    return cell;
+}
+
+-(void) tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
+    UIActionSheet *actionSheet;
+    
+    switch ([indexPath row]) {
+        case 0:
+            HW_pause();
+            isPaused = !isPaused;
+            break;
+        case 1:
+            if (SDL_iPhoneKeyboardIsShown(sdlwindow))
+                [self removeChat];
+            else {
+                HW_chat();
+                SDL_iPhoneKeyboardShow(sdlwindow);
+            }
+            break;
+        case 2:
+            // expand the view (and table) so that the actionsheet can be selected on the iPhone
+            if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
+                CGRect screen = [[UIScreen mainScreen] bounds];
+                [self.tableView deselectRowAtIndexPath:indexPath animated:NO];
+                [UIView beginAnimations:@"table width more" context:NULL];
+                [UIView setAnimationDuration:0.2];
+                self.view.frame = CGRectMake(0, 0, screen.size.height, screen.size.width);
+                [UIView commitAnimations];
+            }
+            actionSheet = [[UIActionSheet alloc] initWithTitle:NSLocalizedString(@"Are you reeeeeally sure?", @"")
+                                                      delegate:self
+                                             cancelButtonTitle:NSLocalizedString(@"Well, maybe not...", @"")
+                                        destructiveButtonTitle:NSLocalizedString(@"Of course!", @"")
+                                             otherButtonTitles:nil];
+            [actionSheet showInView:self.view];
+            [actionSheet release];
+            
+            if (!isPaused) 
+                HW_pause();
+            break;
+        default:
+            NSLog(@"Warning: unset case value in section!");
+            break;
+    }
+    
+    [aTableView deselectRowAtIndexPath:indexPath animated:YES];
+}
+
+-(void) removeChat {
+    HW_chatEnd();
+    if (SDL_iPhoneKeyboardIsShown(sdlwindow))
+        SDL_iPhoneKeyboardHide(sdlwindow);
+}
+
+#pragma mark -
+#pragma mark actionSheet methods
+-(void) actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger) buttonIndex {
+    if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone){
+        CGRect screen = [[UIScreen mainScreen] bounds];
+        [UIView beginAnimations:@"table width less" context:NULL];
+        [UIView setAnimationDuration:0.2];
+        self.view.frame = CGRectMake(screen.size.height-200, 0, 200, 170);
+        [UIView commitAnimations];
+    }
+    
+    if ([actionSheet cancelButtonIndex] != buttonIndex)
+        HW_terminate(NO);
+    else
+        if (!isPaused) 
+            HW_pause();     
+}
+
+@end
--- a/project_files/HedgewarsMobile/Classes/OverlayViewController.h	Sat Jul 17 23:44:42 2010 +0400
+++ b/project_files/HedgewarsMobile/Classes/OverlayViewController.h	Sun Jul 18 03:58:06 2010 +0200
@@ -7,27 +7,30 @@
 //
 
 #import <UIKit/UIKit.h>
+#import "SDL_sysvideo.h"
 
-#define CONFIRMATION_TAG 5959
-#define ANIMATION_DURATION 0.25
-#define removeConfirmationInput()   [[self.view viewWithTag:CONFIRMATION_TAG] removeFromSuperview]; 
-
-@class PopoverMenuViewController;
+@class InGameMenuViewController;
 
 @interface OverlayViewController : UIViewController {
+    // the timer that dims the overlay
     NSTimer *dimTimer;
 
-    // used only on the ipad
-    UIPopoverController *popoverController;
-
-    PopoverMenuViewController *popupMenu;
+    // the in-game menu
+    UIPopoverController *popoverController; // iPad only
+    InGameMenuViewController *popupMenu;
     BOOL isPopoverVisible;
     
+    // ths touch section
     CGFloat initialDistanceForPinching;
+    CGPoint startingPoint;
+    BOOL isSegmentVisible;
+    
+    // the sdl window underneath
+    SDL_Window *sdlwindow;
 }
 
 @property (nonatomic,retain) id popoverController;
-@property (nonatomic,retain) PopoverMenuViewController *popupMenu;
+@property (nonatomic,retain) InGameMenuViewController *popupMenu;
 
 BOOL isGameRunning;
 
@@ -43,7 +46,5 @@
 -(void) dismissPopover;
 -(void) dimOverlay;
 -(void) activateOverlay;
--(void) chatAppear;
--(void) chatDisappear;
 
 @end
--- a/project_files/HedgewarsMobile/Classes/OverlayViewController.m	Sat Jul 17 23:44:42 2010 +0400
+++ b/project_files/HedgewarsMobile/Classes/OverlayViewController.m	Sun Jul 18 03:58:06 2010 +0200
@@ -11,13 +11,19 @@
 #import "PascalImports.h"
 #import "CGPointUtils.h"
 #import "SDL_mouse.h"
+#import "InGameMenuViewController.h"
+#import "CommodityFunctions.h"
 #import "SDL_config_iphoneos.h"
-#import "PopoverMenuViewController.h"
-#import "CommodityFunctions.h"
 
 #define HIDING_TIME_DEFAULT [NSDate dateWithTimeIntervalSinceNow:2.7]
 #define HIDING_TIME_NEVER   [NSDate dateWithTimeIntervalSinceNow:10000]
+#define doDim()             [dimTimer setFireDate:HIDING_TIME_DEFAULT]
+#define doNotDim()          [dimTimer setFireDate:HIDING_TIME_NEVER]
 
+#define CONFIRMATION_TAG 5959
+#define GRENADE_TAG 9595
+#define ANIMATION_DURATION 0.25
+#define removeConfirmationInput()   [[self.view viewWithTag:CONFIRMATION_TAG] removeFromSuperview]; 
 
 @implementation OverlayViewController
 @synthesize popoverController, popupMenu;
@@ -30,7 +36,7 @@
     UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation];
     CGRect rect = [[UIScreen mainScreen] bounds];
     CGRect usefulRect = CGRectMake(0, 0, rect.size.width, rect.size.height);
-    UIView *sdlView = [[[UIApplication sharedApplication] keyWindow] viewWithTag:12345];
+    UIView *sdlView = [[[UIApplication sharedApplication] keyWindow] viewWithTag:SDL_VIEW_TAG];
     
     [UIView beginAnimations:@"rotation" context:NULL];
     [UIView setAnimationDuration:0.8f];
@@ -39,13 +45,11 @@
         case UIDeviceOrientationLandscapeLeft:
             sdlView.transform = CGAffineTransformMakeRotation(degreesToRadian(0));
             self.view.transform = CGAffineTransformMakeRotation(degreesToRadian(90));
-            [self chatDisappear];
             HW_setLandscape(YES);
             break;
         case UIDeviceOrientationLandscapeRight:
             sdlView.transform = CGAffineTransformMakeRotation(degreesToRadian(180));
             self.view.transform = CGAffineTransformMakeRotation(degreesToRadian(-90));
-            [self chatDisappear];
             HW_setLandscape(YES);
             break;
         /*
@@ -74,35 +78,6 @@
     [UIView commitAnimations];
 }
 
--(void) chatAppear {
-    /*
-    if (writeChatTextField == nil) {
-        writeChatTextField = [[UITextField alloc] initWithFrame:CGRectMake(0, 100, 768, [UIFont systemFontSize]+8)];
-        writeChatTextField.textColor = [UIColor whiteColor];
-        writeChatTextField.backgroundColor = [UIColor blueColor];
-        writeChatTextField.autocapitalizationType = UITextAutocapitalizationTypeNone;
-        writeChatTextField.autocorrectionType = UITextAutocorrectionTypeNo;
-        writeChatTextField.enablesReturnKeyAutomatically = NO;
-        writeChatTextField.keyboardAppearance = UIKeyboardAppearanceDefault;
-        writeChatTextField.keyboardType = UIKeyboardTypeDefault;
-        writeChatTextField.returnKeyType = UIReturnKeyDefault;
-        writeChatTextField.secureTextEntry = NO;    
-        [self.view addSubview:writeChatTextField];
-    }
-    writeChatTextField.alpha = 1;
-    [self activateOverlay];
-    [dimTimer setFireDate:HIDING_TIME_NEVER];
-    */
-}
-
--(void) chatDisappear {
-    /*
-    writeChatTextField.alpha = 0;
-    [writeChatTextField resignFirstResponder];
-    [dimTimer setFireDate:HIDING_TIME_DEFAULT];
-    */
-}
-
 #pragma mark -
 #pragma mark View Management
 -(void) viewDidLoad {
@@ -112,7 +87,7 @@
     
     // set initial orientation
     UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation];
-    UIView *sdlView = [[[UIApplication sharedApplication] keyWindow] viewWithTag:12345];
+    UIView *sdlView = [[[UIApplication sharedApplication] keyWindow] viewWithTag:SDL_VIEW_TAG];
     switch (orientation) {
         case UIDeviceOrientationLandscapeLeft:
             sdlView.transform = CGAffineTransformMakeRotation(degreesToRadian(0));
@@ -146,6 +121,11 @@
     [UIView setAnimationDuration:1];
     self.view.alpha = 1;
     [UIView commitAnimations];
+    
+    // find the sdl window we're on
+    SDL_VideoDevice *_this = SDL_GetVideoDevice();
+    SDL_VideoDisplay *display = &_this->displays[0];
+    sdlwindow = display->windows;
 }
 
 /* these are causing problems at reloading so let's remove 'em
@@ -189,7 +169,7 @@
 // set the overlay visible and put off the timer for enough time
 -(void) activateOverlay {
     self.view.alpha = 1;
-    [dimTimer setFireDate:HIDING_TIME_NEVER];
+    doNotDim();
 }
 
 // dim the overlay when there's no more input for a certain amount of time
@@ -204,6 +184,9 @@
         case 1:
         case 2:
         case 3:
+            [NSObject cancelPreviousPerformRequestsWithTarget:self
+                                                     selector:@selector(unsetPreciseStatus)
+                                                       object:nil];
             HW_walkingKeysUp();
             break;
         case 4:
@@ -216,7 +199,7 @@
             break;
     }
 
-    [dimTimer setFireDate:HIDING_TIME_DEFAULT];
+    doDim();
 }
 
 // issue certain action based on the tag of the button 
@@ -239,9 +222,13 @@
             HW_walkRight();
             break;
         case 2:
+            [self performSelector:@selector(unsetPreciseStatus) withObject:nil afterDelay:0.8];
+            HW_preciseSet(YES);
             HW_aimUp();
             break;
         case 3:
+            [self performSelector:@selector(unsetPreciseStatus) withObject:nil afterDelay:0.8];
+            HW_preciseSet(YES);
             HW_aimDown();
             break;
         case 4:
@@ -270,6 +257,10 @@
     }
 }
 
+-(void) unsetPreciseStatus {
+    HW_preciseSet(NO);
+}
+
 // present a further check before closing game
 -(void) actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger) buttonIndex {
     if ([actionSheet cancelButtonIndex] != buttonIndex)
@@ -285,7 +276,7 @@
 
     if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
         if (popupMenu == nil) 
-            popupMenu = [[PopoverMenuViewController alloc] initWithStyle:UITableViewStylePlain];
+            popupMenu = [[InGameMenuViewController alloc] initWithStyle:UITableViewStylePlain];
         if (popoverController == nil) {
             popoverController = [[UIPopoverController alloc] initWithContentViewController:popupMenu];
             [popoverController setPopoverContentSize:CGSizeMake(220, 170) animated:YES];
@@ -297,17 +288,11 @@
                          permittedArrowDirections:UIPopoverArrowDirectionUp
                                          animated:YES];
     } else {
-        if (popupMenu == nil) {
-            popupMenu = [[PopoverMenuViewController alloc] initWithStyle:UITableViewStyleGrouped];
-            popupMenu.view.backgroundColor = [UIColor clearColor];
-            popupMenu.view.frame = CGRectMake(480, 0, 200, 170);
-        }
+        if (popupMenu == nil)
+            popupMenu = [[InGameMenuViewController alloc] initWithStyle:UITableViewStyleGrouped];
+        
         [self.view addSubview:popupMenu.view];
-        
-        [UIView beginAnimations:@"showing popover" context:NULL];
-        [UIView setAnimationDuration:0.35];
-        popupMenu.view.frame = CGRectMake(280, 0, 200, 170);
-        [UIView commitAnimations];
+        [popupMenu present];
     }
     popupMenu.tableView.scrollEnabled = NO;
 }
@@ -318,43 +303,32 @@
         isPopoverVisible = NO;
         
         if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
+            [(InGameMenuViewController *)popoverController.contentViewController removeChat];
             [popoverController dismissPopoverAnimated:YES];
         } else {
-            [UIView beginAnimations:@"hiding popover" context:NULL];
-            [UIView setAnimationDuration:0.35];
-            popupMenu.view.frame = CGRectMake(480, 0, 200, 170);
-            [UIView commitAnimations];
-        
-            [popupMenu.view performSelector:@selector(removeFromSuperview) withObject:nil afterDelay:0.35];
+            [popupMenu dismiss];
         }
         [self buttonReleased:nil];
     }
 }
 
--(void) textFieldDoneEditing:(id) sender{
-    [sender resignFirstResponder];
-}
-
-
 #pragma mark -
 #pragma mark Custom touch event handling
 -(void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
     NSSet *allTouches = [event allTouches];
     UITouch *first, *second;
     
-    if (isPopoverVisible) {
+    // hide in-game menu
+    if (isPopoverVisible)
         [self dismissPopover];
-    }
-    /*
-    if (writeChatTextField) {
-        [self.writeChatTextField resignFirstResponder];
-        [dimTimer setFireDate:HIDING_TIME_DEFAULT];
-    }
-    */
+    
+    // reset default dimming
+    doDim();
     
     switch ([allTouches count]) {
-        case 1:            
+        case 1:       
             removeConfirmationInput();
+            startingPoint = [[[allTouches allObjects] objectAtIndex:0] locationInView:self.view];
             if (2 == [[[allTouches allObjects] objectAtIndex:0] tapCount])
                 HW_zoomReset();
             break;
@@ -403,7 +377,46 @@
                     [UIView setAnimationDuration:ANIMATION_DURATION];
                     [self.view viewWithTag:CONFIRMATION_TAG].alpha = 1;
                     [UIView commitAnimations];
-                }
+                    
+                    // keep the overlay active, or the button will fade
+                    [self activateOverlay];
+                    doNotDim();
+                } else
+                    if (HW_isWeaponTimerable()) {
+                        if (isSegmentVisible) {
+                            UISegmentedControl *grenadeTime = (UISegmentedControl *)[self.view viewWithTag:GRENADE_TAG];
+                            
+                            [UIView beginAnimations:@"removing segmented control" context:NULL];
+                            [UIView setAnimationDuration:ANIMATION_DURATION];
+                            [UIView setAnimationCurve:UIViewAnimationCurveEaseIn];
+                            grenadeTime.frame = CGRectMake(screen.size.height / 2 - 125, screen.size.width, 250, 50);
+                            [UIView commitAnimations];
+                            
+                            [grenadeTime performSelector:@selector(removeFromSuperview) withObject:nil afterDelay:ANIMATION_DURATION];
+                        } else {
+                            NSArray *items = [[NSArray alloc] initWithObjects:@"1",@"2",@"3",@"4",@"5",nil];
+                            UISegmentedControl *grenadeTime = [[UISegmentedControl alloc] initWithItems:items];
+                            [items release];
+                            
+                            [grenadeTime addTarget:self action:@selector(setGrenadeTime:) forControlEvents:UIControlEventValueChanged];
+                            grenadeTime.frame = CGRectMake(screen.size.height / 2 - 125, screen.size.width, 250, 50);
+                            grenadeTime.selectedSegmentIndex = 2;
+                            grenadeTime.tag = GRENADE_TAG;
+                            [self.view addSubview:grenadeTime];
+                            [grenadeTime release];
+                            
+                            [UIView beginAnimations:@"inserting segmented control" context:NULL];
+                            [UIView setAnimationDuration:ANIMATION_DURATION];
+                            [UIView setAnimationCurve:UIViewAnimationCurveEaseIn];
+                            grenadeTime.frame = CGRectMake(screen.size.height / 2 - 125, screen.size.width - 100, 250, 50);
+                            [UIView commitAnimations];
+                            
+                            [self activateOverlay];
+                            doNotDim();
+                        }
+                        isSegmentVisible = !isSegmentVisible;
+                    }
+
             break;
         case 2:
             HW_allKeysUp();
@@ -419,6 +432,12 @@
 -(void) sendHWClick {
     HW_click();
     removeConfirmationInput();
+    doDim();
+}
+
+-(void) setGrenadeTime:(id) sender {
+    UISegmentedControl *theSegment = (UISegmentedControl *)sender;
+    HW_setGrenadeTime(theSegment.selectedSegmentIndex + 1);
 }
 
 -(void) touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event {
@@ -442,6 +461,8 @@
             } else {
                 DLog(@"x: %f y: %f -> X:%d Y:%d", currentPosition.x, currentPosition.y, HWX(currentPosition.x), HWY(currentPosition.y));
                 HW_setCursor(HWX(currentPosition.x), HWY(currentPosition.y));
+                if (HW_isWeaponSwitch())
+                    HW_tab();
             }
             break;
         case 2:
@@ -468,7 +489,8 @@
     }
 }
 
-
+#pragma mark -
+#pragma mark Functions called by pascal
 // called from AddProgress and FinishProgress (respectively)
 void startSpinning() {
     isGameRunning = NO;
@@ -478,12 +500,12 @@
     indicator.center = CGPointMake(screen.size.width/2 - 118, screen.size.height/2);
     indicator.hidesWhenStopped = YES;
     [indicator startAnimating];
-    [[[[UIApplication sharedApplication] keyWindow] viewWithTag:12345] addSubview:indicator];
+    [[[[UIApplication sharedApplication] keyWindow] viewWithTag:SDL_VIEW_TAG] addSubview:indicator];
     [indicator release];
 }
 
 void stopSpinning() {
-    UIActivityIndicatorView *indicator = (UIActivityIndicatorView *)[[[[UIApplication sharedApplication] keyWindow] viewWithTag:12345] viewWithTag:987654];
+    UIActivityIndicatorView *indicator = (UIActivityIndicatorView *)[[[[UIApplication sharedApplication] keyWindow] viewWithTag:SDL_VIEW_TAG] viewWithTag:987654];
     [indicator stopAnimating];
     isGameRunning = YES;
 }
@@ -491,11 +513,16 @@
 void clearView() {
     UIWindow *theWindow = [[UIApplication sharedApplication] keyWindow];
     UIButton *theButton = (UIButton *)[theWindow viewWithTag:CONFIRMATION_TAG];
+    UISegmentedControl *theSegment = (UISegmentedControl *)[theWindow viewWithTag:GRENADE_TAG];
+    
     [UIView beginAnimations:@"remove button" context:NULL];
     [UIView setAnimationDuration:ANIMATION_DURATION];
     theButton.alpha = 0;
+    theSegment.alpha = 0;
     [UIView commitAnimations];
+    
     [theWindow performSelector:@selector(removeFromSuperview) withObject:theButton afterDelay:0.3];
+    [theWindow performSelector:@selector(removeFromSuperview) withObject:theSegment afterDelay:0.3];    
 }
 
 @end
--- a/project_files/HedgewarsMobile/Classes/PascalImports.h	Sat Jul 17 23:44:42 2010 +0400
+++ b/project_files/HedgewarsMobile/Classes/PascalImports.h	Sun Jul 18 03:58:06 2010 +0200
@@ -22,7 +22,7 @@
     void GenLandPreview(void);
 
 
-    void HW_versionInfo(short int*, char**);
+    void HW_versionInfo(short int *netProto, char **versionStr);
 
     void HW_click(void);
     
@@ -39,27 +39,30 @@
     void HW_walkRight(void);
     void HW_aimUp(void);
     void HW_aimDown(void);
+    void HW_preciseSet(BOOL status);
+    
     void HW_shoot(void);
     void HW_jump(void);
     void HW_backjump(void);
     
     void HW_chat(void);
+    void HW_chatEnd(void);
     void HW_tab(void);
     void HW_pause(void);
     
-    void HW_cursorUp(int);
-    void HW_cursorDown(int);
-    void HW_cursorLeft(int);
-    void HW_cursorRight(int);
+    void HW_terminate(BOOL andCloseFrontend);
     
-    void HW_terminate(BOOL);
-    
-    void HW_setLandscape(BOOL);
+    void HW_setLandscape(BOOL rotate);
     void HW_setCursor(int x, int y);
     void HW_saveCursor(BOOL reset);
     
     BOOL HW_isAmmoOpen(void);
     BOOL HW_isWeaponRequiringClick(void);
+    BOOL HW_isWeaponTimerable(void);
+    BOOL HW_isWeaponSwitch(void);
+    
+    void HW_setGrenadeTime(int time);
+    
 #ifdef __cplusplus
 }
 #endif
--- a/project_files/HedgewarsMobile/Classes/PopoverMenuViewController.h	Sat Jul 17 23:44:42 2010 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-//
-//  popupMenuViewController.h
-//  HedgewarsMobile
-//
-//  Created by Vittorio on 25/03/10.
-//  Copyright 2010 __MyCompanyName__. All rights reserved.
-//
-
-#import <UIKit/UIKit.h>
-
-
-@interface PopoverMenuViewController : UITableViewController <UIActionSheetDelegate> {
-    NSArray *menuList;
-    BOOL isPaused;
-}
-@property (nonatomic,retain) NSArray *menuList;
-
-@end
--- a/project_files/HedgewarsMobile/Classes/PopoverMenuViewController.m	Sat Jul 17 23:44:42 2010 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,139 +0,0 @@
-    //
-//  popupMenuViewController.m
-//  HedgewarsMobile
-//
-//  Created by Vittorio on 25/03/10.
-//  Copyright 2010 __MyCompanyName__. All rights reserved.
-//
-
-#import "SDL_uikitappdelegate.h"
-#import "PopoverMenuViewController.h"
-#import "PascalImports.h"
-#import "CommodityFunctions.h"
-#import "SDL_sysvideo.h"
-
-@implementation PopoverMenuViewController
-@synthesize menuList;
-
-
--(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation {
-    return rotationManager(interfaceOrientation);
-}
-
-
--(void) didReceiveMemoryWarning {
-    // Releases the view if it doesn't have a superview.
-    [super didReceiveMemoryWarning];
-}
-
--(void) viewDidLoad {
-    isPaused = NO;
-
-    NSArray *array = [[NSArray alloc] initWithObjects:
-                      NSLocalizedString(@"Pause Game", @""),
-                      NSLocalizedString(@"Chat", @""),
-                      NSLocalizedString(@"End Game", @""),
-                      nil];
-    self.menuList = array;
-    [array release];
-    
-    [super viewDidLoad];
-}
-
--(void) viewDidUnload {
-    self.menuList = nil;
-    [super viewDidUnload];
-    MSG_DIDUNLOAD();
-}
-
--(void) dealloc {
-    [menuList release];
-    [super dealloc];
-}
-
-#pragma mark -
-#pragma mark tableView methods
--(NSInteger) numberOfSectionsInTableView:(UITableView *)tableView {
-    return 1;
-}
-
--(NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
-    return 3;
-}
-
--(UITableViewCell *)tableView:(UITableView *)aTableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
-    static NSString *cellIdentifier = @"CellIdentifier";
-    
-    UITableViewCell *cell = [aTableView dequeueReusableCellWithIdentifier:cellIdentifier];
-    if (nil == cell) {
-        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
-                                       reuseIdentifier:cellIdentifier] autorelease];
-    }
-    cell.textLabel.text = [menuList objectAtIndex:[indexPath row]];
-    
-    return cell;
-}
-
--(void) tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
-    UIActionSheet *actionSheet;
-    
-    switch ([indexPath row]) {
-        case 0:
-            HW_pause();
-            isPaused = !isPaused;
-            break;
-        case 1:
-            HW_chat();
-            /*
-            SDL_VideoDevice *_this = SDL_GetVideoDevice();
-            SDL_VideoDisplay *display = &_this->displays[0];
-            SDL_Window *window = display->windows;
-            SDL_iPhoneKeyboardShow(window);
-            */
-            break;
-        case 2:
-            // expand the view (and table) so that the actionsheet can be selected on the iPhone
-            if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
-                [self.tableView deselectRowAtIndexPath:indexPath animated:NO];
-                [UIView beginAnimations:@"table width more" context:NULL];
-                [UIView setAnimationDuration:0.2];
-                self.view.frame = CGRectMake(0, 0, 480, 320);
-                [UIView commitAnimations];
-            }
-            actionSheet = [[UIActionSheet alloc] initWithTitle:NSLocalizedString(@"Are you reeeeeally sure?", @"")
-                                                      delegate:self
-                                             cancelButtonTitle:NSLocalizedString(@"Well, maybe not...", @"")
-                                        destructiveButtonTitle:NSLocalizedString(@"Of course!", @"")
-                                             otherButtonTitles:nil];
-            [actionSheet showInView:self.view];
-            [actionSheet release];
-            
-            if (!isPaused) 
-                HW_pause();
-            break;
-        default:
-            NSLog(@"Warning: unset case value in section!");
-            break;
-    }
-    
-    [aTableView deselectRowAtIndexPath:indexPath animated:YES];
-}
-
-#pragma mark -
-#pragma mark actionSheet methods
--(void) actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger) buttonIndex {
-    if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone){
-        [UIView beginAnimations:@"table width less" context:NULL];
-        [UIView setAnimationDuration:0.2];
-        self.view.frame = CGRectMake(280, 0, 200, 170);
-        [UIView commitAnimations];
-    }
-    
-    if ([actionSheet cancelButtonIndex] != buttonIndex)
-        HW_terminate(NO);
-    else
-        if (!isPaused) 
-            HW_pause();     
-}
-
-@end
--- a/project_files/HedgewarsMobile/Classes/SDL_uikitappdelegate.m	Sat Jul 17 23:44:42 2010 +0400
+++ b/project_files/HedgewarsMobile/Classes/SDL_uikitappdelegate.m	Sun Jul 18 03:58:06 2010 +0200
@@ -76,11 +76,6 @@
 
 // main routine for calling the actual game engine
 -(IBAction) startSDLgame: (NSDictionary *)gameDictionary {
-    [UIView beginAnimations:@"removing main controller" context:NULL];
-    [UIView setAnimationDuration:1];
-    mainViewController.view.alpha = 0;
-    [UIView commitAnimations];
-
     // pull out useful configuration info from various files
     GameSetup *setup = [[GameSetup alloc] initWithDictionary:gameDictionary];
     
@@ -98,16 +93,11 @@
     free(gameArgs);
     
     // bring the uiwindow below in front
-    //UIWindow *aWin = [[[UIApplication sharedApplication] windows] objectAtIndex:0];
-    //[aWin makeKeyAndVisible];
+    UIWindow *aWin = [[[UIApplication sharedApplication] windows] objectAtIndex:0];
+    [aWin makeKeyAndVisible];
     
     // notice that in the simulator this reports 2 windows
     DLog(@"%@",[[UIApplication sharedApplication] windows]);
-    
-    [UIView beginAnimations:@"inserting main controller" context:NULL];
-    [UIView setAnimationDuration:1];
-    mainViewController.view.alpha = 1;
-    [UIView commitAnimations];
 }
 
 -(void) displayOverlayLater {
--- a/project_files/HedgewarsMobile/Hedgewars.xcodeproj/project.pbxproj	Sat Jul 17 23:44:42 2010 +0400
+++ b/project_files/HedgewarsMobile/Hedgewars.xcodeproj/project.pbxproj	Sun Jul 18 03:58:06 2010 +0200
@@ -29,6 +29,7 @@
 		611F4D4B11B27A9900F9759A /* uScript.pas in Sources */ = {isa = PBXBuildFile; fileRef = 611F4D4A11B27A9900F9759A /* uScript.pas */; };
 		61272334117DF764005B90CF /* libSDL_image.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 61272333117DF752005B90CF /* libSDL_image.a */; };
 		61272339117DF778005B90CF /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 61272338117DF778005B90CF /* MobileCoreServices.framework */; };
+		6129B9F711EFB04D0017E305 /* denied.png in Resources */ = {isa = PBXBuildFile; fileRef = 6129B9F611EFB04D0017E305 /* denied.png */; };
 		61370653117B1D50004EE44A /* Entitlements-Distribution.plist in Resources */ = {isa = PBXBuildFile; fileRef = 61370652117B1D50004EE44A /* Entitlements-Distribution.plist */; };
 		61536CCF11CE836E00D87A7E /* libfreetype_x86.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 61798917114AAF2100BA94A9 /* libfreetype_x86.a */; };
 		61536DF411CEAE7100D87A7E /* GameConfigViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6165924A11CA9CB400D6E256 /* GameConfigViewController.xib */; };
@@ -46,7 +47,7 @@
 		6165921611CA9BA200D6E256 /* MapConfigViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 616591F311CA9BA200D6E256 /* MapConfigViewController.m */; };
 		6165921711CA9BA200D6E256 /* MasterViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 616591F511CA9BA200D6E256 /* MasterViewController.m */; };
 		6165921811CA9BA200D6E256 /* OverlayViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 616591F711CA9BA200D6E256 /* OverlayViewController.m */; };
-		6165921911CA9BA200D6E256 /* PopoverMenuViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 616591F911CA9BA200D6E256 /* PopoverMenuViewController.m */; };
+		6165921911CA9BA200D6E256 /* InGameMenuViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 616591F911CA9BA200D6E256 /* InGameMenuViewController.m */; };
 		6165921A11CA9BA200D6E256 /* SchemeSettingsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 616591FB11CA9BA200D6E256 /* SchemeSettingsViewController.m */; };
 		6165921B11CA9BA200D6E256 /* SchemeWeaponConfigViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 616591FD11CA9BA200D6E256 /* SchemeWeaponConfigViewController.m */; };
 		6165921C11CA9BA200D6E256 /* SingleSchemeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 616591FF11CA9BA200D6E256 /* SingleSchemeViewController.m */; };
@@ -250,6 +251,7 @@
 		611FD9CB1155A28C00C2203D /* HedgewarsTitle.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = HedgewarsTitle.png; path = ../../QTfrontend/res/HedgewarsTitle.png; sourceTree = SOURCE_ROOT; };
 		6127232E117DF752005B90CF /* SDL_image.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SDL_image.xcodeproj; path = "../../../Library/SDL-1.3/SDL_image/Xcode_iPhone/SDL_image.xcodeproj"; sourceTree = SOURCE_ROOT; };
 		61272338117DF778005B90CF /* MobileCoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MobileCoreServices.framework; path = System/Library/Frameworks/MobileCoreServices.framework; sourceTree = SDKROOT; };
+		6129B9F611EFB04D0017E305 /* denied.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = denied.png; path = Resources/denied.png; sourceTree = "<group>"; };
 		61370652117B1D50004EE44A /* Entitlements-Distribution.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Entitlements-Distribution.plist"; sourceTree = "<group>"; };
 		614E333D11DE9A93009DBA4E /* VGSHandlers.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = VGSHandlers.inc; path = ../../hedgewars/VGSHandlers.inc; sourceTree = SOURCE_ROOT; };
 		6163EE7C11CC2600001C0453 /* SingleWeaponViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SingleWeaponViewController.h; sourceTree = "<group>"; };
@@ -280,8 +282,8 @@
 		616591F511CA9BA200D6E256 /* MasterViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MasterViewController.m; sourceTree = "<group>"; };
 		616591F611CA9BA200D6E256 /* OverlayViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OverlayViewController.h; sourceTree = "<group>"; };
 		616591F711CA9BA200D6E256 /* OverlayViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OverlayViewController.m; sourceTree = "<group>"; };
-		616591F811CA9BA200D6E256 /* PopoverMenuViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PopoverMenuViewController.h; sourceTree = "<group>"; };
-		616591F911CA9BA200D6E256 /* PopoverMenuViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PopoverMenuViewController.m; sourceTree = "<group>"; };
+		616591F811CA9BA200D6E256 /* InGameMenuViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InGameMenuViewController.h; sourceTree = "<group>"; };
+		616591F911CA9BA200D6E256 /* InGameMenuViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InGameMenuViewController.m; sourceTree = "<group>"; };
 		616591FA11CA9BA200D6E256 /* SchemeSettingsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SchemeSettingsViewController.h; sourceTree = "<group>"; };
 		616591FB11CA9BA200D6E256 /* SchemeSettingsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SchemeSettingsViewController.m; sourceTree = "<group>"; };
 		616591FC11CA9BA200D6E256 /* SchemeWeaponConfigViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SchemeWeaponConfigViewController.h; sourceTree = "<group>"; };
@@ -529,6 +531,7 @@
 		29B97317FDCFA39411CA2CEA /* Resources */ = {
 			isa = PBXGroup;
 			children = (
+				6129B9F611EFB04D0017E305 /* denied.png */,
 				61F7A42811E2905C0040BA66 /* Icons */,
 				61F903FA11DF58680068B24D /* Frontend-iPad */,
 				61F903E311DF584D0068B24D /* Frontend-iPhone */,
@@ -658,8 +661,8 @@
 		6163EE6C11CC253F001C0453 /* Overlay */ = {
 			isa = PBXGroup;
 			children = (
-				616591F811CA9BA200D6E256 /* PopoverMenuViewController.h */,
-				616591F911CA9BA200D6E256 /* PopoverMenuViewController.m */,
+				616591F811CA9BA200D6E256 /* InGameMenuViewController.h */,
+				616591F911CA9BA200D6E256 /* InGameMenuViewController.m */,
 				616591F611CA9BA200D6E256 /* OverlayViewController.h */,
 				616591F711CA9BA200D6E256 /* OverlayViewController.m */,
 				6165925011CA9CB400D6E256 /* OverlayViewController.xib */,
@@ -1056,6 +1059,7 @@
 				6183D83E11E2BCE200A88903 /* LI-ipad-Landscape.png in Resources */,
 				6183D83F11E2BCE200A88903 /* LI-iphone-Landscape.png in Resources */,
 				619C09EA11E8B8D600F1DF16 /* title_small.png in Resources */,
+				6129B9F711EFB04D0017E305 /* denied.png in Resources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -1159,7 +1163,7 @@
 				6165921611CA9BA200D6E256 /* MapConfigViewController.m in Sources */,
 				6165921711CA9BA200D6E256 /* MasterViewController.m in Sources */,
 				6165921811CA9BA200D6E256 /* OverlayViewController.m in Sources */,
-				6165921911CA9BA200D6E256 /* PopoverMenuViewController.m in Sources */,
+				6165921911CA9BA200D6E256 /* InGameMenuViewController.m in Sources */,
 				6165921A11CA9BA200D6E256 /* SchemeSettingsViewController.m in Sources */,
 				6165921B11CA9BA200D6E256 /* SchemeWeaponConfigViewController.m in Sources */,
 				6165921C11CA9BA200D6E256 /* SingleSchemeViewController.m in Sources */,
@@ -1276,9 +1280,9 @@
 				GCC_WARN_UNUSED_VARIABLE = YES;
 				HEADER_SEARCH_PATHS = (
 					/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/OpenAL.framework/Headers,
-					"\"$(SRCROOT)/../../../Library/SDL-1.3/SDL/include\"/**",
-					"\"$(SRCROOT)/../../../Library/SDL-1.3/SDL/src\"/**",
-					"\"$(SRCROOT)/../../../Library/SDL-1.3/SDL_net\"",
+					"\"$(SRCROOT)/../../../Library/SDL-1.3/SDL/src/\"/**",
+					"\"$(SRCROOT)/../../../Library/SDL-1.3/SDL_net/\"",
+					"\"$(SRCROOT)/../../../Library/SDL-1.3/SDL/include/\"",
 				);
 				IPHONEOS_DEPLOYMENT_TARGET = 3.0;
 				ONLY_ACTIVE_ARCH = NO;
@@ -1393,9 +1397,9 @@
 				GCC_WARN_UNUSED_VARIABLE = YES;
 				HEADER_SEARCH_PATHS = (
 					/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/OpenAL.framework/Headers,
-					"\"$(SRCROOT)/../../../Library/SDL-1.3/SDL/include\"/**",
-					"\"$(SRCROOT)/../../../Library/SDL-1.3/SDL/src\"/**",
-					"\"$(SRCROOT)/../../../Library/SDL-1.3/SDL_net\"",
+					"\"$(SRCROOT)/../../../Library/SDL-1.3/SDL/src/\"/**",
+					"\"$(SRCROOT)/../../../Library/SDL-1.3/SDL_net/\"",
+					"\"$(SRCROOT)/../../../Library/SDL-1.3/SDL/include/\"",
 				);
 				IPHONEOS_DEPLOYMENT_TARGET = 3.0;
 				ONLY_ACTIVE_ARCH = NO;
@@ -1593,9 +1597,9 @@
 				GCC_WARN_UNUSED_VARIABLE = YES;
 				HEADER_SEARCH_PATHS = (
 					/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/OpenAL.framework/Headers,
-					"\"$(SRCROOT)/../../../Library/SDL-1.3/SDL/include\"/**",
-					"\"$(SRCROOT)/../../../Library/SDL-1.3/SDL/src\"/**",
-					"\"$(SRCROOT)/../../../Library/SDL-1.3/SDL_net\"",
+					"\"$(SRCROOT)/../../../Library/SDL-1.3/SDL/src/\"/**",
+					"\"$(SRCROOT)/../../../Library/SDL-1.3/SDL_net/\"",
+					"\"$(SRCROOT)/../../../Library/SDL-1.3/SDL/include/\"",
 				);
 				IPHONEOS_DEPLOYMENT_TARGET = 3.0;
 				ONLY_ACTIVE_ARCH = NO;
@@ -1633,9 +1637,9 @@
 				GCC_WARN_UNUSED_VARIABLE = YES;
 				HEADER_SEARCH_PATHS = (
 					/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/OpenAL.framework/Headers,
-					"\"$(SRCROOT)/../../../Library/SDL-1.3/SDL/include\"/**",
-					"\"$(SRCROOT)/../../../Library/SDL-1.3/SDL/src\"/**",
-					"\"$(SRCROOT)/../../../Library/SDL-1.3/SDL_net\"",
+					"\"$(SRCROOT)/../../../Library/SDL-1.3/SDL/src/\"/**",
+					"\"$(SRCROOT)/../../../Library/SDL-1.3/SDL_net/\"",
+					"\"$(SRCROOT)/../../../Library/SDL-1.3/SDL/include/\"",
 				);
 				IPHONEOS_DEPLOYMENT_TARGET = 3.0;
 				ONLY_ACTIVE_ARCH = NO;
Binary file project_files/HedgewarsMobile/Resources/denied.png has changed