project_files/HedgewarsMobile/Classes/GameConfigViewController.m
author koda
Sat, 19 Jun 2010 00:48:47 +0200
changeset 3522 156c04c6a3d8
parent 3514 59dbd31e9953
child 3523 6592fbb969da
permissions -rw-r--r--
add initial stubs for selecting weapons in the ifrontend
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3356
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
     1
    //
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
     2
//  GameConfigViewController.m
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
     3
//  HedgewarsMobile
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
     4
//
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
     5
//  Created by Vittorio on 18/04/10.
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
     6
//  Copyright 2010 __MyCompanyName__. All rights reserved.
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
     7
//
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
     8
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
     9
#import "GameConfigViewController.h"
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    10
#import "SDL_uikitappdelegate.h"
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    11
#import "CommodityFunctions.h"
3365
37ac593e9027 wow all these files only for land preview and seed generation
koda
parents: 3364
diff changeset
    12
#import "MapConfigViewController.h"
3361
cfc6cd502f85 buttons for number of hogs in game config
koda
parents: 3356
diff changeset
    13
#import "TeamConfigViewController.h"
3513
f589230fa21b now it's possible to select the scheme file in the ifrontendfix a type about loading an image (iphone file system IS case senstive)
koda
parents: 3490
diff changeset
    14
#import "SchemeWeaponConfigViewController.h"
3356
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    15
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    16
@implementation GameConfigViewController
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    17
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    18
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    19
-(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    20
    return rotationManager(interfaceOrientation);
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    21
}
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    22
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    23
-(IBAction) buttonPressed:(id) sender {
3361
cfc6cd502f85 buttons for number of hogs in game config
koda
parents: 3356
diff changeset
    24
    // works even if it's not actually a button
3356
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    25
    UIButton *theButton = (UIButton *)sender;
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    26
    switch (theButton.tag) {
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    27
        case 0:
3365
37ac593e9027 wow all these files only for land preview and seed generation
koda
parents: 3364
diff changeset
    28
            [[self parentViewController] dismissModalViewControllerAnimated:YES];
3356
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    29
            break;
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    30
        case 1:
3364
e5403e2bf02c no more hardcoded teams, team selection is real \o/
koda
parents: 3361
diff changeset
    31
            [self performSelector:@selector(startGame)
3356
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    32
                       withObject:nil
3364
e5403e2bf02c no more hardcoded teams, team selection is real \o/
koda
parents: 3361
diff changeset
    33
                       afterDelay:0.25];
3356
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    34
            break;
3513
f589230fa21b now it's possible to select the scheme file in the ifrontendfix a type about loading an image (iphone file system IS case senstive)
koda
parents: 3490
diff changeset
    35
        default:
f589230fa21b now it's possible to select the scheme file in the ifrontendfix a type about loading an image (iphone file system IS case senstive)
koda
parents: 3490
diff changeset
    36
            break;
3356
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    37
    }
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    38
}
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
    39
3365
37ac593e9027 wow all these files only for land preview and seed generation
koda
parents: 3364
diff changeset
    40
