author | sheepluva |
Sat, 16 Jan 2016 19:50:38 +0100 | |
changeset 11522 | b3ee79e8e3b9 |
parent 11350 | 1f517a461c33 |
child 11554 | 893722a2a1f9 |
permissions | -rw-r--r-- |
6083
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
1 |
/* |
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
2 |
* Hedgewars-iOS, a Hedgewars port for iOS devices |
6700 | 3 |
* Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@gmail.com> |
6083
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
4 |
* |
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
5 |
* This program is free software; you can redistribute it and/or modify |
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
6 |
* it under the terms of the GNU General Public License as published by |
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
7 |
* the Free Software Foundation; version 2 of the License |
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
8 |
* |
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
9 |
* This program is distributed in the hope that it will be useful, |
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
12 |
* GNU General Public License for more details. |
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
13 |
* |
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
14 |
* You should have received a copy of the GNU General Public License |
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
15 |
* along with this program; if not, write to the Free Software |
10108
c68cf030eded
update FSF address. note: two sdl include files (by Sam Lantinga) still have the old FSF address in their copyright - but I ain't gonna touch their copyright headers
sheepluva
parents:
6908
diff
changeset
|
16 |
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
6083
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
17 |
*/ |
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
18 |
|
6094
16b12a6417d1
added iphone interface for missions/trainings page, setters/getters unlocked
koda
parents:
6084
diff
changeset
|
19 |
|
6083
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
20 |
#import "MissionTrainingViewController.h" |
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
21 |
#import <QuartzCore/QuartzCore.h> |
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
22 |
#import "GameInterfaceBridge.h" |
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
23 |
|
6094
16b12a6417d1
added iphone interface for missions/trainings page, setters/getters unlocked
koda
parents:
6084
diff
changeset
|
24 |
|
6083
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
25 |
@implementation MissionTrainingViewController |
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
26 |
|
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
27 |
-(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation { |
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
28 |
return rotationManager(interfaceOrientation); |
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
29 |
} |
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
30 |
|
6094
16b12a6417d1
added iphone interface for missions/trainings page, setters/getters unlocked
koda
parents:
6084
diff
changeset
|
31 |
#pragma mark - |
16b12a6417d1
added iphone interface for missions/trainings page, setters/getters unlocked
koda
parents:
6084
diff
changeset
|
32 |
#pragma mark View management |
11224
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
33 |
-(void) viewDidLoad |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
34 |
{ |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
35 |
[super viewDidLoad]; |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
36 |
|
6083
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
37 |
self.previewImage.layer.borderColor = [[UIColor darkYellowColor] CGColor]; |
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
38 |
self.previewImage.layer.borderWidth = 3.8f; |
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
39 |
self.previewImage.layer.cornerRadius = 14; |
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
40 |
|
6210
923c8414e3af
fix runtime compability with ios 3.* (hopefully) and fix a small glitch in turning off music/sounds
koda
parents:
6100
diff
changeset
|
41 |
if (IS_IPAD()) { |
923c8414e3af
fix runtime compability with ios 3.* (hopefully) and fix a small glitch in turning off music/sounds
koda
parents:
6100
diff
changeset
|
42 |
[self.tableView setBackgroundColorForAnyTable:[UIColor darkBlueColorTransparent]]; |
923c8414e3af
fix runtime compability with ios 3.* (hopefully) and fix a small glitch in turning off music/sounds
koda
parents:
6100
diff
changeset
|
43 |
self.tableView.layer.borderColor = [[UIColor darkYellowColor] CGColor]; |
923c8414e3af
fix runtime compability with ios 3.* (hopefully) and fix a small glitch in turning off music/sounds
koda
parents:
6100
diff
changeset
|
44 |
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone; |
923c8414e3af
fix runtime compability with ios 3.* (hopefully) and fix a small glitch in turning off music/sounds
koda
parents:
6100
diff
changeset
|
45 |
} else { |
923c8414e3af
fix runtime compability with ios 3.* (hopefully) and fix a small glitch in turning off music/sounds
koda
parents:
6100
diff
changeset
|
46 |
[self.tableView setBackgroundColorForAnyTable:[UIColor blackColorTransparent]]; |
923c8414e3af
fix runtime compability with ios 3.* (hopefully) and fix a small glitch in turning off music/sounds
koda
parents:
6100
diff
changeset
|
47 |
self.tableView.layer.borderColor = [[UIColor whiteColor] CGColor]; |
923c8414e3af
fix runtime compability with ios 3.* (hopefully) and fix a small glitch in turning off music/sounds
koda
parents:
6100
diff
changeset
|
48 |
self.tableView.separatorStyle = UITableViewCellSeparatorStyleSingleLine; |
923c8414e3af
fix runtime compability with ios 3.* (hopefully) and fix a small glitch in turning off music/sounds
koda
parents:
6100
diff
changeset
|
49 |
} |
6094
16b12a6417d1
added iphone interface for missions/trainings page, setters/getters unlocked
koda
parents:
6084
diff
changeset
|
50 |
self.tableView.layer.borderWidth = 2.4f; |
6083
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
51 |
self.tableView.layer.cornerRadius = 8; |
6094
16b12a6417d1
added iphone interface for missions/trainings page, setters/getters unlocked
koda
parents:
6084
diff
changeset
|
52 |
self.tableView.separatorColor = [UIColor whiteColor]; |
6083
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
53 |
|
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
54 |
self.descriptionLabel.textColor = [UIColor lightYellowColor]; |
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
55 |
} |
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
56 |
|
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
57 |
-(void) viewWillAppear:(BOOL)animated { |
11224
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
58 |
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:arc4random_uniform((int)[self.listOfMissionIDs count]) inSection:0]; |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
59 |
[self.tableView selectRowAtIndexPath:indexPath animated:YES scrollPosition:UITableViewScrollPositionMiddle]; |
6083
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
60 |
[self tableView:self.tableView didSelectRowAtIndexPath:indexPath]; |
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
61 |
[super viewWillAppear:animated]; |
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
62 |
} |
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
63 |
|
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
64 |
-(IBAction) buttonPressed:(id) sender { |
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
65 |
UIButton *button = (UIButton *)sender; |
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
66 |
|
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
67 |
if (button.tag == 0) { |
6869
a187c280dd3d
ios: convert audio operation from class to instance, plays better with memory
koda
parents:
6832
diff
changeset
|
68 |
[[AudioManagerController mainManager] playBackSound]; |
11116
102684240fe8
- Interscreen transitions fixed
Anton Malmygin <antonc27@mail.ru>
parents:
10108
diff
changeset
|
69 |
[self.presentingViewController dismissViewControllerAnimated:YES completion:nil]; |
6083
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
70 |
} else { |
6353
d8f62c805619
restore displaying statistics at the end of a game and restore warning lower views that they are going to appear
koda
parents:
6266
diff
changeset
|
71 |
[GameInterfaceBridge registerCallingController:self]; |
6266
b02a1e92dba2
convert gameinterfacebridge in simple-to-use class methods
koda
parents:
6210
diff
changeset
|
72 |
[GameInterfaceBridge startMissionGame:self.missionName]; |
6083
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
73 |
} |
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
74 |
} |
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
75 |
|
11224
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
76 |
#pragma mark - Missions dictionaries methods |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
77 |
|
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
78 |
- (NSDictionary *)newLocalizedMissionsDictionary |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
79 |
{ |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
80 |
NSString *languageID = [HWUtils languageID]; |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
81 |
|
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
82 |
NSString *missionsDescLocation = [[NSString alloc] initWithFormat:@"%@/missions_en.txt",LOCALE_DIRECTORY()]; |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
83 |
NSString *localizedMissionsDescLocation = [[NSString alloc] initWithFormat:@"%@/missions_%@.txt", LOCALE_DIRECTORY(), languageID]; |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
84 |
|
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
85 |
if (![languageID isEqualToString:@"en"] && [[NSFileManager defaultManager] fileExistsAtPath:localizedMissionsDescLocation]) |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
86 |
{ |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
87 |
NSDictionary *missionsDict = [self newMissionsDictionaryFromMissionsFile:missionsDescLocation]; |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
88 |
NSDictionary *localizedMissionsDict = [self newMissionsDictionaryFromMissionsFile:localizedMissionsDescLocation]; |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
89 |
|
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
90 |
[missionsDescLocation release]; |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
91 |
[localizedMissionsDescLocation release]; |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
92 |
|
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
93 |
NSMutableDictionary *tempMissionsDict = [[NSMutableDictionary alloc] init]; |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
94 |
|
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
95 |
for (NSString *key in [missionsDict allKeys]) |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
96 |
{ |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
97 |
if ([localizedMissionsDict objectForKey:key]) |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
98 |
{ |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
99 |
[tempMissionsDict setObject:[localizedMissionsDict objectForKey:key] forKey:key]; |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
100 |
} |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
101 |
else |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
102 |
{ |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
103 |
[tempMissionsDict setObject:[missionsDict objectForKey:key] forKey:key]; |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
104 |
} |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
105 |
} |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
106 |
|
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
107 |
[missionsDict release]; |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
108 |
[localizedMissionsDict release]; |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
109 |
|
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
110 |
return tempMissionsDict; |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
111 |
} |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
112 |
else |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
113 |
{ |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
114 |
NSDictionary *missionsDict = [self newMissionsDictionaryFromMissionsFile:missionsDescLocation]; |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
115 |
|
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
116 |
[missionsDescLocation release]; |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
117 |
[localizedMissionsDescLocation release]; |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
118 |
|
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
119 |
return missionsDict; |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
120 |
} |
6094
16b12a6417d1
added iphone interface for missions/trainings page, setters/getters unlocked
koda
parents:
6084
diff
changeset
|
121 |
} |
16b12a6417d1
added iphone interface for missions/trainings page, setters/getters unlocked
koda
parents:
6084
diff
changeset
|
122 |
|
11224
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
123 |
- (NSDictionary *)newMissionsDictionaryFromMissionsFile:(NSString *)filePath |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
124 |
{ |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
125 |
NSMutableDictionary *missionsDict = [[NSMutableDictionary alloc] init]; |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
126 |
|
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
127 |
NSString *missionsFileContents = [[NSString alloc] initWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:NULL]; |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
128 |
NSArray *missionsLines = [missionsFileContents componentsSeparatedByString:@"\n"]; |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
129 |
[missionsFileContents release]; |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
130 |
|
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
131 |
for (NSString *line in missionsLines) |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
132 |
{ |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
133 |
if ([line length] > 0) |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
134 |
{ |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
135 |
NSUInteger firstDotLocation = [line rangeOfString:@"."].location; |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
136 |
|
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
137 |
NSString *missionID = [line substringToIndex:firstDotLocation]; |
11243
a954853e9c00
- Fix for loading non-existing missions in MissionTrainingViewController
antonc27 <antonc27@mail.ru>
parents:
11224
diff
changeset
|
138 |
|
a954853e9c00
- Fix for loading non-existing missions in MissionTrainingViewController
antonc27 <antonc27@mail.ru>
parents:
11224
diff
changeset
|
139 |
NSString *missionFullPath = [NSString stringWithFormat:@"%@%@.lua", TRAININGS_DIRECTORY(), missionID]; |
a954853e9c00
- Fix for loading non-existing missions in MissionTrainingViewController
antonc27 <antonc27@mail.ru>
parents:
11224
diff
changeset
|
140 |
if (![[NSFileManager defaultManager] fileExistsAtPath:missionFullPath]) |
a954853e9c00
- Fix for loading non-existing missions in MissionTrainingViewController
antonc27 <antonc27@mail.ru>
parents:
11224
diff
changeset
|
141 |
{ |
a954853e9c00
- Fix for loading non-existing missions in MissionTrainingViewController
antonc27 <antonc27@mail.ru>
parents:
11224
diff
changeset
|
142 |
continue; |
a954853e9c00
- Fix for loading non-existing missions in MissionTrainingViewController
antonc27 <antonc27@mail.ru>
parents:
11224
diff
changeset
|
143 |
} |
a954853e9c00
- Fix for loading non-existing missions in MissionTrainingViewController
antonc27 <antonc27@mail.ru>
parents:
11224
diff
changeset
|
144 |
|
11224
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
145 |
NSString *nameOrDesc = [line substringFromIndex:firstDotLocation+1]; |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
146 |
|
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
147 |
NSString *missionParsedName = ([nameOrDesc hasPrefix:@"name="]) ? [nameOrDesc stringByReplacingOccurrencesOfString:@"name=" withString:@""] : nil; |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
148 |
NSString *missionParsedDesc = ([nameOrDesc hasPrefix:@"desc="]) ? [nameOrDesc stringByReplacingOccurrencesOfString:@"desc=" withString:@""] : nil; |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
149 |
|
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
150 |
if (![missionsDict objectForKey:missionID]) |
11119
f08d5bb1d2b0
- Fix for loading missions descriptions
antonc27 <antonc27@mail.ru>
parents:
11116
diff
changeset
|
151 |
{ |
11224
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
152 |
NSMutableDictionary *missionDict = [[NSMutableDictionary alloc] init]; |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
153 |
[missionsDict setObject:missionDict forKey:missionID]; |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
154 |
[missionDict release]; |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
155 |
} |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
156 |
|
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
157 |
NSMutableDictionary *missionDict = [missionsDict objectForKey:missionID]; |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
158 |
|
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
159 |
if (missionParsedName) |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
160 |
{ |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
161 |
[missionDict setObject:missionParsedName forKey:@"name"]; |
11119
f08d5bb1d2b0
- Fix for loading missions descriptions
antonc27 <antonc27@mail.ru>
parents:
11116
diff
changeset
|
162 |
} |
f08d5bb1d2b0
- Fix for loading missions descriptions
antonc27 <antonc27@mail.ru>
parents:
11116
diff
changeset
|
163 |
|
11224
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
164 |
if (missionParsedDesc) |
11119
f08d5bb1d2b0
- Fix for loading missions descriptions
antonc27 <antonc27@mail.ru>
parents:
11116
diff
changeset
|
165 |
{ |
11224
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
166 |
missionParsedDesc = [missionParsedDesc stringByReplacingOccurrencesOfString:@"\"" withString:@""]; |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
167 |
[missionDict setObject:missionParsedDesc forKey:@"desc"]; |
11119
f08d5bb1d2b0
- Fix for loading missions descriptions
antonc27 <antonc27@mail.ru>
parents:
11116
diff
changeset
|
168 |
} |
11224
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
169 |
|
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
170 |
[missionsDict setObject:missionDict forKey:missionID]; |
6094
16b12a6417d1
added iphone interface for missions/trainings page, setters/getters unlocked
koda
parents:
6084
diff
changeset
|
171 |
} |
16b12a6417d1
added iphone interface for missions/trainings page, setters/getters unlocked
koda
parents:
6084
diff
changeset
|
172 |
} |
11224
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
173 |
|
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
174 |
return missionsDict; |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
175 |
} |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
176 |
|
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
177 |
#pragma mark - |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
178 |
#pragma mark override setters/getters for better memory handling |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
179 |
|
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
180 |
-(NSArray *)listOfMissionIDs |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
181 |
{ |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
182 |
if (!_listOfMissionIDs) |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
183 |
{ |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
184 |
NSArray *sortedKeys = [[self.dictOfMissions allKeys] sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)]; |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
185 |
_listOfMissionIDs = [[NSArray alloc] initWithArray:sortedKeys]; |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
186 |
} |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
187 |
|
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
188 |
return _listOfMissionIDs; |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
189 |
} |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
190 |
|
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
191 |
- (NSDictionary *)dictOfMissions |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
192 |
{ |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
193 |
if (!_dictOfMissions) |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
194 |
{ |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
195 |
_dictOfMissions = [self newLocalizedMissionsDictionary]; |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
196 |
} |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
197 |
|
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
198 |
return _dictOfMissions; |
6094
16b12a6417d1
added iphone interface for missions/trainings page, setters/getters unlocked
koda
parents:
6084
diff
changeset
|
199 |
} |
16b12a6417d1
added iphone interface for missions/trainings page, setters/getters unlocked
koda
parents:
6084
diff
changeset
|
200 |
|
16b12a6417d1
added iphone interface for missions/trainings page, setters/getters unlocked
koda
parents:
6084
diff
changeset
|
201 |
#pragma mark - |
6083
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
202 |
#pragma mark Table view data source |
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
203 |
-(NSInteger) numberOfSectionsInTableView:(UITableView *)tableView { |
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
204 |
return 1; |
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
205 |
} |
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
206 |
|
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
207 |
-(NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { |
11224
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
208 |
return [self.listOfMissionIDs count]; |
6083
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
209 |
} |
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
210 |
|
6094
16b12a6417d1
added iphone interface for missions/trainings page, setters/getters unlocked
koda
parents:
6084
diff
changeset
|
211 |
-(CGFloat) tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { |
16b12a6417d1
added iphone interface for missions/trainings page, setters/getters unlocked
koda
parents:
6084
diff
changeset
|
212 |
return (IS_IPAD()) ? self.tableView.rowHeight : 80; |
16b12a6417d1
added iphone interface for missions/trainings page, setters/getters unlocked
koda
parents:
6084
diff
changeset
|
213 |
} |
16b12a6417d1
added iphone interface for missions/trainings page, setters/getters unlocked
koda
parents:
6084
diff
changeset
|
214 |
|
6083
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
215 |
-(UITableViewCell *)tableView:(UITableView *)aTableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { |
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
216 |
static NSString *CellIdentifier = @"CellTr"; |
6094
16b12a6417d1
added iphone interface for missions/trainings page, setters/getters unlocked
koda
parents:
6084
diff
changeset
|
217 |
NSInteger row = [indexPath row]; |
6083
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
218 |
|
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
219 |
UITableViewCell *cell = [aTableView dequeueReusableCellWithIdentifier:CellIdentifier]; |
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
220 |
if (cell == nil) |
6094
16b12a6417d1
added iphone interface for missions/trainings page, setters/getters unlocked
koda
parents:
6084
diff
changeset
|
221 |
cell = [[[UITableViewCell alloc] initWithStyle:(IS_IPAD()) ? UITableViewCellStyleDefault : UITableViewCellStyleSubtitle |
16b12a6417d1
added iphone interface for missions/trainings page, setters/getters unlocked
koda
parents:
6084
diff
changeset
|
222 |
reuseIdentifier:CellIdentifier] autorelease]; |
11224
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
223 |
|
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
224 |
NSString *missionID = [self.listOfMissionIDs objectAtIndex:row]; |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
225 |
cell.textLabel.text = self.dictOfMissions[missionID][@"name"]; |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
226 |
|
6083
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
227 |
cell.textLabel.textColor = [UIColor lightYellowColor]; |
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
228 |
//cell.textLabel.font = [UIFont fontWithName:@"Bradley Hand Bold" size:[UIFont labelFontSize]]; |
6094
16b12a6417d1
added iphone interface for missions/trainings page, setters/getters unlocked
koda
parents:
6084
diff
changeset
|
229 |
cell.textLabel.textAlignment = (IS_IPAD()) ? UITextAlignmentCenter : UITextAlignmentLeft; |
6083
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
230 |
cell.textLabel.backgroundColor = [UIColor clearColor]; |
6094
16b12a6417d1
added iphone interface for missions/trainings page, setters/getters unlocked
koda
parents:
6084
diff
changeset
|
231 |
cell.textLabel.adjustsFontSizeToFitWidth = YES; |
11224
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
232 |
cell.detailTextLabel.text = (IS_IPAD()) ? nil : self.dictOfMissions[missionID][@"desc"]; |
6094
16b12a6417d1
added iphone interface for missions/trainings page, setters/getters unlocked
koda
parents:
6084
diff
changeset
|
233 |
cell.detailTextLabel.textColor = [UIColor whiteColor]; |
16b12a6417d1
added iphone interface for missions/trainings page, setters/getters unlocked
koda
parents:
6084
diff
changeset
|
234 |
cell.detailTextLabel.backgroundColor = [UIColor clearColor]; |
16b12a6417d1
added iphone interface for missions/trainings page, setters/getters unlocked
koda
parents:
6084
diff
changeset
|
235 |
cell.detailTextLabel.adjustsFontSizeToFitWidth = YES; |
16b12a6417d1
added iphone interface for missions/trainings page, setters/getters unlocked
koda
parents:
6084
diff
changeset
|
236 |
cell.detailTextLabel.numberOfLines = ([cell.detailTextLabel.text length] % 40); |
16b12a6417d1
added iphone interface for missions/trainings page, setters/getters unlocked
koda
parents:
6084
diff
changeset
|
237 |
cell.detailTextLabel.baselineAdjustment = UIBaselineAdjustmentAlignCenters; |
16b12a6417d1
added iphone interface for missions/trainings page, setters/getters unlocked
koda
parents:
6084
diff
changeset
|
238 |
|
11222
08f20ffa5801
- Small adjust for cell selection color of Missions screen
antonc27 <antonc27@mail.ru>
parents:
11210
diff
changeset
|
239 |
UIView *bgColorView = [[UIView alloc] init]; |
08f20ffa5801
- Small adjust for cell selection color of Missions screen
antonc27 <antonc27@mail.ru>
parents:
11210
diff
changeset
|
240 |
bgColorView.backgroundColor = [UIColor colorWithRed:(85.0/255.0) green:(15.0/255.0) blue:(106.0/255.0) alpha:1.0]; |
08f20ffa5801
- Small adjust for cell selection color of Missions screen
antonc27 <antonc27@mail.ru>
parents:
11210
diff
changeset
|
241 |
bgColorView.layer.masksToBounds = YES; |
08f20ffa5801
- Small adjust for cell selection color of Missions screen
antonc27 <antonc27@mail.ru>
parents:
11210
diff
changeset
|
242 |
cell.selectedBackgroundView = bgColorView; |
08f20ffa5801
- Small adjust for cell selection color of Missions screen
antonc27 <antonc27@mail.ru>
parents:
11210
diff
changeset
|
243 |
[bgColorView release]; |
08f20ffa5801
- Small adjust for cell selection color of Missions screen
antonc27 <antonc27@mail.ru>
parents:
11210
diff
changeset
|
244 |
|
6083
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
245 |
cell.backgroundColor = [UIColor blackColorTransparent]; |
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
246 |
return cell; |
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
247 |
} |
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
248 |
|
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
249 |
#pragma mark - |
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
250 |
#pragma mark Table view delegate |
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
251 |
-(void) tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { |
6094
16b12a6417d1
added iphone interface for missions/trainings page, setters/getters unlocked
koda
parents:
6084
diff
changeset
|
252 |
NSInteger row = [indexPath row]; |
16b12a6417d1
added iphone interface for missions/trainings page, setters/getters unlocked
koda
parents:
6084
diff
changeset
|
253 |
|
11224
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
254 |
self.missionName = [self.listOfMissionIDs objectAtIndex:row]; |
6100 | 255 |
NSString *size = IS_IPAD() ? @"@2x" : @""; |
256 |
NSString *filePath = [[NSString alloc] initWithFormat:@"%@/Missions/Training/%@%@.png",GRAPHICS_DIRECTORY(),self.missionName,size]; |
|
6083
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
257 |
UIImage *img = [[UIImage alloc] initWithContentsOfFile:filePath]; |
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
258 |
[filePath release]; |
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
259 |
[self.previewImage setImage:img]; |
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
260 |
[img release]; |
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
261 |
|
11224
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
262 |
self.descriptionLabel.text = self.dictOfMissions[self.missionName][@"desc"]; |
6083
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
263 |
} |
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
264 |
|
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
265 |
#pragma mark - |
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
266 |
#pragma mark Memory management |
11224
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
267 |
|
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
268 |
-(void) didReceiveMemoryWarning |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
269 |
{ |
6094
16b12a6417d1
added iphone interface for missions/trainings page, setters/getters unlocked
koda
parents:
6084
diff
changeset
|
270 |
self.missionName = nil; |
11224
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
271 |
self.listOfMissionIDs = nil; |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
272 |
self.dictOfMissions = nil; |
6094
16b12a6417d1
added iphone interface for missions/trainings page, setters/getters unlocked
koda
parents:
6084
diff
changeset
|
273 |
// if you nil this one it won't get updated anymore |
16b12a6417d1
added iphone interface for missions/trainings page, setters/getters unlocked
koda
parents:
6084
diff
changeset
|
274 |
//self.previewImage = nil; |
6083
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
275 |
[super didReceiveMemoryWarning]; |
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
276 |
} |
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
277 |
|
11224
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
278 |
-(void) viewDidUnload |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
279 |
{ |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
280 |
self.listOfMissionIDs = nil; |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
281 |
self.dictOfMissions = nil; |
6083
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
282 |
self.previewImage = nil; |
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
283 |
self.tableView = nil; |
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
284 |
self.descriptionLabel = nil; |
6084 | 285 |
self.missionName = nil; |
6083
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
286 |
MSG_DIDUNLOAD(); |
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
287 |
[super viewDidUnload]; |
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
288 |
} |
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
289 |
|
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
290 |
|
11224
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
291 |
-(void) dealloc |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
292 |
{ |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
293 |
releaseAndNil(_listOfMissionIDs); |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
294 |
releaseAndNil(_dictOfMissions); |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
295 |
releaseAndNil(_previewImage); |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
296 |
releaseAndNil(_tableView); |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
297 |
releaseAndNil(_descriptionLabel); |
32366eb83383
- Refactoring of Missions screen:
antonc27 <antonc27@mail.ru>
parents:
11222
diff
changeset
|
298 |
releaseAndNil(_missionName); |
6083
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
299 |
[super dealloc]; |
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
300 |
} |
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
301 |
|
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
302 |
|
72c882c0fd0f
first pass for implementing missions/training selection on ipad (not yet running)
koda
parents:
diff
changeset
|
303 |
@end |