project_files/HedgewarsMobile/Classes/SchemeWeaponConfigViewController.m
changeset 3983 aa24192417a8
parent 3971 5c82ee165ed5
child 4082 bfe14b38dad1
equal deleted inserted replaced
3982:86c3a6e8e265 3983:aa24192417a8
    18  * File created on 13/06/2010.
    18  * File created on 13/06/2010.
    19  */
    19  */
    20 
    20 
    21 
    21 
    22 #import "SchemeWeaponConfigViewController.h"
    22 #import "SchemeWeaponConfigViewController.h"
    23 #import <QuartzCore/QuartzCore.h>
       
    24 #import "CommodityFunctions.h"
    23 #import "CommodityFunctions.h"
    25 #import "SDL_uikitappdelegate.h"
    24 #import "SDL_uikitappdelegate.h"
    26 
    25 
    27 @implementation SchemeWeaponConfigViewController
    26 @implementation SchemeWeaponConfigViewController
    28 @synthesize listOfSchemes, listOfWeapons, lastIndexPath_sc, lastIndexPath_we, selectedScheme, selectedWeapon;
    27 @synthesize listOfSchemes, listOfWeapons, lastIndexPath_sc, lastIndexPath_we, selectedScheme, selectedWeapon;
   125 -(CGFloat) tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
   124 -(CGFloat) tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
   126     return 40.0;
   125     return 40.0;
   127 }
   126 }
   128 
   127 
   129 -(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
   128 -(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
   130     UILabel *theLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width * 80/100, 30)];
   129     CGRect frame = CGRectMake(0, 0, self.view.frame.size.width * 80/100, 30);
   131     theLabel.backgroundColor = [UIColor blueColor];
   130     NSString *text;
   132     if (section == 0) 
   131     if (section == 0) 
   133         theLabel.text = NSLocalizedString(@"Schemes",@"");
   132         text = NSLocalizedString(@"Schemes",@"");
   134     else
   133     else
   135         theLabel.text = NSLocalizedString(@"Weapons",@"");
   134         text = NSLocalizedString(@"Weapons",@"");
       
   135     UILabel *theLabel = createBlueLabel(text, frame);
   136     theLabel.center = CGPointMake(self.view.frame.size.width/2, 20);
   136     theLabel.center = CGPointMake(self.view.frame.size.width/2, 20);
   137     theLabel.textColor = UICOLOR_HW_YELLOW_TEXT;
       
   138     theLabel.textAlignment = UITextAlignmentCenter;
       
   139     theLabel.font = [UIFont boldSystemFontOfSize:[UIFont labelFontSize]*80/100];
       
   140     theLabel.backgroundColor = UICOLOR_HW_DARKBLUE;
       
   141     
       
   142     [theLabel.layer setBorderWidth:1.5f];
       
   143     [theLabel.layer setBorderColor:[UICOLOR_HW_YELLOW_BODER CGColor]];
       
   144     [theLabel.layer setCornerRadius:8.0f];
       
   145     [theLabel.layer setMasksToBounds:YES];
       
   146 
   137 
   147     UIView *theView = [[[UIView alloc] init] autorelease];
   138     UIView *theView = [[[UIView alloc] init] autorelease];
   148     [theView addSubview:theLabel];
   139     [theView addSubview:theLabel];
   149     [theLabel release];
   140     [theLabel release];
   150     return theView;
   141     return theView;
   151 }
   142 }
   152 
       
   153 /*
       
   154 -(NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger) section {
       
   155     if (section == 0) {
       
   156         return NSLocalizedString(@"Schemes",@"");
       
   157     } else {
       
   158         return NSLocalizedString(@"Weapons",@"");;
       
   159     }
       
   160 }
       
   161 */
       
   162 
   143 
   163 #pragma mark -
   144 #pragma mark -
   164 #pragma mark Table view delegate
   145 #pragma mark Table view delegate
   165 -(void) tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
   146 -(void) tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
   166     NSIndexPath *lastIndexPath;
   147     NSIndexPath *lastIndexPath;