cocoaTouch/LevelViewController.m
changeset 3352 ac5d14a35482
parent 3340 96dd168b080b
child 3374 0d522416d97f
equal deleted inserted replaced
3351:3fd3f116f2fc 3352:ac5d14a35482
     1 //
     1 //
     2 //  HogHatViewController.m
     2 //  LevelViewController.m
     3 //  HedgewarsMobile
     3 //  HedgewarsMobile
     4 //
     4 //
     5 //  Created by Vittorio on 02/04/10.
     5 //  Created by Vittorio on 02/04/10.
     6 //  Copyright 2010 __MyCompanyName__. All rights reserved.
     6 //  Copyright 2010 __MyCompanyName__. All rights reserved.
     7 //
     7 //
    24 - (void)viewDidLoad {
    24 - (void)viewDidLoad {
    25     [super viewDidLoad];
    25     [super viewDidLoad];
    26 
    26 
    27     NSArray *array = [[NSArray alloc] initWithObjects:
    27     NSArray *array = [[NSArray alloc] initWithObjects:
    28                       NSLocalizedString(@"Human",@""),
    28                       NSLocalizedString(@"Human",@""),
       
    29                       NSLocalizedString(@"Brutal",@""),
       
    30                       NSLocalizedString(@"Aggressive",@""),
       
    31                       NSLocalizedString(@"Bully",@""),
       
    32                       NSLocalizedString(@"Average",@""),
    29                       NSLocalizedString(@"Weaky",@""),
    33                       NSLocalizedString(@"Weaky",@""),
    30                       NSLocalizedString(@"Average",@""),
    34                       nil];
    31                       NSLocalizedString(@"Bully",@""),
       
    32                       NSLocalizedString(@"Aggressive",@""),nil];
       
    33     self.levelArray = array;
    35     self.levelArray = array;
    34     [array release];
    36     [array release];
    35 /*
    37 
    36     NSMutableArray *sprites = [[NSMutableArray alloc] initWithCapacity:[graveArray count];
    38     NSMutableArray *sprites = [[NSMutableArray alloc] initWithCapacity:[levelArray count]];
    37     for (NSString *graveName in graveArray) {
    39     for (int i = 0; i < [levelArray count]; i++) {
    38 	NSString *gravePath = [[NSString alloc] initWithFormat@"%@/%@",GRAVES_DIRECTORY(),graveName];
    40         NSString *botlevelPath = [[NSString alloc] initWithFormat:@"%@/%d.png",BOTLEVELS_DIRECTORY(),i];
    39 	UIImage *image = [[UIImage alloc] initWithContentsOfFile:gravePath];
    41         UIImage *image = [[UIImage alloc] initWithContentsOfFile:botlevelPath];
    40 	[gravePath release];
    42         [botlevelPath release];
    41 	[sprites addObject:image];
    43         [sprites addObject:image];
    42 	[image release];
    44         [image release];
    43     }
    45     }
    44     self.graveSprites = sprites;
    46     self.levelSprites = sprites;
    45     [sprites release];
    47     [sprites release];
    46 */
    48 
    47 }
    49 }
    48 
    50 
    49 - (void)viewWillAppear:(BOOL)animated {
    51 - (void)viewWillAppear:(BOOL)animated {
    50     [super viewWillAppear:animated];
    52     [super viewWillAppear:animated];
    51     
    53