project_files/HedgewarsMobile/Classes/HogHatViewController.m
changeset 3948 24daa33a3114
parent 3829 81db3c85784b
child 3971 5c82ee165ed5
equal deleted inserted replaced
3947:709fdb89f76c 3948:24daa33a3114
    28 
    28 
    29 
    29 
    30 -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation {
    30 -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation {
    31     return rotationManager(interfaceOrientation);
    31     return rotationManager(interfaceOrientation);
    32 }
    32 }
    33 
       
    34 
    33 
    35 #pragma mark -
    34 #pragma mark -
    36 #pragma mark View lifecycle
    35 #pragma mark View lifecycle
    37 - (void)viewDidLoad {
    36 - (void)viewDidLoad {
    38     [super viewDidLoad];
    37     [super viewDidLoad];
    86     cell.textLabel.text = [hat stringByDeletingPathExtension];
    85     cell.textLabel.text = [hat stringByDeletingPathExtension];
    87 
    86 
    88     NSString *hatFile = [[NSString alloc] initWithFormat:@"%@/%@", HATS_DIRECTORY(), hat];
    87     NSString *hatFile = [[NSString alloc] initWithFormat:@"%@/%@", HATS_DIRECTORY(), hat];
    89     UIImage *hatSprite = [[UIImage alloc] initWithContentsOfFile: hatFile andCutAt:CGRectMake(0, 0, 32, 32)];
    88     UIImage *hatSprite = [[UIImage alloc] initWithContentsOfFile: hatFile andCutAt:CGRectMake(0, 0, 32, 32)];
    90     [hatFile release];
    89     [hatFile release];
    91     cell.imageView.image = [self.normalHogSprite mergeWith:hatSprite atPoint:CGPointMake(0, -5)];
    90     cell.imageView.image = [self.normalHogSprite mergeWith:hatSprite atPoint:CGPointMake(0, 5)];
    92     [hatSprite release];
    91     [hatSprite release];
    93 
    92 
    94     if ([hat isEqualToString:[hog objectForKey:@"hat"]]) {
    93     if ([hat isEqualToString:[hog objectForKey:@"hat"]]) {
    95         cell.accessoryType = UITableViewCellAccessoryCheckmark;
    94         cell.accessoryType = UITableViewCellAccessoryCheckmark;
    96         self.lastIndexPath = indexPath;
    95         self.lastIndexPath = indexPath;