5 // Created by Vittorio on 13/06/10. |
5 // Created by Vittorio on 13/06/10. |
6 // Copyright 2010 __MyCompanyName__. All rights reserved. |
6 // Copyright 2010 __MyCompanyName__. All rights reserved. |
7 // |
7 // |
8 |
8 |
9 #import "SchemeWeaponConfigViewController.h" |
9 #import "SchemeWeaponConfigViewController.h" |
|
10 #import <QuartzCore/QuartzCore.h> |
10 #import "CommodityFunctions.h" |
11 #import "CommodityFunctions.h" |
11 |
12 |
12 @implementation SchemeWeaponConfigViewController |
13 @implementation SchemeWeaponConfigViewController |
13 @synthesize listOfSchemes, listOfWeapons, lastIndexPath_sc, lastIndexPath_we, selectedScheme, selectedWeapon; |
14 @synthesize listOfSchemes, listOfWeapons, lastIndexPath_sc, lastIndexPath_we, selectedScheme, selectedWeapon; |
14 |
15 |
104 -(CGFloat) tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section { |
105 -(CGFloat) tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section { |
105 return 40.0; |
106 return 40.0; |
106 } |
107 } |
107 |
108 |
108 -(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { |
109 -(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { |
109 NSString *fileToLoad; |
110 UILabel *theLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width * 80/100, 30)]; |
|
111 theLabel.backgroundColor = [UIColor blueColor]; |
110 if (section == 0) |
112 if (section == 0) |
111 fileToLoad = @"SchemesLabel.png"; |
113 theLabel.text = NSLocalizedString(@"Schemes",@""); |
112 else |
114 else |
113 fileToLoad = @"WeaponsLabel.png"; |
115 theLabel.text = NSLocalizedString(@"Weapons",@""); |
|
116 theLabel.center = CGPointMake(self.view.frame.size.width/2, 20); |
|
117 theLabel.textColor = UICOLOR_HW_YELLOW_TEXT; |
|
118 theLabel.textAlignment = UITextAlignmentCenter; |
|
119 theLabel.font = [UIFont boldSystemFontOfSize:[UIFont labelFontSize]*80/100]; |
|
120 theLabel.backgroundColor = UICOLOR_HW_DARKBLUE; |
114 |
121 |
115 UIImage *img = [[UIImage alloc] initWithContentsOfFile:fileToLoad]; |
122 [theLabel.layer setBorderWidth:1.5f]; |
116 UIImageView *imgView = [[[UIImageView alloc] initWithImage:img] autorelease]; |
123 [theLabel.layer setBorderColor:[UICOLOR_HW_YELLOW_BODER CGColor]]; |
117 [img release]; |
124 [theLabel.layer setCornerRadius:8.0f]; |
118 |
125 [theLabel.layer setMasksToBounds:YES]; |
119 return imgView; |
126 |
|
127 UIView *theView = [[[UIView alloc] init] autorelease]; |
|
128 [theView addSubview:theLabel]; |
|
129 [theLabel release]; |
|
130 return theView; |
120 } |
131 } |
121 |
132 |
122 /* |
133 /* |
123 -(NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger) section { |
134 -(NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger) section { |
124 if (section == 0) { |
135 if (section == 0) { |