-(IBAction) segmentPressed:(id) sender {
37ac593e9027 wow all these files only for land preview and seed generation
koda
parents: 3364
diff changeset
    41
    UISegmentedControl *theSegment = (UISegmentedControl *)sender;
3369
c7289e42f0ee add other controls for map preview, also fix a bug in digest
koda
parents: 3365
diff changeset
    42
3365
37ac593e9027 wow all these files only for land preview and seed generation
koda
parents: 3364
diff changeset
    43
    switch (theSegment.selectedSegmentIndex) {
37ac593e9027 wow all these files only for land preview and seed generation
koda
parents: 3364
diff changeset
    44
        case 0:
37ac593e9027 wow all these files only for land preview and seed generation
koda
parents: 3364
diff changeset
    45
            // this init here is just aestetic as this controller was already set up in viewDidLoad
37ac593e9027 wow all these files only for land preview and seed generation
koda
parents: 3364
diff changeset
    46
            if (mapConfigViewController == nil) {
37ac593e9027 wow all these files only for land preview and seed generation
koda
parents: 3364
diff changeset
    47
                mapConfigViewController = [[MapConfigViewController alloc] initWithNibName:@"MapConfigViewController-iPhone" bundle:nil];
37ac593e9027 wow all these files only for land preview and seed generation
koda
parents: 3364
diff changeset
    48
            }
37ac593e9027 wow all these files only for land preview and seed generation
koda
parents: 3364
diff changeset
    49
            activeController = mapConfigViewController;
37ac593e9027 wow all these files only for land preview and seed generation
koda
parents: 3364
diff changeset
    50
            break;
37ac593e9027 wow all these files only for land preview and seed generation
koda
parents: 3364
diff changeset
    51
        case 1:
37ac593e9027 wow all these files only for land preview and seed generation
koda
parents: 3364
diff changeset
    52
            if (teamConfigViewController == nil) {
37ac593e9027 wow all these files only for land preview and seed generation
koda
parents: 3364
diff changeset
    53
                teamConfigViewController = [[TeamConfigViewController alloc] initWithStyle:UITableViewStyleGrouped];
3513
f589230fa21b now it's possible to select the scheme file in the ifrontendfix a type about loading an image (iphone file system IS case senstive)
koda
parents: 3490
diff changeset
    54
                // this message is compulsory otherwise the table won't be loaded at all
3365
37ac593e9027 wow all these files only for land preview and seed generation
koda
parents: 3364
diff changeset
    55
            }
37ac593e9027 wow all these files only for land preview and seed generation
koda
parents: 3364
diff changeset
    56
            activeController = teamConfigViewController;
37ac593e9027 wow all these files only for land preview and seed generation
koda
parents: 3364
diff changeset
    57
            break;
37ac593e9027 wow all these files only for land preview and seed generation
koda
parents: 3364
diff changeset
    58
        case 2:
3513
f589230fa21b now it's possible to select the scheme file in the ifrontendfix a type about loading an image (iphone file system IS case senstive)
koda
parents: 3490
diff changeset
    59
            if (schemeWeaponConfigViewController == nil) {
f589230fa21b now it's possible to select the scheme file in the ifrontendfix a type about loading an image (iphone file system IS case senstive)
koda
parents: 3490
diff changeset
    60
                schemeWeaponConfigViewController = [[SchemeWeaponConfigViewController alloc] initWithStyle:UITableViewStyleGrouped];
f589230fa21b now it's possible to select the scheme file in the ifrontendfix a type about loading an image (iphone file system IS case senstive)
koda
parents: 3490
diff changeset
    61
            }
f589230fa21b now it's possible to select the scheme file in the ifrontendfix a type about loading an image (iphone file system IS case senstive)
koda
parents: 3490
diff changeset
    62
            activeController = schemeWeaponConfigViewController;
3365
37ac593e9027 wow all these files only for land preview and seed generation
koda
parents: 3364
diff changeset
    63
            break;
37ac593e9027 wow all these files only for land preview and seed generation
koda
parents: 3364
diff changeset
    64
    }
37ac593e9027 wow all these files only for land preview and seed generation
koda
parents: 3364
diff changeset
    65
    
3513
f589230fa21b now it's possible to select the scheme file in the ifrontendfix a type about loading an image (iphone file system IS case senstive)
koda
parents: 3490
diff changeset
    66
    // this message is compulsory otherwise the table won't be loaded at all
f589230fa21b now it's possible to select the scheme file in the ifrontendfix a type about loading an image (iphone file system IS case senstive)
koda
parents: 3490
diff changeset
    67
    [activeController viewWillAppear:NO];      
3365
37ac593e9027 wow all these files only for land preview and seed generation
koda
parents: 3364
diff changeset
    68
    [self.view addSubview:activeController.view];
37ac593e9027 wow all these files only for land preview and seed generation
koda
parents: 3364
diff changeset
    69
}
37ac593e9027 wow all these files only for land preview and seed generation
koda
parents: 3364
diff changeset
    70
3364
e5403e2bf02c no more hardcoded teams, team selection is real \o/
koda
parents: 3361
diff changeset
    71
-(void) startGame {
3490
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
    72
    // don't start playing if the preview is in progress
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
    73
    if ([mapConfigViewController busy]) {
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
    74
        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Wait for the Preview",@"")
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
    75
                                                        message:NSLocalizedString(@"Before playing the preview needs to be generated",@"")
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
    76
                                                       delegate:nil
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
    77
                                              cancelButtonTitle:NSLocalizedString(@"Ok, got it",@"")
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
    78
                                              otherButtonTitles:nil];
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
    79
        [alert show];
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
    80
        [alert release];
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
    81
        return;
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
    82
    }
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
    83
    
