21 |
21 |
22 #import "SchemeWeaponConfigViewController.h" |
22 #import "SchemeWeaponConfigViewController.h" |
23 #import "CommodityFunctions.h" |
23 #import "CommodityFunctions.h" |
24 #import "SDL_uikitappdelegate.h" |
24 #import "SDL_uikitappdelegate.h" |
25 |
25 |
|
26 #define LABEL_TAG 57423 |
|
27 |
26 @implementation SchemeWeaponConfigViewController |
28 @implementation SchemeWeaponConfigViewController |
27 @synthesize listOfSchemes, listOfWeapons, lastIndexPath_sc, lastIndexPath_we, selectedScheme, selectedWeapon, syncSwitch; |
29 @synthesize listOfSchemes, listOfWeapons, lastIndexPath_sc, lastIndexPath_we, selectedScheme, selectedWeapon, syncSwitch; |
28 |
30 |
29 -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { |
31 -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { |
30 return rotationManager(interfaceOrientation); |
32 return rotationManager(interfaceOrientation); |
213 [aTableView selectRowAtIndexPath:indexPath animated:YES scrollPosition:UITableViewScrollPositionNone]; |
218 [aTableView selectRowAtIndexPath:indexPath animated:YES scrollPosition:UITableViewScrollPositionNone]; |
214 } |
219 } |
215 [aTableView deselectRowAtIndexPath:indexPath animated:YES]; |
220 [aTableView deselectRowAtIndexPath:indexPath animated:YES]; |
216 } |
221 } |
217 |
222 |
|
223 -(void) fillSections { |
|
224 if (hideSections == YES) { |
|
225 hideSections = NO; |
|
226 NSRange range; |
|
227 range.location = 0; |
|
228 range.length = 3; |
|
229 NSIndexSet *sections = [NSIndexSet indexSetWithIndexesInRange:range]; |
|
230 [self.tableView insertSections:sections withRowAnimation:UITableViewRowAnimationFade]; |
|
231 self.selectedScheme = @"Default.plist"; |
|
232 self.selectedWeapon = @"Default.plist"; |
|
233 |
|
234 self.tableView.scrollEnabled = YES; |
|
235 |
|
236 [[self.view viewWithTag:LABEL_TAG] removeFromSuperview]; |
|
237 } |
|
238 } |
|
239 |
|
240 -(void) emptySections { |
|
241 hideSections = YES; |
|
242 NSRange range; |
|
243 range.location = 0; |
|
244 range.length = 3; |
|
245 NSIndexSet *sections = [NSIndexSet indexSetWithIndexesInRange:range]; |
|
246 [self.tableView deleteSections:sections withRowAnimation:UITableViewRowAnimationFade]; |
|
247 self.selectedScheme = @"Default.plist"; |
|
248 self.selectedWeapon = @"Default.plist"; |
|
249 |
|
250 self.tableView.scrollEnabled = NO; |
|
251 |
|
252 CGRect frame = CGRectMake(0, 0, self.view.frame.size.width * 80/100, 60); |
|
253 UILabel *theLabel = createBlueLabel(NSLocalizedString(@"Missions don't need further configuration",@""), frame); |
|
254 theLabel.center = CGPointMake(self.view.frame.size.width/2, self.view.frame.size.height/2); |
|
255 theLabel.numberOfLines = 2; |
|
256 theLabel.tag = LABEL_TAG; |
|
257 |
|
258 [self.view addSubview:theLabel]; |
|
259 [theLabel release]; |
|
260 } |
|
261 |
218 #pragma mark - |
262 #pragma mark - |
219 #pragma mark Memory management |
263 #pragma mark Memory management |
220 -(void) didReceiveMemoryWarning { |
264 -(void) didReceiveMemoryWarning { |
221 if ([[SDLUIKitDelegate sharedAppDelegate] isInGame]) { |
265 if ([[SDLUIKitDelegate sharedAppDelegate] isInGame]) { |
222 self.lastIndexPath_sc = nil; |
266 self.lastIndexPath_sc = nil; |