--- a/project_files/HedgewarsMobile/Classes/OverlayViewController.m Sat Sep 24 21:54:11 2011 +0200
+++ b/project_files/HedgewarsMobile/Classes/OverlayViewController.m Sat Sep 24 22:27:52 2011 +0200
@@ -34,6 +34,8 @@
#define doNotDim() [dimTimer setFireDate:HIDING_TIME_NEVER]
+static OverlayViewController *mainOverlay;
+
@implementation OverlayViewController
@synthesize popoverController, popupMenu, helpPage, amvc, initialScreenCount, lowerIndicator, savesIndicator,
confirmButton, grenadeTimeSegment;
@@ -47,17 +49,22 @@
#pragma mark -
#pragma mark View Management
--(id) initWithCoder:(NSCoder *)aDecoder {
- if ((self = [super initWithCoder:aDecoder])) {
+-(id) initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
+ if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) {
isAttacking = NO;
isPopoverVisible = NO;
initialScreenCount = (IS_DUALHEAD() ? 2 : 1);
lowerIndicator = nil;
savesIndicator = nil;
+ mainOverlay = self;
}
return self;
}
++(OverlayViewController *)mainOverlay {
+ return mainOverlay;
+}
+
-(void) viewDidLoad {
// fill all the screen available as sdlview disables autoresizing
CGRect rect = [[UIScreen mainScreen] bounds];
@@ -108,6 +115,7 @@
// only objects initialized in viewDidLoad should be here
dimTimer = nil;
+ mainOverlay = nil;
self.helpPage = nil;
[self dismissPopover];
self.popoverController = nil;