project_files/HedgewarsMobile/Classes/SchemeWeaponConfigViewController.m
changeset 3781 2bfda544ae48
parent 3780 7c704e69242e
child 3782 dc3531e49e4c
equal deleted inserted replaced
3780:7c704e69242e 3781:2bfda544ae48
    72 -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    72 -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    73     static NSString *CellIdentifier = @"Cell";
    73     static NSString *CellIdentifier = @"Cell";
    74     NSInteger row = [indexPath row];
    74     NSInteger row = [indexPath row];
    75 
    75 
    76     UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    76     UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    77     if (cell == nil) {
    77     if (cell == nil)
    78         cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
    78         cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease];
    79     }
       
    80 
    79 
    81     cell.accessoryView = nil;
    80     cell.accessoryView = nil;
    82     if ([indexPath section] == 0) {
    81     if ([indexPath section] == 0) {
    83         cell.textLabel.text = [[self.listOfSchemes objectAtIndex:row] stringByDeletingPathExtension];
    82         cell.textLabel.text = [[self.listOfSchemes objectAtIndex:row] stringByDeletingPathExtension];
       
    83         cell.detailTextLabel.text = [[self.listOfSchemes objectAtIndex:row] stringByDeletingPathExtension];
    84         if ([[self.listOfSchemes objectAtIndex:row] isEqualToString:self.selectedScheme]) {
    84         if ([[self.listOfSchemes objectAtIndex:row] isEqualToString:self.selectedScheme]) {
    85             UIImageView *checkbox = [[UIImageView alloc] initWithImage:[UIImage imageWithContentsOfFile:@"checkbox.png"]];
    85             UIImageView *checkbox = [[UIImageView alloc] initWithImage:[UIImage imageWithContentsOfFile:@"checkbox.png"]];
    86             cell.accessoryView = checkbox;
    86             cell.accessoryView = checkbox;
    87             [checkbox release];
    87             [checkbox release];
    88             self.lastIndexPath_sc = indexPath;
    88             self.lastIndexPath_sc = indexPath;
    89         }
    89         }
    90     } else {
    90     } else {
    91         cell.textLabel.text = [[self.listOfWeapons objectAtIndex:row] stringByDeletingPathExtension];
    91         cell.textLabel.text = [[self.listOfWeapons objectAtIndex:row] stringByDeletingPathExtension];
       
    92         cell.detailTextLabel.text = [[self.listOfWeapons objectAtIndex:row] stringByDeletingPathExtension];
    92         if ([[self.listOfWeapons objectAtIndex:row] isEqualToString:self.selectedWeapon]) {
    93         if ([[self.listOfWeapons objectAtIndex:row] isEqualToString:self.selectedWeapon]) {
    93             UIImageView *checkbox = [[UIImageView alloc] initWithImage:[UIImage imageWithContentsOfFile:@"checkbox.png"]];
    94             UIImageView *checkbox = [[UIImageView alloc] initWithImage:[UIImage imageWithContentsOfFile:@"checkbox.png"]];
    94             cell.accessoryView = checkbox;
    95             cell.accessoryView = checkbox;
    95             [checkbox release];
    96             [checkbox release];
    96             self.lastIndexPath_we = indexPath;
    97             self.lastIndexPath_we = indexPath;
    97         }
    98         }
    98     }
    99     }
    99     
   100     
   100     cell.backgroundColor = [UIColor blackColor];
   101     cell.backgroundColor = [UIColor blackColor];
   101     cell.textLabel.textColor = UICOLOR_HW_YELLOW_TEXT;
   102     cell.textLabel.textColor = UICOLOR_HW_YELLOW_TEXT;
       
   103     cell.detailTextLabel.textColor = [UIColor whiteColor];
   102     return cell;
   104     return cell;
   103 }
   105 }
   104 
   106 
   105 -(CGFloat) tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
   107 -(CGFloat) tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
   106     return 40.0;
   108     return 40.0;