3365
37ac593e9027 wow all these files only for land preview and seed generation
koda
parents: 3364
diff changeset
    84
    // play only if there is more than one team
3364
e5403e2bf02c no more hardcoded teams, team selection is real \o/
koda
parents: 3361
diff changeset
    85
    if ([teamConfigViewController.listOfSelectedTeams count] < 2) {
e5403e2bf02c no more hardcoded teams, team selection is real \o/
koda
parents: 3361
diff changeset
    86
        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Too few teams playing",@"")
3365
37ac593e9027 wow all these files only for land preview and seed generation
koda
parents: 3364
diff changeset
    87
                                                        message:NSLocalizedString(@"You need to select at least two teams to play a game",@"")
3364
e5403e2bf02c no more hardcoded teams, team selection is real \o/
koda
parents: 3361
diff changeset
    88
                                                       delegate:nil
e5403e2bf02c no more hardcoded teams, team selection is real \o/
koda
parents: 3361
diff changeset
    89
                                              cancelButtonTitle:NSLocalizedString(@"Ok, got it",@"")
e5403e2bf02c no more hardcoded teams, team selection is real \o/
koda
parents: 3361
diff changeset
    90
                                              otherButtonTitles:nil];
e5403e2bf02c no more hardcoded teams, team selection is real \o/
koda
parents: 3361
diff changeset
    91
        [alert show];
e5403e2bf02c no more hardcoded teams, team selection is real \o/
koda
parents: 3361
diff changeset
    92
        [alert release];
3365
37ac593e9027 wow all these files only for land preview and seed generation
koda
parents: 3364
diff changeset
    93
        return;
3364
e5403e2bf02c no more hardcoded teams, team selection is real \o/
koda
parents: 3361
diff changeset
    94
    }
3365
37ac593e9027 wow all these files only for land preview and seed generation
koda
parents: 3364
diff changeset
    95
    
37ac593e9027 wow all these files only for land preview and seed generation
koda
parents: 3364
diff changeset
    96
    // play if there's room for enough hogs in the selected map
37ac593e9027 wow all these files only for land preview and seed generation
koda
parents: 3364
diff changeset
    97
    int hogs = 0;
37ac593e9027 wow all these files only for land preview and seed generation
koda
parents: 3364
diff changeset
    98
    for (NSDictionary *teamData in teamConfigViewController.listOfSelectedTeams)
37ac593e9027 wow all these files only for land preview and seed generation
koda
parents: 3364
diff changeset
    99
        hogs += [[teamData objectForKey:@"number"] intValue];
37ac593e9027 wow all these files only for land preview and seed generation
koda
parents: 3364
diff changeset
   100
37ac593e9027 wow all these files only for land preview and seed generation
koda
parents: 3364
diff changeset
   101
    if (hogs > mapConfigViewController.maxHogs) {
37ac593e9027 wow all these files only for land preview and seed generation
koda
parents: 3364
diff changeset
   102
        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Too many hogs",@"")
37ac593e9027 wow all these files only for land preview and seed generation
koda
parents: 3364
diff changeset
   103
                                                        message:NSLocalizedString(@"The map you selected is too small for that many hogs",@"")
37ac593e9027 wow all these files only for land preview and seed generation
koda
parents: 3364
diff changeset
   104
                                                       delegate:nil
37ac593e9027 wow all these files only for land preview and seed generation
koda
parents: 3364
diff changeset
   105
                                              cancelButtonTitle:NSLocalizedString(@"Ok, got it",@"")
37ac593e9027 wow all these files only for land preview and seed generation
koda
parents: 3364
diff changeset
   106
                                              otherButtonTitles:nil];
37ac593e9027 wow all these files only for land preview and seed generation
koda
parents: 3364
diff changeset
   107
        [alert show];
37ac593e9027 wow all these files only for land preview and seed generation
koda
parents: 3364
diff changeset
   108
        [alert release];
37ac593e9027 wow all these files only for land preview and seed generation
koda
parents: 3364
diff changeset
   109
        return;
3369
c7289e42f0ee add other controls for map preview, also fix a bug in digest
koda
parents: 3365
diff changeset
   110
    }
