author | koda |
Wed, 21 Sep 2011 22:51:52 +0200 | |
changeset 5982 | 283be2ca54a7 |
parent 5208 | 878e551f0b4a |
child 5983 | f0925204f50e |
permissions | -rw-r--r-- |
3829 | 1 |
/* |
2 |
* Hedgewars-iOS, a Hedgewars port for iOS devices |
|
4976 | 3 |
* Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com> |
3829 | 4 |
* |
5 |
* This program is free software; you can redistribute it and/or modify |
|
6 |
* it under the terms of the GNU General Public License as published by |
|
7 |
* the Free Software Foundation; version 2 of the License |
|
8 |
* |
|
9 |
* This program is distributed in the hope that it will be useful, |
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 |
* GNU General Public License for more details. |
|
13 |
* |
|
14 |
* You should have received a copy of the GNU General Public License |
|
15 |
* along with this program; if not, write to the Free Software |
|
16 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
17 |
* |
|
18 |
* File created on 02/04/2010. |
|
19 |
*/ |
|
20 |
||
3547 | 21 |
|
22 |
#import "SingleTeamViewController.h" |
|
4478 | 23 |
#import <QuartzCore/QuartzCore.h> |
3547 | 24 |
#import "HogHatViewController.h" |
25 |
#import "GravesViewController.h" |
|
26 |
#import "VoicesViewController.h" |
|
27 |
#import "FortsViewController.h" |
|
28 |
#import "FlagsViewController.h" |
|
29 |
#import "LevelViewController.h" |
|
30 |
#import "CommodityFunctions.h" |
|
31 |
#import "UIImageExtra.h" |
|
3926
668b71f31e51
use dynamic data from engine instead of using hardcoded values
koda
parents:
3924
diff
changeset
|
32 |
#import "PascalImports.h" |
3547 | 33 |
|
3660 | 34 |
#define TEAMNAME_TAG 78789 |
3547 | 35 |
|
36 |
@implementation SingleTeamViewController |
|
3816 | 37 |
@synthesize teamDictionary, normalHogSprite, secondaryItems, moreSecondaryItems, teamName; |
3547 | 38 |
|
39 |
-(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation { |
|
40 |
return rotationManager(interfaceOrientation); |
|
41 |
} |
|
42 |
||
43 |
#pragma mark - |
|
3660 | 44 |
#pragma mark editableCellViewDelegate methods |
3547 | 45 |
// set the new value |
3660 | 46 |
-(void) saveTextFieldValue:(NSString *)textString withTag:(NSInteger) tagValue { |
47 |
if (TEAMNAME_TAG == tagValue) { |
|
48 |
// delete old file |
|
49 |
[[NSFileManager defaultManager] removeItemAtPath:[NSString stringWithFormat:@"%@/%@.plist",TEAMS_DIRECTORY(),self.teamName] error:NULL]; |
|
50 |
// update filename |
|
51 |
self.teamName = textString; |
|
52 |
// save new file |
|
53 |
[self writeFile]; |
|
54 |
} else { |
|
55 |
// replace the old value with the new one |
|
56 |
NSMutableDictionary *hog = [[teamDictionary objectForKey:@"hedgehogs"] objectAtIndex:tagValue]; |
|
57 |
[hog setObject:textString forKey:@"hogname"]; |
|
3547 | 58 |
isWriteNeeded = YES; |
59 |
} |
|
60 |
} |
|
61 |
||
62 |
#pragma mark - |
|
63 |
#pragma mark View lifecycle |
|
64 |
-(void) viewDidLoad { |
|
65 |
[super viewDidLoad]; |
|
3697 | 66 |
|
3547 | 67 |
// labels for the entries |
68 |
NSArray *array = [[NSArray alloc] initWithObjects: |
|
69 |
NSLocalizedString(@"Grave",@""), |
|
70 |
NSLocalizedString(@"Voice",@""), |
|
71 |
NSLocalizedString(@"Fort",@""), |
|
72 |
NSLocalizedString(@"Flag",@""), |
|
73 |
NSLocalizedString(@"Level",@""),nil]; |
|
74 |
self.secondaryItems = array; |
|
75 |
[array release]; |
|
3816 | 76 |
|
77 |
// labels for the subtitles |
|
78 |
NSArray *moreArray = [[NSArray alloc] initWithObjects: |
|
79 |
NSLocalizedString(@"Mark the death of your fallen warriors",@""), |
|
80 |
NSLocalizedString(@"Pick a slang your hogs will speak",@""), |
|
81 |
NSLocalizedString(@"Select the team invincible fortress (only valid for fort games)",@""), |
|
82 |
NSLocalizedString(@"Choose a charismatic symbol for your team",@""), |
|
83 |
NSLocalizedString(@"Opt for controlling the team or let the AI lead",@""),nil]; |
|
84 |
self.moreSecondaryItems = moreArray; |
|
85 |
[moreArray release]; |
|
3547 | 86 |
|
87 |
// load the base hog image, drawing will occure in cellForRow... |
|
88 |
NSString *normalHogFile = [[NSString alloc] initWithFormat:@"%@/Hedgehog.png",GRAPHICS_DIRECTORY()]; |
|
89 |
UIImage *hogSprite = [[UIImage alloc] initWithContentsOfFile:normalHogFile andCutAt:CGRectMake(96, 0, 32, 32)]; |
|
90 |
[normalHogFile release]; |
|
91 |
self.normalHogSprite = hogSprite; |
|
92 |
[hogSprite release]; |
|
3697 | 93 |
|
3547 | 94 |
// listen if any childController modifies the plist and write it if needed |
95 |
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(setWriteNeeded) name:@"setWriteNeedTeams" object:nil]; |
|
96 |
isWriteNeeded = NO; |
|
3697 | 97 |
|
3660 | 98 |
self.title = NSLocalizedString(@"Edit team settings",@""); |
3547 | 99 |
} |
100 |
||
101 |
-(void) viewWillAppear:(BOOL)animated { |
|
102 |
[super viewWillAppear:animated]; |
|
3697 | 103 |
|
3660 | 104 |
// load data about the team and write if there has been a change from other childControllers |
3697 | 105 |
if (isWriteNeeded) |
3547 | 106 |
[self writeFile]; |
3697 | 107 |
|
3660 | 108 |
NSString *teamFile = [[NSString alloc] initWithFormat:@"%@/%@.plist",TEAMS_DIRECTORY(),self.teamName]; |
3547 | 109 |
NSMutableDictionary *teamDict = [[NSMutableDictionary alloc] initWithContentsOfFile:teamFile]; |
110 |
self.teamDictionary = teamDict; |
|
111 |
[teamDict release]; |
|
112 |
[teamFile release]; |
|
3697 | 113 |
|
3547 | 114 |
[self.tableView reloadData]; |
115 |
} |
|
116 |
||
117 |
// write on file if there has been a change |
|
118 |
-(void) viewWillDisappear:(BOOL)animated { |
|
119 |
[super viewWillDisappear:animated]; |
|
120 |
||
3697 | 121 |
if (isWriteNeeded) |
3660 | 122 |
[self writeFile]; |
3547 | 123 |
} |
124 |
||
125 |
#pragma mark - |
|
126 |
// needed by other classes to warn about a user change |
|
127 |
-(void) setWriteNeeded { |
|
128 |
isWriteNeeded = YES; |
|
129 |
} |
|
130 |
||
131 |
-(void) writeFile { |
|
3660 | 132 |
NSString *teamFile = [[NSString alloc] initWithFormat:@"%@/%@.plist",TEAMS_DIRECTORY(),self.teamName]; |
133 |
[self.teamDictionary writeToFile:teamFile atomically:YES]; |
|
134 |
[teamFile release]; |
|
3547 | 135 |
|
3789
c3eb56754e92
added a smaller version of forts, fixed a couple of regressions
koda
parents:
3783
diff
changeset
|
136 |
//DLog(@"%@",teamDictionary); |
3547 | 137 |
isWriteNeeded = NO; |
138 |
} |
|
139 |
||
140 |
#pragma mark - |
|
141 |
#pragma mark Table view data source |
|
142 |
-(NSInteger) numberOfSectionsInTableView:(UITableView *)tableView { |
|
143 |
return 3; |
|
144 |
} |
|
145 |
||
146 |
-(NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { |
|
147 |
NSInteger rows = 0; |
|
148 |
switch (section) { |
|
149 |
case 0: // team name |
|
150 |
rows = 1; |
|
151 |
break; |
|
152 |
case 1: // team members |
|
3926
668b71f31e51
use dynamic data from engine instead of using hardcoded values
koda
parents:
3924
diff
changeset
|
153 |
rows = HW_getMaxNumberOfHogs(); |
3547 | 154 |
break; |
155 |
case 2: // team details |
|
156 |
rows = [self.secondaryItems count]; |
|
157 |
break; |
|
158 |
default: |
|
159 |
break; |
|
160 |
} |
|
161 |
return rows; |
|
162 |
} |
|
163 |
||
3660 | 164 |
-(NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { |
165 |
NSString *sectionTitle = nil; |
|
166 |
switch (section) { |
|
167 |
case 0: |
|
168 |
sectionTitle = NSLocalizedString(@"Team Name", @""); |
|
169 |
break; |
|
170 |
case 1: |
|
171 |
sectionTitle = NSLocalizedString(@"Names and Hats", @""); |
|
172 |
break; |
|
173 |
case 2: |
|
174 |
sectionTitle = NSLocalizedString(@"Team Preferences", @""); |
|
175 |
break; |
|
176 |
default: |
|
177 |
DLog(@"Nope"); |
|
178 |
break; |
|
179 |
} |
|
180 |
return sectionTitle; |
|
181 |
} |
|
182 |
||
3547 | 183 |
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { |
184 |
static NSString *CellIdentifier0 = @"Cell0"; |
|
185 |
static NSString *CellIdentifier1 = @"Cell1"; |
|
186 |
static NSString *CellIdentifier2 = @"Cell2"; |
|
3697 | 187 |
|
3547 | 188 |
NSArray *hogArray; |
189 |
UITableViewCell *cell = nil; |
|
3660 | 190 |
EditableCellView *editableCell = nil; |
3547 | 191 |
NSInteger row = [indexPath row]; |
192 |
UIImage *accessoryImage; |
|
3697 | 193 |
|
3547 | 194 |
switch ([indexPath section]) { |
195 |
case 0: |
|
3660 | 196 |
editableCell = (EditableCellView *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier0]; |
197 |
if (editableCell == nil) { |
|
3697 | 198 |
editableCell = [[[EditableCellView alloc] initWithStyle:UITableViewCellStyleDefault |
3547 | 199 |
reuseIdentifier:CellIdentifier0] autorelease]; |
3660 | 200 |
editableCell.delegate = self; |
201 |
editableCell.tag = TEAMNAME_TAG; |
|
3547 | 202 |
} |
3697 | 203 |
|
3660 | 204 |
editableCell.imageView.image = nil; |
205 |
editableCell.accessoryType = UITableViewCellAccessoryNone; |
|
206 |
editableCell.textField.text = self.teamName; |
|
207 |
||
208 |
cell = editableCell; |
|
3547 | 209 |
break; |
210 |
case 1: |
|
3660 | 211 |
editableCell = (EditableCellView *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier1]; |
212 |
if (editableCell == nil) { |
|
3697 | 213 |
editableCell = [[[EditableCellView alloc] initWithStyle:UITableViewCellStyleDefault |
3547 | 214 |
reuseIdentifier:CellIdentifier1] autorelease]; |
3660 | 215 |
editableCell.delegate = self; |
216 |
editableCell.tag = [indexPath row]; |
|
3547 | 217 |
} |
3697 | 218 |
|
3547 | 219 |
hogArray = [self.teamDictionary objectForKey:@"hedgehogs"]; |
3697 | 220 |
|
3660 | 221 |
// draw the hat on top of the hog |
3547 | 222 |
NSString *hatFile = [[NSString alloc] initWithFormat:@"%@/%@.png", HATS_DIRECTORY(), [[hogArray objectAtIndex:row] objectForKey:@"hat"]]; |
223 |
UIImage *hatSprite = [[UIImage alloc] initWithContentsOfFile: hatFile andCutAt:CGRectMake(0, 0, 32, 32)]; |
|
224 |
[hatFile release]; |
|
3948
24daa33a3114
some rethinking of initial menu presentation and initial orientation (also merging images should be threadsafe now)
koda
parents:
3926
diff
changeset
|
225 |
editableCell.imageView.image = [self.normalHogSprite mergeWith:hatSprite atPoint:CGPointMake(0, 5)]; |
3547 | 226 |
[hatSprite release]; |
3697 | 227 |
|
3660 | 228 |
editableCell.textField.text = [[hogArray objectAtIndex:row] objectForKey:@"hogname"]; |
229 |
editableCell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton; |
|
3697 | 230 |
|
3660 | 231 |
cell = editableCell; |
3547 | 232 |
break; |
233 |
case 2: |
|
234 |
cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier2]; |
|
235 |
if (cell == nil) { |
|
3816 | 236 |
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle |
3547 | 237 |
reuseIdentifier:CellIdentifier2] autorelease]; |
238 |
} |
|
3697 | 239 |
|
3547 | 240 |
cell.textLabel.text = [self.secondaryItems objectAtIndex:row]; |
3816 | 241 |
cell.detailTextLabel.text = [self.moreSecondaryItems objectAtIndex:row]; |
3547 | 242 |
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; |
243 |
switch (row) { |
|
244 |
case 0: // grave |
|
245 |
accessoryImage = [[UIImage alloc] initWithContentsOfFile:[NSString stringWithFormat:@"%@/%@.png", |
|
246 |
GRAVES_DIRECTORY(),[teamDictionary objectForKey:@"grave"]] |
|
247 |
andCutAt:CGRectMake(0,0,32,32)]; |
|
248 |
cell.imageView.image = accessoryImage; |
|
249 |
[accessoryImage release]; |
|
250 |
break; |
|
3816 | 251 |
case 1: // voice |
252 |
accessoryImage = [[UIImage alloc] initWithContentsOfFile:[NSString stringWithFormat:@"%@/HellishBomb.png", |
|
253 |
GRAPHICS_DIRECTORY()]]; |
|
254 |
cell.imageView.image = accessoryImage; |
|
255 |
[accessoryImage release]; |
|
256 |
break; |
|
3547 | 257 |
case 2: // fort |
5982
283be2ca54a7
mad several updates to the resource copying phase in the ios project file, changed paths of some images and added some smaller forts version
koda
parents:
5208
diff
changeset
|
258 |
accessoryImage = [[UIImage alloc] initWithContentsOfFile:[NSString stringWithFormat:@"%@/%@-icon.png", |
3547 | 259 |
FORTS_DIRECTORY(),[teamDictionary objectForKey:@"fort"]]]; |
5982
283be2ca54a7
mad several updates to the resource copying phase in the ios project file, changed paths of some images and added some smaller forts version
koda
parents:
5208
diff
changeset
|
260 |
cell.imageView.image = accessoryImage; |
3547 | 261 |
[accessoryImage release]; |
262 |
break; |
|
263 |
case 3: // flags |
|
264 |
accessoryImage = [[UIImage alloc] initWithContentsOfFile:[NSString stringWithFormat:@"%@/%@.png", |
|
265 |
FLAGS_DIRECTORY(),[teamDictionary objectForKey:@"flag"]]]; |
|
5982
283be2ca54a7
mad several updates to the resource copying phase in the ios project file, changed paths of some images and added some smaller forts version
koda
parents:
5208
diff
changeset
|
266 |
cell.imageView.image = [accessoryImage scaleToSize:CGSizeMake(26, 18)]; |
4478 | 267 |
cell.imageView.layer.borderWidth = 0.3; |
3547 | 268 |
[accessoryImage release]; |
269 |
break; |
|
270 |
case 4: // level |
|
5982
283be2ca54a7
mad several updates to the resource copying phase in the ios project file, changed paths of some images and added some smaller forts version
koda
parents:
5208
diff
changeset
|
271 |
accessoryImage = [[UIImage alloc] initWithContentsOfFile:[NSString stringWithFormat:@"%@/bot%d.png", |
283be2ca54a7
mad several updates to the resource copying phase in the ios project file, changed paths of some images and added some smaller forts version
koda
parents:
5208
diff
changeset
|
272 |
[[NSBundle mainBundle] resourcePath], |
283be2ca54a7
mad several updates to the resource copying phase in the ios project file, changed paths of some images and added some smaller forts version
koda
parents:
5208
diff
changeset
|
273 |
[[[[teamDictionary objectForKey:@"hedgehogs"] |
283be2ca54a7
mad several updates to the resource copying phase in the ios project file, changed paths of some images and added some smaller forts version
koda
parents:
5208
diff
changeset
|
274 |
objectAtIndex:0] objectForKey:@"level"] |
283be2ca54a7
mad several updates to the resource copying phase in the ios project file, changed paths of some images and added some smaller forts version
koda
parents:
5208
diff
changeset
|
275 |
intValue]]]; |
283be2ca54a7
mad several updates to the resource copying phase in the ios project file, changed paths of some images and added some smaller forts version
koda
parents:
5208
diff
changeset
|
276 |
cell.imageView.image = accessoryImage; |
3547 | 277 |
[accessoryImage release]; |
278 |
break; |
|
279 |
default: |
|
280 |
cell.imageView.image = nil; |
|
281 |
break; |
|
282 |
} |
|
283 |
break; |
|
284 |
} |
|
3697 | 285 |
|
3547 | 286 |
return cell; |
287 |
} |
|
288 |
||
289 |
||
290 |
#pragma mark - |
|
291 |
#pragma mark Table view delegate |
|
292 |
-(void) tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { |
|
293 |
NSInteger row = [indexPath row]; |
|
294 |
NSInteger section = [indexPath section]; |
|
3697 | 295 |
|
3547 | 296 |
if (2 == section) { |
297 |
switch (row) { |
|
298 |
case 0: // grave |
|
299 |
if (nil == gravesViewController) |
|
300 |
gravesViewController = [[GravesViewController alloc] initWithStyle:UITableViewStyleGrouped]; |
|
3924 | 301 |
|
302 |
[gravesViewController setTeamDictionary:teamDictionary]; |
|
303 |
[self.navigationController pushViewController:gravesViewController animated:YES]; |
|
3547 | 304 |
break; |
305 |
case 1: // voice |
|
306 |
if (nil == voicesViewController) |
|
307 |
voicesViewController = [[VoicesViewController alloc] initWithStyle:UITableViewStyleGrouped]; |
|
3924 | 308 |
|
309 |
[voicesViewController setTeamDictionary:teamDictionary]; |
|
310 |
[self.navigationController pushViewController:voicesViewController animated:YES]; |
|
3547 | 311 |
break; |
312 |
case 2: // fort |
|
313 |
if (nil == fortsViewController) |
|
314 |
fortsViewController = [[FortsViewController alloc] initWithStyle:UITableViewStyleGrouped]; |
|
3924 | 315 |
|
316 |
[fortsViewController setTeamDictionary:teamDictionary]; |
|
317 |
[self.navigationController pushViewController:fortsViewController animated:YES]; |
|
3547 | 318 |
break; |
319 |
case 3: // flag |
|
3697 | 320 |
if (nil == flagsViewController) |
3547 | 321 |
flagsViewController = [[FlagsViewController alloc] initWithStyle:UITableViewStyleGrouped]; |
3924 | 322 |
|
323 |
[flagsViewController setTeamDictionary:teamDictionary]; |
|
324 |
[self.navigationController pushViewController:flagsViewController animated:YES]; |
|
3547 | 325 |
break; |
326 |
case 4: // level |
|
327 |
if (nil == levelViewController) |
|
328 |
levelViewController = [[LevelViewController alloc] initWithStyle:UITableViewStyleGrouped]; |
|
3924 | 329 |
|
330 |
[levelViewController setTeamDictionary:teamDictionary]; |
|
331 |
[self.navigationController pushViewController:levelViewController animated:YES]; |
|
332 |
break; |
|
333 |
default: |
|
334 |
DLog(@"Nope"); |
|
3547 | 335 |
break; |
336 |
} |
|
337 |
} else { |
|
3660 | 338 |
EditableCellView *cell = (EditableCellView *)[aTableView cellForRowAtIndexPath:indexPath]; |
339 |
[cell replyKeyboard]; |
|
3547 | 340 |
[aTableView deselectRowAtIndexPath:indexPath animated:NO]; |
341 |
} |
|
342 |
||
343 |
} |
|
344 |
||
345 |
// action to perform when you want to change a hog hat |
|
3660 | 346 |
-(void) tableView:(UITableView *)aTableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath { |
3662
a44406f4369b
polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents:
3660
diff
changeset
|
347 |
if (nil == hogHatViewController) |
3547 | 348 |
hogHatViewController = [[HogHatViewController alloc] initWithStyle:UITableViewStyleGrouped]; |
3697 | 349 |
|
3547 | 350 |
// cache the dictionary file of the team, so that other controllers can modify it |
351 |
hogHatViewController.teamDictionary = self.teamDictionary; |
|
352 |
hogHatViewController.selectedHog = [indexPath row]; |
|
3697 | 353 |
|
3660 | 354 |
// if we are editing the field undo any change before proceeding |
355 |
EditableCellView *cell = (EditableCellView *)[aTableView cellForRowAtIndexPath:indexPath]; |
|
356 |
[cell cancel:nil]; |
|
3697 | 357 |
|
3547 | 358 |
[self.navigationController pushViewController:hogHatViewController animated:YES]; |
359 |
} |
|
360 |
||
361 |
||
362 |
#pragma mark - |
|
363 |
#pragma mark Memory management |
|
364 |
-(void) didReceiveMemoryWarning { |
|
365 |
[super didReceiveMemoryWarning]; |
|
366 |
if (hogHatViewController.view.superview == nil) |
|
367 |
hogHatViewController = nil; |
|
368 |
if (gravesViewController.view.superview == nil) |
|
369 |
gravesViewController = nil; |
|
370 |
if (voicesViewController.view.superview == nil) |
|
371 |
voicesViewController = nil; |
|
372 |
if (fortsViewController.view.superview == nil) |
|
373 |
fortsViewController = nil; |
|
374 |
if (flagsViewController.view.superview == nil) |
|
375 |
flagsViewController = nil; |
|
376 |
if (levelViewController.view.superview == nil) |
|
377 |
levelViewController = nil; |
|
3660 | 378 |
MSG_MEMCLEAN(); |
3547 | 379 |
} |
380 |
||
381 |
-(void) viewDidUnload { |
|
3783 | 382 |
[[NSNotificationCenter defaultCenter] removeObserver:self]; |
3547 | 383 |
self.teamDictionary = nil; |
384 |
self.teamName = nil; |
|
385 |
self.normalHogSprite = nil; |
|
386 |
self.secondaryItems = nil; |
|
3816 | 387 |
self.moreSecondaryItems = nil; |
3547 | 388 |
hogHatViewController = nil; |
3662
a44406f4369b
polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents:
3660
diff
changeset
|
389 |
gravesViewController = nil; |
a44406f4369b
polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents:
3660
diff
changeset
|
390 |
voicesViewController = nil; |
3547 | 391 |
flagsViewController = nil; |
392 |
fortsViewController = nil; |
|
393 |
levelViewController = nil; |
|
3662
a44406f4369b
polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents:
3660
diff
changeset
|
394 |
MSG_DIDUNLOAD(); |
3547 | 395 |
[super viewDidUnload]; |
396 |
} |
|
397 |
||
398 |
-(void) dealloc { |
|
5208 | 399 |
releaseAndNil(teamDictionary); |
400 |
releaseAndNil(teamName); |
|
401 |
releaseAndNil(normalHogSprite); |
|
402 |
releaseAndNil(secondaryItems); |
|
403 |
releaseAndNil(moreSecondaryItems); |
|
404 |
releaseAndNil(hogHatViewController); |
|
405 |
releaseAndNil(gravesViewController); |
|
406 |
releaseAndNil(fortsViewController); |
|
407 |
releaseAndNil(voicesViewController); |
|
408 |
releaseAndNil(flagsViewController); |
|
409 |
releaseAndNil(levelViewController); |
|
3547 | 410 |
[super dealloc]; |
411 |
} |
|
412 |
||
413 |
||
414 |
@end |
|
415 |