project_files/HedgewarsMobile/Classes/GameConfigViewController.m
changeset 7048 0a4c88935902
parent 6908 896ed2afcfb8
child 8441 a00b0fa0dbd7
equal deleted inserted replaced
7047:606acf1f80be 7048:0a4c88935902
    19 
    19 
    20 #import "GameConfigViewController.h"
    20 #import "GameConfigViewController.h"
    21 #import "MapConfigViewController.h"
    21 #import "MapConfigViewController.h"
    22 #import "TeamConfigViewController.h"
    22 #import "TeamConfigViewController.h"
    23 #import "SchemeWeaponConfigViewController.h"
    23 #import "SchemeWeaponConfigViewController.h"
    24 #import "HelpPageLobbyViewController.h"
       
    25 #import "GameInterfaceBridge.h"
    24 #import "GameInterfaceBridge.h"
    26 
    25 
    27 
    26 
    28 @implementation GameConfigViewController
    27 @implementation GameConfigViewController
    29 @synthesize imgContainer, helpPage, titleImage, sliderBackground,
    28 @synthesize imgContainer, titleImage, sliderBackground, //helpPage,
    30             mapConfigViewController, teamConfigViewController, schemeWeaponConfigViewController;
    29             mapConfigViewController, teamConfigViewController, schemeWeaponConfigViewController;
    31 
    30 
    32 -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    31 -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    33     return rotationManager(interfaceOrientation);
    32     return rotationManager(interfaceOrientation);
    34 }
    33 }
    65             [self startGame:theButton];
    64             [self startGame:theButton];
    66             
    65             
    67             break;
    66             break;
    68         case 2:
    67         case 2:
    69             [[AudioManagerController mainManager] playClickSound];
    68             [[AudioManagerController mainManager] playClickSound];
       
    69             /*
    70             if (self.helpPage == nil)
    70             if (self.helpPage == nil)
    71                 self.helpPage = [[HelpPageLobbyViewController alloc] initWithNibName:@"HelpPageLobbyViewController-iPad" bundle:nil];
    71                 self.helpPage = [[HelpPageLobbyViewController alloc] initWithNibName:@"HelpPageLobbyViewController-iPad" bundle:nil];
    72             self.helpPage.view.alpha = 0;
    72             self.helpPage.view.alpha = 0;
    73             [self.view addSubview:self.helpPage.view];
    73             [self.view addSubview:self.helpPage.view];
    74             [UIView beginAnimations:@"helplobby" context:NULL];
    74             [UIView beginAnimations:@"helplobby" context:NULL];
    75             self.helpPage.view.alpha = 1;
    75             self.helpPage.view.alpha = 1;
    76             [UIView commitAnimations];
    76             [UIView commitAnimations];
       
    77             */
    77             break;
    78             break;
    78         default:
    79         default:
    79             DLog(@"Nope");
    80             DLog(@"Nope");
    80             break;
    81             break;
    81     }
    82     }
   101             // this message is compulsory otherwise the table won't be loaded at all
   102             // this message is compulsory otherwise the table won't be loaded at all
   102             [schemeWeaponConfigViewController viewWillAppear:NO];
   103             [schemeWeaponConfigViewController viewWillAppear:NO];
   103             [self.view bringSubviewToFront:schemeWeaponConfigViewController.view];
   104             [self.view bringSubviewToFront:schemeWeaponConfigViewController.view];
   104             break;
   105             break;
   105         case 3:
   106         case 3:
       
   107             /*
   106             if (helpPage == nil) {
   108             if (helpPage == nil) {
   107                 helpPage = [[HelpPageLobbyViewController alloc] initWithNibName:@"HelpPageLobbyViewController-iPhone" bundle:nil];
   109                 helpPage = [[HelpPageLobbyViewController alloc] initWithNibName:@"HelpPageLobbyViewController-iPhone" bundle:nil];
   108                 [self.view addSubview:helpPage.view];
   110                 [self.view addSubview:helpPage.view];
   109             }
   111             }
   110             // this message is compulsory otherwise the table won't be loaded at all
   112             // this message is compulsory otherwise the table won't be loaded at all
   111             [helpPage viewWillAppear:NO];
   113             [helpPage viewWillAppear:NO];
   112             [self.view bringSubviewToFront:helpPage.view];
   114             [self.view bringSubviewToFront:helpPage.view];
       
   115             */
   113             break;
   116             break;
   114         default:
   117         default:
   115             DLog(@"Nope");
   118             DLog(@"Nope");
   116             break;
   119             break;
   117     }
   120     }
   392         self.mapConfigViewController = nil;
   395         self.mapConfigViewController = nil;
   393     if (self.teamConfigViewController.view.superview == nil)
   396     if (self.teamConfigViewController.view.superview == nil)
   394         self.teamConfigViewController = nil;
   397         self.teamConfigViewController = nil;
   395     if (self.schemeWeaponConfigViewController.view.superview == nil)
   398     if (self.schemeWeaponConfigViewController.view.superview == nil)
   396         self.schemeWeaponConfigViewController = nil;
   399         self.schemeWeaponConfigViewController = nil;
   397     if (self.helpPage.view.superview == nil)
   400     //if (self.helpPage.view.superview == nil)
   398         self.helpPage = nil;
   401     //    self.helpPage = nil;
   399     MSG_MEMCLEAN();
   402     MSG_MEMCLEAN();
   400     [super didReceiveMemoryWarning];
   403     [super didReceiveMemoryWarning];
   401 }
   404 }
   402 
   405 
   403 -(void) viewDidUnload {
   406 -(void) viewDidUnload {
   405     self.titleImage = nil;
   408     self.titleImage = nil;
   406     self.sliderBackground = nil;
   409     self.sliderBackground = nil;
   407     self.schemeWeaponConfigViewController = nil;
   410     self.schemeWeaponConfigViewController = nil;
   408     self.teamConfigViewController = nil;
   411     self.teamConfigViewController = nil;
   409     self.mapConfigViewController = nil;
   412     self.mapConfigViewController = nil;
   410     self.helpPage = nil;
   413     //self.helpPage = nil;
   411     MSG_DIDUNLOAD();
   414     MSG_DIDUNLOAD();
   412     [super viewDidUnload];
   415     [super viewDidUnload];
   413 }
   416 }
   414 
   417 
   415 -(void) dealloc {
   418 -(void) dealloc {
   417     releaseAndNil(titleImage);
   420     releaseAndNil(titleImage);
   418     releaseAndNil(sliderBackground);
   421     releaseAndNil(sliderBackground);
   419     releaseAndNil(schemeWeaponConfigViewController);
   422     releaseAndNil(schemeWeaponConfigViewController);
   420     releaseAndNil(teamConfigViewController);
   423     releaseAndNil(teamConfigViewController);
   421     releaseAndNil(mapConfigViewController);
   424     releaseAndNil(mapConfigViewController);
   422     releaseAndNil(helpPage);
   425     //releaseAndNil(helpPage);
   423     [super dealloc];
   426     [super dealloc];
   424 }
   427 }
   425 
   428 
   426 @end
   429 @end