3490
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
   111
    
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
   112
    // create the configuration file that is going to be sent to engine
3365
37ac593e9027 wow all these files only for land preview and seed generation
koda
parents: 3364
diff changeset
   113
    NSDictionary *dict = [[NSDictionary alloc] initWithObjectsAndKeys:mapConfigViewController.seedCommand,@"seed_command",
3369
c7289e42f0ee add other controls for map preview, also fix a bug in digest
koda
parents: 3365
diff changeset
   114
                                                                      mapConfigViewController.templateFilterCommand,@"templatefilter_command",
c7289e42f0ee add other controls for map preview, also fix a bug in digest
koda
parents: 3365
diff changeset
   115
                                                                      mapConfigViewController.mapGenCommand,@"mapgen_command",
c7289e42f0ee add other controls for map preview, also fix a bug in digest
koda
parents: 3365
diff changeset
   116
                                                                      mapConfigViewController.mazeSizeCommand,@"mazesize_command",
3373
c1ff724a5c34 use a proper bundle identifier
koda
parents: 3369
diff changeset
   117
                                                                      mapConfigViewController.themeCommand,@"theme_command",
3513
f589230fa21b now it's possible to select the scheme file in the ifrontendfix a type about loading an image (iphone file system IS case senstive)
koda
parents: 3490
diff changeset
   118
                                                                      teamConfigViewController.listOfSelectedTeams,@"teams_list",
f589230fa21b now it's possible to select the scheme file in the ifrontendfix a type about loading an image (iphone file system IS case senstive)
koda
parents: 3490
diff changeset
   119
                                                                      schemeWeaponConfigViewController.selectedScheme,@"scheme",
f589230fa21b now it's possible to select the scheme file in the ifrontendfix a type about loading an image (iphone file system IS case senstive)
koda
parents: 3490
diff changeset
   120
                                                                      schemeWeaponConfigViewController.selectedWeapon,@"weapon",
f589230fa21b now it's possible to select the scheme file in the ifrontendfix a type about loading an image (iphone file system IS case senstive)
koda
parents: 3490
diff changeset
   121
                                                                      nil];
3365
37ac593e9027 wow all these files only for land preview and seed generation
koda
parents: 3364
diff changeset
   122
    [dict writeToFile:GAMECONFIG_FILE() atomically:YES];
37ac593e9027 wow all these files only for land preview and seed generation
koda
parents: 3364
diff changeset
   123
    [dict release];
3490
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
   124
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
   125
    // finally launch game and remove this controller
3365
37ac593e9027 wow all these files only for land preview and seed generation
koda
parents: 3364
diff changeset
   126
    [[self parentViewController] dismissModalViewControllerAnimated:YES];
37ac593e9027 wow all these files only for land preview and seed generation
koda
parents: 3364
diff changeset
   127
    [[SDLUIKitDelegate sharedAppDelegate] startSDLgame];
3356
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
   128
}
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
   129
3361
cfc6cd502f85 buttons for number of hogs in game config
koda
parents: 3356
diff changeset
   130
