project_files/HedgewarsMobile/Classes/OverlayViewController.h
author koda
Thu, 14 Oct 2010 22:01:33 +0200
changeset 3976 abaf741a4e21
parent 3971 5c82ee165ed5
child 4028 eb371ada631d
permissions -rw-r--r--
less warning, no rotation glitch, more comments
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3829
81db3c85784b headers ftw, also right project file
koda
parents: 3792
diff changeset
     1
/*
81db3c85784b headers ftw, also right project file
koda
parents: 3792
diff changeset
     2
 * Hedgewars-iOS, a Hedgewars port for iOS devices
81db3c85784b headers ftw, also right project file
koda
parents: 3792
diff changeset
     3
 * Copyright (c) 2009-2010 Vittorio Giovara <vittorio.giovara@gmail.com>
81db3c85784b headers ftw, also right project file
koda
parents: 3792
diff changeset
     4
 *
81db3c85784b headers ftw, also right project file
koda
parents: 3792
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
81db3c85784b headers ftw, also right project file
koda
parents: 3792
diff changeset
     6
 * it under the terms of the GNU General Public License as published by
81db3c85784b headers ftw, also right project file
koda
parents: 3792
diff changeset
     7
 * the Free Software Foundation; version 2 of the License
81db3c85784b headers ftw, also right project file
koda
parents: 3792
diff changeset
     8
 *
81db3c85784b headers ftw, also right project file
koda
parents: 3792
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
81db3c85784b headers ftw, also right project file
koda
parents: 3792
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
81db3c85784b headers ftw, also right project file
koda
parents: 3792
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
81db3c85784b headers ftw, also right project file
koda
parents: 3792
diff changeset
    12
 * GNU General Public License for more details.
81db3c85784b headers ftw, also right project file
koda
parents: 3792
diff changeset
    13
 *
81db3c85784b headers ftw, also right project file
koda
parents: 3792
diff changeset
    14
 * You should have received a copy of the GNU General Public License
81db3c85784b headers ftw, also right project file
koda
parents: 3792
diff changeset
    15
 * along with this program; if not, write to the Free Software
81db3c85784b headers ftw, also right project file
koda
parents: 3792
diff changeset
    16
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
81db3c85784b headers ftw, also right project file
koda
parents: 3792
diff changeset
    17
 *
81db3c85784b headers ftw, also right project file
koda
parents: 3792
diff changeset
    18
 * File created on 16/03/2010.
81db3c85784b headers ftw, also right project file
koda
parents: 3792
diff changeset
    19
 */
81db3c85784b headers ftw, also right project file
koda
parents: 3792
diff changeset
    20
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    21
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    22
#import <UIKit/UIKit.h>
3647
0d0df215fb52 making chat work... (keyboard support is heavily broken in sdl upstream)
koda
parents: 3646
diff changeset
    23
#import "SDL_sysvideo.h"
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    24
3647
0d0df215fb52 making chat work... (keyboard support is heavily broken in sdl upstream)
koda
parents: 3646
diff changeset
    25
@class InGameMenuViewController;
3792
dd9345e74b66 help page for lobby
koda
parents: 3791
diff changeset
    26
@class HelpPageViewController;
3933
1a873262f5dd polishing the cocoa ammomenu a little, still requires work
koda
parents: 3922
diff changeset
    27
