5 // Created by Vittorio on 27/03/10. |
5 // Created by Vittorio on 27/03/10. |
6 // Copyright 2010 __MyCompanyName__. All rights reserved. |
6 // Copyright 2010 __MyCompanyName__. All rights reserved. |
7 // |
7 // |
8 |
8 |
9 #import "MasterViewController.h" |
9 #import "MasterViewController.h" |
10 #import "DetailViewController.h" |
|
11 #import "GeneralSettingsViewController.h" |
10 #import "GeneralSettingsViewController.h" |
12 #import "TeamSettingsViewController.h" |
11 #import "TeamSettingsViewController.h" |
13 #import "WeaponSettingsViewController.h" |
12 #import "WeaponSettingsViewController.h" |
14 #import "SchemeSettingsViewController.h" |
13 #import "SchemeSettingsViewController.h" |
15 #import "CommodityFunctions.h" |
14 #import "CommodityFunctions.h" |
64 // Customize the appearance of table view cells. |
63 // Customize the appearance of table view cells. |
65 -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { |
64 -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { |
66 static NSString *CellIdentifier = @"Cell"; |
65 static NSString *CellIdentifier = @"Cell"; |
67 |
66 |
68 UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; |
67 UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; |
69 if (cell == nil) { |
68 if (cell == nil) |
70 cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; |
69 cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; |
|
70 |
|
71 NSString *iconStr = nil; |
|
72 switch ([indexPath row]) { |
|
73 case 0: |
|
74 iconStr = [NSString stringWithFormat:@"%@/TargetBee.png",GRAPHICS_DIRECTORY()]; |
|
75 break; |
|
76 case 1: |
|
77 iconStr = [NSString stringWithFormat:@"%@/Egg.png",GRAPHICS_DIRECTORY()]; |
|
78 break; |
|
79 case 2: |
|
80 iconStr = [NSString stringWithFormat:@"%@/Molotov.png",GRAPHICS_DIRECTORY()]; |
|
81 break; |
|
82 case 3: |
|
83 iconStr = [NSString stringWithFormat:@"%@/Target.png",GRAPHICS_DIRECTORY()]; |
|
84 break; |
|
85 default: |
|
86 //seduction.png for support page |
|
87 DLog(@"Nope"); |
|
88 break; |
71 } |
89 } |
|
90 |
|
91 if (nil == targetController) |
|
92 cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; |
|
93 else |
|
94 cell.accessoryType = UITableViewCellAccessoryNone; |
72 |
95 |
73 cell.textLabel.text = [controllerNames objectAtIndex:[indexPath row]]; |
96 cell.textLabel.text = [controllerNames objectAtIndex:[indexPath row]]; |
74 if (nil == targetController) { |
97 UIImage *icon = [[UIImage alloc] initWithContentsOfFile:iconStr]; |
75 UIImage *icon = [[UIImage alloc] initWithContentsOfFile:@"Icon-Small.png"]; |
98 cell.imageView.image = icon; |
76 cell.imageView.image = icon; |
99 [icon release]; |
77 [icon release]; |
|
78 cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; |
|
79 } else |
|
80 cell.accessoryType = UITableViewCellAccessoryNone; |
|
81 |
100 |
82 return cell; |
101 return cell; |
83 } |
102 } |
84 |
103 |
85 #pragma mark - |
104 #pragma mark - |
122 |
141 |
123 if (nil == targetController) { |
142 if (nil == targetController) { |
124 nextController.navigationItem.hidesBackButton = NO; |
143 nextController.navigationItem.hidesBackButton = NO; |
125 [self.navigationController pushViewController:nextController animated:YES]; |
144 [self.navigationController pushViewController:nextController animated:YES]; |
126 } else { |
145 } else { |
|
146 playSound(@"clickSound"); |
127 nextController.navigationItem.hidesBackButton = YES; |
147 nextController.navigationItem.hidesBackButton = YES; |
128 [targetController.navigationController pushViewController:nextController animated:NO]; |
148 [targetController.navigationController pushViewController:nextController animated:NO]; |
129 } |
149 } |
130 } |
150 } |
131 } |
151 } |