-(void) viewDidLoad {
3374
0d522416d97f lazy loading for all the tables with images (might affect performance but ui feels much more responsive)
koda
parents: 3373
diff changeset
   131
    if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
3513
f589230fa21b now it's possible to select the scheme file in the ifrontendfix a type about loading an image (iphone file system IS case senstive)
koda
parents: 3490
diff changeset
   132
        if (mapConfigViewController == nil)
f589230fa21b now it's possible to select the scheme file in the ifrontendfix a type about loading an image (iphone file system IS case senstive)
koda
parents: 3490
diff changeset
   133
            mapConfigViewController = [[MapConfigViewController alloc] initWithNibName:@"MapConfigViewController-iPad" bundle:nil];
f589230fa21b now it's possible to select the scheme file in the ifrontendfix a type about loading an image (iphone file system IS case senstive)
koda
parents: 3490
diff changeset
   134
        if (teamConfigViewController == nil)
f589230fa21b now it's possible to select the scheme file in the ifrontendfix a type about loading an image (iphone file system IS case senstive)
koda
parents: 3490
diff changeset
   135
            teamConfigViewController = [[TeamConfigViewController alloc] initWithStyle:UITableViewStylePlain];
3374
0d522416d97f lazy loading for all the tables with images (might affect performance but ui feels much more responsive)
koda
parents: 3373
diff changeset
   136
        teamConfigViewController.view.frame = CGRectMake(0, 224, 300, 500);
0d522416d97f lazy loading for all the tables with images (might affect performance but ui feels much more responsive)
koda
parents: 3373
diff changeset
   137
        teamConfigViewController.view.backgroundColor = [UIColor clearColor];
0d522416d97f lazy loading for all the tables with images (might affect performance but ui feels much more responsive)
koda
parents: 3373
diff changeset
   138
        [mapConfigViewController.view addSubview:teamConfigViewController.view];
3513
f589230fa21b now it's possible to select the scheme file in the ifrontendfix a type about loading an image (iphone file system IS case senstive)
koda
parents: 3490
diff changeset
   139
        if (schemeWeaponConfigViewController == nil)
f589230fa21b now it's possible to select the scheme file in the ifrontendfix a type about loading an image (iphone file system IS case senstive)
koda
parents: 3490
diff changeset
   140
            schemeWeaponConfigViewController = [[SchemeWeaponConfigViewController alloc] initWithStyle:UITableViewStyleGrouped];
f589230fa21b now it's possible to select the scheme file in the ifrontendfix a type about loading an image (iphone file system IS case senstive)
koda
parents: 3490
diff changeset
   141
        schemeWeaponConfigViewController.view.frame = CGRectMake(362, 224, 300, 500);
f589230fa21b now it's possible to select the scheme file in the ifrontendfix a type about loading an image (iphone file system IS case senstive)
koda
parents: 3490
diff changeset
   142
        schemeWeaponConfigViewController.view.backgroundColor = [UIColor clearColor];
f589230fa21b now it's possible to select the scheme file in the ifrontendfix a type about loading an image (iphone file system IS case senstive)
koda
parents: 3490
diff changeset
   143
        [mapConfigViewController.view addSubview:schemeWeaponConfigViewController.view];
3374
0d522416d97f lazy loading for all the tables with images (might affect performance but ui feels much more responsive)
koda
parents: 3373
diff changeset
   144
    } else
0d522416d97f lazy loading for all the tables with images (might affect performance but ui feels much more responsive)
koda
parents: 3373
diff changeset
   145
        mapConfigViewController = [[MapConfigViewController alloc] initWithNibName:@"MapConfigViewController-iPhone" bundle:nil];
3365
37ac593e9027 wow all these files only for land preview and seed generation
koda
parents: 3364
diff changeset
   146
    activeController = mapConfigViewController;
3361
cfc6cd502f85 buttons for number of hogs in game config
koda
parents: 3356
diff changeset
   147
    
3369
c7289e42f0ee add other controls for map preview, also fix a bug in digest
koda
parents: 3365
diff changeset
   148
    [self.view addSubview:mapConfigViewController.view];
3361
cfc6cd502f85 buttons for number of hogs in game config
koda
parents: 3356
diff changeset
   149
    
3356
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
   150
    [super viewDidLoad];
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
   151
}
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
   152
3365
37ac593e9027 wow all these files only for land preview and seed generation
koda
parents: 3364
diff changeset
   153
-(void) viewWillAppear:(BOOL)animated {
37ac593e9027 wow all these files only for land preview and seed generation
koda
parents: 3364
diff changeset
   154
    [mapConfigViewController viewWillAppear:animated];
37ac593e9027 wow all these files only for land preview and seed generation
koda
parents: 3364
diff changeset
   155
    [teamConfigViewController viewWillAppear:animated];
3513
f589230fa21b now it's possible to select the scheme file in the ifrontendfix a type about loading an image (iphone file system IS case senstive)
koda
parents: 3490
diff changeset
   156
    [schemeWeaponConfigViewController viewWillAppear:animated];
3365
37ac593e9027 wow all these files only for land preview and seed generation
koda
parents: 3364
diff changeset
   157
    // ADD other controllers here
37ac593e9027 wow all these files only for land preview and seed generation
koda
parents: 3364
diff changeset
   158
     
37ac593e9027 wow all these files only for land preview and seed generation
koda
parents: 3364
diff changeset
   159
    [super viewWillAppear:animated];
37ac593e9027 wow all these files only for land preview and seed generation
koda
parents: 3364
diff changeset
   160
}
37ac593e9027 wow all these files only for land preview and seed generation
koda
parents: 3364
diff changeset
   161
