75 if (button.tag == 0) { |
75 if (button.tag == 0) { |
76 [[AudioManagerController mainManager] playBackSound]; |
76 [[AudioManagerController mainManager] playBackSound]; |
77 [self.presentingViewController dismissViewControllerAnimated:YES completion:nil]; |
77 [self.presentingViewController dismissViewControllerAnimated:YES completion:nil]; |
78 } else { |
78 } else { |
79 [GameInterfaceBridge registerCallingController:self]; |
79 [GameInterfaceBridge registerCallingController:self]; |
80 [GameInterfaceBridge startMissionGame:self.missionName]; |
80 [GameInterfaceBridge startMissionGame:self.missionSubPath]; |
81 } |
81 } |
82 } |
82 } |
83 |
83 |
84 #pragma mark - Missions dictionaries methods |
84 #pragma mark - Missions dictionaries methods |
85 |
85 |
360 NSInteger section = [indexPath section]; |
360 NSInteger section = [indexPath section]; |
361 NSString *type = self.missionsTypes[section]; |
361 NSString *type = self.missionsTypes[section]; |
362 NSArray *listOfIDs = [self listOfMissionsIDsForType:type]; |
362 NSArray *listOfIDs = [self listOfMissionsIDsForType:type]; |
363 |
363 |
364 NSInteger row = [indexPath row]; |
364 NSInteger row = [indexPath row]; |
365 self.missionName = [listOfIDs objectAtIndex:row]; |
365 NSString *missionID = [listOfIDs objectAtIndex:row]; |
|
366 self.missionSubPath = [NSString stringWithFormat:@"%@/%@", type, missionID]; |
366 NSString *size = IS_IPAD() ? @"@2x" : @""; |
367 NSString *size = IS_IPAD() ? @"@2x" : @""; |
367 NSString *filePath = [[NSString alloc] initWithFormat:@"%@/Missions/%@/%@%@.png",GRAPHICS_DIRECTORY(), type, self.missionName, size]; |
368 NSString *filePath = [NSString stringWithFormat:@"%@/Missions/%@%@.png",GRAPHICS_DIRECTORY(), self.missionSubPath, size]; |
368 UIImage *img = [[UIImage alloc] initWithContentsOfFile:filePath]; |
369 UIImage *img = [[UIImage alloc] initWithContentsOfFile:filePath]; |
369 [self.previewImage setImage:img]; |
370 [self.previewImage setImage:img]; |
370 |
371 |
371 NSDictionary *dict = [self dictOfMissionsForType:type]; |
372 NSDictionary *dict = [self dictOfMissionsForType:type]; |
372 self.descriptionLabel.text = dict[self.missionName][@"desc"]; |
373 self.descriptionLabel.text = dict[missionID][@"desc"]; |
373 } |
374 } |
374 |
375 |
375 #pragma mark - |
376 #pragma mark - |
376 #pragma mark Memory management |
377 #pragma mark Memory management |
377 |
378 |