project_files/HedgewarsMobile/Classes/SupportViewController.m
changeset 5700 f0960a88ab0e
parent 5208 878e551f0b4a
child 5976 306cedbeb213
equal deleted inserted replaced
5699:1a9a6a7662aa 5700:f0960a88ab0e
    35     [super viewDidLoad];
    35     [super viewDidLoad];
    36 
    36 
    37     NSArray *array = [[NSArray alloc] initWithObjects:
    37     NSArray *array = [[NSArray alloc] initWithObjects:
    38                       NSLocalizedString(@"Leave a positive review on iTunes!",@""),
    38                       NSLocalizedString(@"Leave a positive review on iTunes!",@""),
    39                       NSLocalizedString(@"Join us on Facebook",@""),
    39                       NSLocalizedString(@"Join us on Facebook",@""),
    40                       NSLocalizedString(@"Follow on Twitter",@""),
    40                       NSLocalizedString(@"Follow us on Twitter",@""),
    41                       NSLocalizedString(@"Visit website",@""),
    41                       NSLocalizedString(@"Visit our website",@""),
    42                       NSLocalizedString(@"Chat with us in IRC",@""),
    42                       NSLocalizedString(@"Chat with the devs in IRC",@""),
    43                       nil];
    43                       nil];
    44     self.waysToSupport = array;
    44     self.waysToSupport = array;
    45     [array release];
    45     [array release];
    46 
    46 
    47     self.tableView.rowHeight = 50;
    47     self.tableView.rowHeight = 50;
    69     if (cell == nil)
    69     if (cell == nil)
    70         cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
    70         cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
    71 
    71 
    72     NSString *rowString = [self.waysToSupport objectAtIndex:(row + section)];
    72     NSString *rowString = [self.waysToSupport objectAtIndex:(row + section)];
    73     cell.textLabel.text = rowString;
    73     cell.textLabel.text = rowString;
       
    74     NSString *imgString = nil;
    74 
    75 
    75     if (section == 0) {
    76     if (section == 0) {
       
    77         imgString = [BTN_DIRECTORY() stringByAppendingString:@"/StatsStar.png"];
    76         cell.textLabel.textAlignment = UITextAlignmentCenter;
    78         cell.textLabel.textAlignment = UITextAlignmentCenter;
    77         cell.imageView.image = nil;
    79         cell.imageView.image = nil;
    78     } else {
    80     } else {
    79         cell.textLabel.textAlignment = UITextAlignmentLeft;
    81         cell.textLabel.textAlignment = UITextAlignmentLeft;
    80         NSString *imgString = nil;
       
    81         switch (row) {
    82         switch (row) {
    82             case 0:
    83             case 0:
    83                 imgString = @"fb.png";
    84                 imgString = @"fb.png";
    84                 break;
    85                 break;
    85             case 1:
    86             case 1:
    93                 break;
    94                 break;
    94             default:
    95             default:
    95                 DLog(@"No way");
    96                 DLog(@"No way");
    96                 break;
    97                 break;
    97         }
    98         }
    98         
       
    99         UIImage *img = [[UIImage alloc] initWithContentsOfFile:imgString];
       
   100         cell.imageView.image = img;
       
   101         [img release];
       
   102     }
    99     }
       
   100     UIImage *img = [[UIImage alloc] initWithContentsOfFile:imgString];
       
   101     cell.imageView.image = img;
       
   102     if (section == 0) {
       
   103         UIImageView *imgView = [[UIImageView alloc] initWithImage:img];
       
   104         cell.accessoryView = imgView;
       
   105         [imgView release];
       
   106     }
       
   107     [img release];
   103     
   108     
   104     return cell;
   109     return cell;
   105 }
   110 }
   106 
   111 
   107 #pragma mark -
   112 #pragma mark -