3373
c1ff724a5c34 use a proper bundle identifier
koda
parents: 3369
diff changeset
   162
-(void) viewDidAppear:(BOOL)animated {
c1ff724a5c34 use a proper bundle identifier
koda
parents: 3369
diff changeset
   163
    [mapConfigViewController viewDidAppear:animated];
c1ff724a5c34 use a proper bundle identifier
koda
parents: 3369
diff changeset
   164
    [teamConfigViewController viewDidAppear:animated];
3513
f589230fa21b now it's possible to select the scheme file in the ifrontendfix a type about loading an image (iphone file system IS case senstive)
koda
parents: 3490
diff changeset
   165
    [schemeWeaponConfigViewController viewDidAppear:animated];
3373
c1ff724a5c34 use a proper bundle identifier
koda
parents: 3369
diff changeset
   166
    [super viewDidAppear:animated];
c1ff724a5c34 use a proper bundle identifier
koda
parents: 3369
diff changeset
   167
}
c1ff724a5c34 use a proper bundle identifier
koda
parents: 3369
diff changeset
   168
3356
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
   169
-(void) didReceiveMemoryWarning {
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
   170
    // Releases the view if it doesn't have a superview.
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
   171
    [super didReceiveMemoryWarning];
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
   172
    // Release any cached data, images, etc that aren't in use.
3490
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
   173
    if (mapConfigViewController.view.superview == nil) 
3487
b1d00f1950c8 add some memory aware code
koda
parents: 3374
diff changeset
   174
        mapConfigViewController = nil;
b1d00f1950c8 add some memory aware code
koda
parents: 3374
diff changeset
   175
    if (teamConfigViewController.view.superview == nil)
b1d00f1950c8 add some memory aware code
koda
parents: 3374
diff changeset
   176
        teamConfigViewController = nil;
3513
f589230fa21b now it's possible to select the scheme file in the ifrontendfix a type about loading an image (iphone file system IS case senstive)
koda
parents: 3490
diff changeset
   177
    if (schemeWeaponConfigViewController.view.superview == nil)
f589230fa21b now it's possible to select the scheme file in the ifrontendfix a type about loading an image (iphone file system IS case senstive)
koda
parents: 3490
diff changeset
   178
        schemeWeaponConfigViewController = nil;
3487
b1d00f1950c8 add some memory aware code
koda
parents: 3374
diff changeset
   179
    activeController = nil;
b1d00f1950c8 add some memory aware code
koda
parents: 3374
diff changeset
   180
    MSG_MEMCLEAN();
3356
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
   181
}
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
   182
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
   183
-(void) viewDidUnload {
3361
cfc6cd502f85 buttons for number of hogs in game config
koda
parents: 3356
diff changeset
   184
    activeController = nil;
3365
37ac593e9027 wow all these files only for land preview and seed generation
koda
parents: 3364
diff changeset
   185
    mapConfigViewController = nil;
3361
cfc6cd502f85 buttons for number of hogs in game config
koda
parents: 3356
diff changeset
   186
    teamConfigViewController = nil;
3513
f589230fa21b now it's possible to select the scheme file in the ifrontendfix a type about loading an image (iphone file system IS case senstive)
koda
parents: 3490
diff changeset
   187
    schemeWeaponConfigViewController = nil;
3356
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
   188
    [super viewDidUnload];
3490
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
   189
    MSG_DIDUNLOAD();
3356
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
   190
}
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
   191
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
   192
-(void) dealloc {
3361
cfc6cd502f85 buttons for number of hogs in game config
koda
parents: 3356
diff changeset
   193
    [activeController release];
3365
37ac593e9027 wow all these files only for land preview and seed generation
koda
parents: 3364
diff changeset
   194
    [mapConfigViewController release];
3361
cfc6cd502f85 buttons for number of hogs in game config
koda
parents: 3356
diff changeset
   195
    [teamConfigViewController release];
3513
f589230fa21b now it's possible to select the scheme file in the ifrontendfix a type about loading an image (iphone file system IS case senstive)
koda
parents: 3490
diff changeset
   196
    [schemeWeaponConfigViewController release];
3356
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
   197
    [super dealloc];
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
   198
}
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
   199
3ae3fccb439e add missing controller stubs
koda
parents:
diff changeset
   200
@end