@class AmmoMenuViewController;
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    28
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    29
@interface OverlayViewController : UIViewController {
3647
0d0df215fb52 making chat work... (keyboard support is heavily broken in sdl upstream)
koda
parents: 3646
diff changeset
    30
    // the timer that dims the overlay
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    31
    NSTimer *dimTimer;
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    32
3647
0d0df215fb52 making chat work... (keyboard support is heavily broken in sdl upstream)
koda
parents: 3646
diff changeset
    33
    // the in-game menu
3971
5c82ee165ed5 minor stuff
koda
parents: 3941
diff changeset
    34
    UIPopoverController *popoverController; // iPad only, never set on iPhone
3647
0d0df215fb52 making chat work... (keyboard support is heavily broken in sdl upstream)
koda
parents: 3646
diff changeset
    35
    InGameMenuViewController *popupMenu;
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    36
    BOOL isPopoverVisible;
3703
12d17c6e8855 halfway-through finishing the frontend with new graphics by Tiy + initial 'About' page set up
koda
parents: 3661
diff changeset
    37
3791
98072b3871c1 help page for ingame, some other fixes here and there
koda
parents: 3737
diff changeset
    38
    // the help menu
3792
dd9345e74b66 help page for lobby
koda
parents: 3791
diff changeset
    39
    HelpPageViewController *helpPage;
3791
98072b3871c1 help page for ingame, some other fixes here and there
koda
parents: 3737
diff changeset
    40
3933
1a873262f5dd polishing the cocoa ammomenu a little, still requires work
koda
parents: 3922
diff changeset
    41
    // the objc ammomenu
1a873262f5dd polishing the cocoa ammomenu a little, still requires work
koda
parents: 3922
diff changeset
    42
    AmmoMenuViewController *amvc;
3976
abaf741a4e21 less warning, no rotation glitch, more comments
koda
parents: 3971
diff changeset
    43
    BOOL wasVisible;
3933
1a873262f5dd polishing the cocoa ammomenu a little, still requires work
koda
parents: 3922
diff changeset
    44
    
3647
0d0df215fb52 making chat work... (keyboard support is heavily broken in sdl upstream)
koda
parents: 3646
diff changeset
    45
    // ths touch section
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    46
    CGFloat initialDistanceForPinching;
3651
7058ca178f3b switching hogs now works
koda
parents: 3650
diff changeset
    47
    CGPoint startingPoint;
3650
ec90e573f47a add a timer selection for grenades
koda
parents: 3647
diff changeset
    48
    BOOL isSegmentVisible;
3737
2ba6ac8a114b reworked the initialization functions, now it should be safe to update and no more need of spinning wheel at first launch
koda
parents: 3703
diff changeset
    49
    BOOL isAttacking;
3935
5ca27a0e9a63 made the new menu toggable
koda
parents: 3933
diff changeset
    50
    
5ca27a0e9a63 made the new menu toggable
koda
parents: 3933
diff changeset
    51
    // stuff initialized externally
5ca27a0e9a63 made the new menu toggable
koda
parents: 3933
diff changeset
    52
    BOOL isNetGame;
5ca27a0e9a63 made the new menu toggable
koda
parents: 3933
diff changeset
    53
    BOOL useClassicMenu;
3941
017b2b31e1c6 integrate nicely with external display
koda
parents: 3935
diff changeset
    54
    
017b2b31e1c6 integrate nicely with external display
koda
parents: 3935
diff changeset
    55
    // dual head support
017b2b31e1c6 integrate nicely with external display
koda
parents: 3935
diff changeset
    56
    NSInteger initialScreenCount;
3976
abaf741a4e21 less warning, no rotation glitch, more comments
koda
parents: 3971
diff changeset
    57
    NSInteger a, b;
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    58
}
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    59
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    60
@property (nonatomic,retain) id popoverController;
3647
0d0df215fb52 making chat work... (keyboard support is heavily broken in sdl upstream)
koda
parents: 3646
diff changeset
    61
@property (nonatomic,retain) InGameMenuViewController *popupMenu;
3792
dd9345e74b66 help page for lobby
koda
parents: 3791
diff changeset
    62
@property (nonatomic,retain) HelpPageViewController *helpPage;
3933
1a873262f5dd polishing the cocoa ammomenu a little, still requires work
koda
parents: 3922
diff changeset
    63
@property (nonatomic,retain) AmmoMenuViewController *amvc;
3935
5ca27a0e9a63 made the new menu toggable
koda
parents: 3933
diff changeset
    64
@property (assign) BOOL isNetGame;
5ca27a0e9a63 made the new menu toggable
koda
parents: 3933
diff changeset
    65
@property (assign) BOOL useClassicMenu;
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    66
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    67
-(void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event;
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    68
-(void) touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event;
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    69
-(void) touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event;
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    70
-(void) touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event;
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    71
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    72
-(IBAction) buttonReleased:(id) sender;
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    73
-(IBAction) buttonPressed:(id) sender;
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    74
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    75
-(void) showPopover;
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    76
-(void) dismissPopover;
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    77
-(void) dimOverlay;
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    78
-(void) activateOverlay;
3941
017b2b31e1c6 integrate nicely with external display
koda
parents: 3935
diff changeset
    79
-(void) cleanup;
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    80
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    81
@end
3661
2378ada8a6ee i can haz panning
koda
parents: 3651
diff changeset
    82
3904
22e4d74240e5 finishing touches to save games handling (help label, dim on overlay, edit text only when table is editable)
koda
parents: 3829
diff changeset
    83
// actual game started (controls should be enabled)
3661
2378ada8a6ee i can haz panning
koda
parents: 3651
diff changeset
    84
BOOL isGameRunning;
3904
22e4d74240e5 finishing touches to save games handling (help label, dim on overlay, edit text only when table is editable)
koda
parents: 3829
diff changeset
    85
void setGameRunning(BOOL value);
22e4d74240e5 finishing touches to save games handling (help label, dim on overlay, edit text only when table is editable)
koda
parents: 3829
diff changeset
    86
// black screen present
22e4d74240e5 finishing touches to save games handling (help label, dim on overlay, edit text only when table is editable)
koda
parents: 3829
diff changeset
    87
BOOL isReplay;
3791
98072b3871c1 help page for ingame, some other fixes here and there
koda
parents: 3737
diff changeset
    88
// cache the grenade time
98072b3871c1 help page for ingame, some other fixes here and there
koda
parents: 3737
diff changeset
    89
NSInteger cachedGrenadeTime;