author | koda |
Sun, 09 Oct 2011 03:04:45 +0200 | |
changeset 6109 | f6726ec81e64 |
parent 6108 | 7a8da11a6144 |
child 6115 | 485cfecadc9a |
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 22/04/2010. |
|
19 |
*/ |
|
20 |
||
3547 | 21 |
|
22 |
#import "MapConfigViewController.h" |
|
6108 | 23 |
#import <QuartzCore/QuartzCore.h> |
4349 | 24 |
#import "SchemeWeaponConfigViewController.h" |
4362
8dae325dc625
added missing graphics and fixed some glitches/crashes/bugs
koda
parents:
4356
diff
changeset
|
25 |
#import "GameConfigViewController.h" |
3547 | 26 |
|
6078
8c0cc07731e5
headers cleanup, converted some function-only sources into proper class method files, more use of OOP power, removed some 'respondsToSelector' calls, moved defines into their own header, more use of objc categories
koda
parents:
6000
diff
changeset
|
27 |
|
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
28 |
#define scIndex self.segmentedControl.selectedSegmentIndex |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
29 |
#define isRandomness() (segmentedControl.selectedSegmentIndex == 0 || segmentedControl.selectedSegmentIndex == 2) |
3547 | 30 |
|
31 |
@implementation MapConfigViewController |
|
3642 | 32 |
@synthesize previewButton, maxHogs, seedCommand, templateFilterCommand, mapGenCommand, mazeSizeCommand, themeCommand, staticMapCommand, |
4362
8dae325dc625
added missing graphics and fixed some glitches/crashes/bugs
koda
parents:
4356
diff
changeset
|
33 |
missionCommand, tableView, maxLabel, sizeLabel, segmentedControl, slider, lastIndexPath, dataSourceArray, busy, |
8dae325dc625
added missing graphics and fixed some glitches/crashes/bugs
koda
parents:
4356
diff
changeset
|
34 |
externalController, parentController; |
3547 | 35 |
|
36 |
||
37 |
-(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { |
|
38 |
return rotationManager(interfaceOrientation); |
|
39 |
} |
|
40 |
||
6109
f6726ec81e64
finally removed the white border glitch of the ipad preview map, moved initialization from IB to code
koda
parents:
6108
diff
changeset
|
41 |
-(IBAction) mapButtonPressed:(id) sender { |
6000
dbcebcd3d79f
ios frontend: sounds and music have their own class now (with caching\!) instead of being spread here and there (exploiting class methods like a true oop pro)
koda
parents:
5483
diff
changeset
|
42 |
[AudioManagerController playClickSound]; |
3783 | 43 |
[self updatePreview]; |
44 |
} |
|
45 |
||
46 |
-(void) updatePreview { |
|
3547 | 47 |
// don't generate a new preview while it's already generating one |
48 |
if (busy) |
|
49 |
return; |
|
3697 | 50 |
|
3547 | 51 |
// generate a seed |
52 |
CFUUIDRef uuid = CFUUIDCreate(kCFAllocatorDefault); |
|
53 |
NSString *seed = (NSString *)CFUUIDCreateString(kCFAllocatorDefault, uuid); |
|
54 |
CFRelease(uuid); |
|
55 |
NSString *seedCmd = [[NSString alloc] initWithFormat:@"eseed {%@}", seed]; |
|
56 |
self.seedCommand = seedCmd; |
|
57 |
[seedCmd release]; |
|
3697 | 58 |
|
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
59 |
NSArray *source = [self.dataSourceArray objectAtIndex:scIndex]; |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
60 |
if (isRandomness()) { |
3910
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
61 |
// prevent other events and add an activity while the preview is beign generated |
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
62 |
[self turnOffWidgets]; |
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
63 |
[self.previewButton updatePreviewWithSeed:seed]; |
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
64 |
// the preview for static maps is loaded in didSelectRowAtIndexPath |
3547 | 65 |
} |
3910
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
66 |
[seed release]; |
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
67 |
|
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
68 |
// perform as if user clicked on an entry |
6109
f6726ec81e64
finally removed the white border glitch of the ipad preview map, moved initialization from IB to code
koda
parents:
6108
diff
changeset
|
69 |
NSIndexPath *theIndex = [NSIndexPath indexPathForRow:(random()%[source count]) inSection:0]; |
3547 | 70 |
[self tableView:self.tableView didSelectRowAtIndexPath:theIndex]; |
6078
8c0cc07731e5
headers cleanup, converted some function-only sources into proper class method files, more use of OOP power, removed some 'respondsToSelector' calls, moved defines into their own header, more use of objc categories
koda
parents:
6000
diff
changeset
|
71 |
if (IS_NOT_POWERFUL([HWUtils modelType]) == NO) |
4287 | 72 |
[self.tableView scrollToRowAtIndexPath:theIndex atScrollPosition:UITableViewScrollPositionMiddle animated:YES]; |
3547 | 73 |
} |
74 |
||
75 |
-(void) turnOffWidgets { |
|
76 |
busy = YES; |
|
77 |
self.previewButton.alpha = 0.5f; |
|
78 |
self.previewButton.enabled = NO; |
|
79 |
self.maxLabel.text = @"..."; |
|
80 |
self.segmentedControl.enabled = NO; |
|
81 |
self.slider.enabled = NO; |
|
82 |
} |
|
83 |
||
84 |
-(void) turnOnWidgets { |
|
85 |
self.previewButton.alpha = 1.0f; |
|
86 |
self.previewButton.enabled = YES; |
|
87 |
self.segmentedControl.enabled = YES; |
|
88 |
self.slider.enabled = YES; |
|
89 |
busy = NO; |
|
90 |
} |
|
3697 | 91 |
|
3547 | 92 |
-(void) setLabelText:(NSString *)str { |
3910
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
93 |
self.maxHogs = [str intValue]; |
3547 | 94 |
self.maxLabel.text = str; |
95 |
} |
|
96 |
||
3910
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
97 |
-(NSDictionary *)getDataForEngine { |
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
98 |
NSDictionary *dictForEngine = [NSDictionary dictionaryWithObjectsAndKeys: |
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
99 |
self.seedCommand,@"seedCommand", |
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
100 |
self.templateFilterCommand,@"templateFilterCommand", |
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
101 |
self.mapGenCommand,@"mapGenCommand", |
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
102 |
self.mazeSizeCommand,@"mazeSizeCommand", |
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
103 |
nil]; |
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
104 |
return dictForEngine; |
3547 | 105 |
} |
106 |
||
107 |
#pragma mark - |
|
108 |
#pragma mark Table view data source |
|
109 |
-(NSInteger) numberOfSectionsInTableView:(UITableView *)tableView { |
|
110 |
return 1; |
|
111 |
} |
|
112 |
||
113 |
-(NSInteger) tableView:(UITableView *)aTableView numberOfRowsInSection:(NSInteger) section { |
|
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
114 |
return [[self.dataSourceArray objectAtIndex:scIndex] count]; |
3547 | 115 |
} |
116 |
||
117 |
-(UITableViewCell *)tableView:(UITableView *)aTableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { |
|
118 |
static NSString *CellIdentifier = @"Cell"; |
|
119 |
NSInteger row = [indexPath row]; |
|
3697 | 120 |
|
3547 | 121 |
UITableViewCell *cell = [aTableView dequeueReusableCellWithIdentifier:CellIdentifier]; |
3697 | 122 |
if (cell == nil) |
3547 | 123 |
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; |
3697 | 124 |
|
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
125 |
NSArray *source = [self.dataSourceArray objectAtIndex:scIndex]; |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
126 |
|
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
127 |
NSString *labelString = [source objectAtIndex:row]; |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
128 |
cell.textLabel.text = labelString; |
3996 | 129 |
cell.textLabel.adjustsFontSizeToFitWidth = YES; |
130 |
cell.textLabel.minimumFontSize = 7; |
|
6078
8c0cc07731e5
headers cleanup, converted some function-only sources into proper class method files, more use of OOP power, removed some 'respondsToSelector' calls, moved defines into their own header, more use of objc categories
koda
parents:
6000
diff
changeset
|
131 |
cell.textLabel.textColor = [UIColor lightYellowColor]; |
4476
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4362
diff
changeset
|
132 |
cell.textLabel.backgroundColor = [UIColor clearColor]; |
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
133 |
|
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
134 |
if (isRandomness()) { |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
135 |
UIImage *image = [[UIImage alloc] initWithContentsOfFile:[NSString stringWithFormat:@"%@/%@/icon.png",THEMES_DIRECTORY(),labelString]]; |
3547 | 136 |
cell.imageView.image = image; |
137 |
[image release]; |
|
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
138 |
} else |
3547 | 139 |
cell.imageView.image = nil; |
3697 | 140 |
|
3703
12d17c6e8855
halfway-through finishing the frontend with new graphics by Tiy + initial 'About' page set up
koda
parents:
3697
diff
changeset
|
141 |
if (row == [self.lastIndexPath row]) { |
12d17c6e8855
halfway-through finishing the frontend with new graphics by Tiy + initial 'About' page set up
koda
parents:
3697
diff
changeset
|
142 |
UIImageView *checkbox = [[UIImageView alloc] initWithImage:[UIImage imageWithContentsOfFile:@"checkbox.png"]]; |
12d17c6e8855
halfway-through finishing the frontend with new graphics by Tiy + initial 'About' page set up
koda
parents:
3697
diff
changeset
|
143 |
cell.accessoryView = checkbox; |
12d17c6e8855
halfway-through finishing the frontend with new graphics by Tiy + initial 'About' page set up
koda
parents:
3697
diff
changeset
|
144 |
[checkbox release]; |
12d17c6e8855
halfway-through finishing the frontend with new graphics by Tiy + initial 'About' page set up
koda
parents:
3697
diff
changeset
|
145 |
} else |
12d17c6e8855
halfway-through finishing the frontend with new graphics by Tiy + initial 'About' page set up
koda
parents:
3697
diff
changeset
|
146 |
cell.accessoryView = nil; |
3547 | 147 |
|
6078
8c0cc07731e5
headers cleanup, converted some function-only sources into proper class method files, more use of OOP power, removed some 'respondsToSelector' calls, moved defines into their own header, more use of objc categories
koda
parents:
6000
diff
changeset
|
148 |
cell.backgroundColor = [UIColor blackColorTransparent]; |
3547 | 149 |
return cell; |
150 |
} |
|
151 |
||
3910
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
152 |
// this set details for a static map (called by didSelectRowAtIndexPath) |
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
153 |
-(void) setDetailsForStaticMap:(NSInteger) index { |
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
154 |
NSArray *source = [self.dataSourceArray objectAtIndex:scIndex]; |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
155 |
|
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
156 |
NSString *fileCfg = [[NSString alloc] initWithFormat:@"%@/%@/map.cfg", |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
157 |
(scIndex == 1) ? MAPS_DIRECTORY() : MISSIONS_DIRECTORY(),[source objectAtIndex:index]]; |
3910
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
158 |
NSString *contents = [[NSString alloc] initWithContentsOfFile:fileCfg encoding:NSUTF8StringEncoding error:NULL]; |
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
159 |
[fileCfg release]; |
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
160 |
NSArray *split = [contents componentsSeparatedByString:@"\n"]; |
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
161 |
[contents release]; |
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
162 |
|
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
163 |
// if the number is not set we keep 18 standard; |
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
164 |
// sometimes it's not set but there are trailing characters, we get around them with the second equation |
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
165 |
if ([split count] > 1 && [[split objectAtIndex:1] intValue] > 0) |
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
166 |
maxHogs = [[split objectAtIndex:1] intValue]; |
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
167 |
else |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
168 |
maxHogs = 18; |
3910
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
169 |
NSString *max = [[NSString alloc] initWithFormat:@"%d",maxHogs]; |
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
170 |
self.maxLabel.text = max; |
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
171 |
[max release]; |
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
172 |
|
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
173 |
self.themeCommand = [NSString stringWithFormat:@"etheme %@", [split objectAtIndex:0]]; |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
174 |
self.staticMapCommand = [NSString stringWithFormat:@"emap %@", [source objectAtIndex:index]]; |
3912
e11df2de6af2
have engine try for a second position when map loading fails (in this way it's possible to move Missions data to any path)
koda
parents:
3911
diff
changeset
|
175 |
|
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
176 |
if (scIndex != 3) |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
177 |
self.missionCommand = @""; |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
178 |
else |
3920
a54ca6185307
updated lua loading in the ifrontend and also fixed masked maps
koda
parents:
3912
diff
changeset
|
179 |
self.missionCommand = [NSString stringWithFormat:@"escript Missions/Maps/%@/map.lua",[source objectAtIndex:index]]; |
3910
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
180 |
} |
3547 | 181 |
|
182 |
#pragma mark - |
|
183 |
#pragma mark Table view delegate |
|
184 |
-(void) tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { |
|
185 |
int newRow = [indexPath row]; |
|
186 |
int oldRow = (lastIndexPath != nil) ? [lastIndexPath row] : -1; |
|
3697 | 187 |
|
3547 | 188 |
if (newRow != oldRow) { |
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
189 |
NSArray *source = [self.dataSourceArray objectAtIndex:scIndex]; |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
190 |
if (isRandomness()) { |
3910
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
191 |
// just change the theme, don't update preview |
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
192 |
self.themeCommand = [NSString stringWithFormat:@"etheme %@", [source objectAtIndex:newRow]]; |
3642 | 193 |
} else { |
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
194 |
NSString *fileImage = [NSString stringWithFormat:@"%@/%@/preview.png", |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
195 |
(scIndex == 1) ? MAPS_DIRECTORY() : MISSIONS_DIRECTORY(),[source objectAtIndex:newRow]]; |
3910
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
196 |
[self.previewButton updatePreviewWithFile:fileImage]; |
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
197 |
[self setDetailsForStaticMap:newRow]; |
3642 | 198 |
} |
3697 | 199 |
|
200 |
UITableViewCell *newCell = [aTableView cellForRowAtIndexPath:indexPath]; |
|
3703
12d17c6e8855
halfway-through finishing the frontend with new graphics by Tiy + initial 'About' page set up
koda
parents:
3697
diff
changeset
|
201 |
UIImageView *checkbox = [[UIImageView alloc] initWithImage:[UIImage imageWithContentsOfFile:@"checkbox.png"]]; |
12d17c6e8855
halfway-through finishing the frontend with new graphics by Tiy + initial 'About' page set up
koda
parents:
3697
diff
changeset
|
202 |
newCell.accessoryView = checkbox; |
12d17c6e8855
halfway-through finishing the frontend with new graphics by Tiy + initial 'About' page set up
koda
parents:
3697
diff
changeset
|
203 |
[checkbox release]; |
3547 | 204 |
UITableViewCell *oldCell = [aTableView cellForRowAtIndexPath:self.lastIndexPath]; |
3703
12d17c6e8855
halfway-through finishing the frontend with new graphics by Tiy + initial 'About' page set up
koda
parents:
3697
diff
changeset
|
205 |
oldCell.accessoryView = nil; |
3547 | 206 |
|
207 |
self.lastIndexPath = indexPath; |
|
208 |
[aTableView selectRowAtIndexPath:indexPath animated:YES scrollPosition:UITableViewScrollPositionNone]; |
|
209 |
} |
|
210 |
[aTableView deselectRowAtIndexPath:indexPath animated:YES]; |
|
211 |
} |
|
212 |
||
213 |
#pragma mark - |
|
4082 | 214 |
#pragma mark slider & segmentedControl & button |
3547 | 215 |
// this updates the label and the command keys when the slider is moved, depending of the selection in segmentedControl |
216 |
// no methods are called by this routine and you can pass nil to it |
|
217 |
-(IBAction) sliderChanged:(id) sender { |
|
218 |
NSString *labelText; |
|
219 |
NSString *templateCommand; |
|
220 |
NSString *mazeCommand; |
|
3697 | 221 |
|
3547 | 222 |
switch ((int)(self.slider.value*100)) { |
223 |
case 0: |
|
224 |
if (self.segmentedControl.selectedSegmentIndex == 0) { |
|
225 |
labelText = NSLocalizedString(@"Wacky",@""); |
|
226 |
} else { |
|
227 |
labelText = NSLocalizedString(@"Large Floating Islands",@""); |
|
228 |
} |
|
229 |
templateCommand = @"e$template_filter 5"; |
|
230 |
mazeCommand = @"e$maze_size 5"; |
|
231 |
break; |
|
232 |
case 1: |
|
233 |
if (self.segmentedControl.selectedSegmentIndex == 0) { |
|
234 |
labelText = NSLocalizedString(@"Cavern",@""); |
|
235 |
} else { |
|
236 |
labelText = NSLocalizedString(@"Medium Floating Islands",@""); |
|
237 |
} |
|
238 |
templateCommand = @"e$template_filter 4"; |
|
239 |
mazeCommand = @"e$maze_size 4"; |
|
240 |
break; |
|
241 |
case 2: |
|
242 |
if (self.segmentedControl.selectedSegmentIndex == 0) { |
|
243 |
labelText = NSLocalizedString(@"Small",@""); |
|
244 |
} else { |
|
245 |
labelText = NSLocalizedString(@"Small Floating Islands",@""); |
|
246 |
} |
|
247 |
templateCommand = @"e$template_filter 1"; |
|
248 |
mazeCommand = @"e$maze_size 3"; |
|
249 |
break; |
|
250 |
case 3: |
|
251 |
if (self.segmentedControl.selectedSegmentIndex == 0) { |
|
252 |
labelText = NSLocalizedString(@"Medium",@""); |
|
253 |
} else { |
|
254 |
labelText = NSLocalizedString(@"Large Tunnels",@""); |
|
255 |
} |
|
256 |
templateCommand = @"e$template_filter 2"; |
|
257 |
mazeCommand = @"e$maze_size 2"; |
|
258 |
break; |
|
259 |
case 4: |
|
260 |
if (self.segmentedControl.selectedSegmentIndex == 0) { |
|
261 |
labelText = NSLocalizedString(@"Large",@""); |
|
262 |
} else { |
|
263 |
labelText = NSLocalizedString(@"Medium Tunnels",@""); |
|
264 |
} |
|
265 |
templateCommand = @"e$template_filter 3"; |
|
266 |
mazeCommand = @"e$maze_size 1"; |
|
267 |
break; |
|
268 |
case 5: |
|
269 |
if (self.segmentedControl.selectedSegmentIndex == 0) { |
|
270 |
labelText = NSLocalizedString(@"All",@""); |
|
271 |
} else { |
|
272 |
labelText = NSLocalizedString(@"Small Tunnels",@""); |
|
273 |
} |
|
274 |
templateCommand = @"e$template_filter 0"; |
|
275 |
mazeCommand = @"e$maze_size 0"; |
|
276 |
break; |
|
277 |
default: |
|
278 |
labelText = nil; |
|
279 |
templateCommand = nil; |
|
280 |
mazeCommand = nil; |
|
281 |
break; |
|
282 |
} |
|
3697 | 283 |
|
3547 | 284 |
self.sizeLabel.text = labelText; |
285 |
self.templateFilterCommand = templateCommand; |
|
286 |
self.mazeSizeCommand = mazeCommand; |
|
287 |
} |
|
288 |
||
289 |
// update preview (if not busy and if its value really changed) as soon as the user lifts its finger up |
|
290 |
-(IBAction) sliderEndedChanging:(id) sender { |
|
291 |
int num = (int) (self.slider.value * 100); |
|
292 |
if (oldValue != num) { |
|
293 |
[self updatePreview]; |
|
294 |
oldValue = num; |
|
295 |
} |
|
6000
dbcebcd3d79f
ios frontend: sounds and music have their own class now (with caching\!) instead of being spread here and there (exploiting class methods like a true oop pro)
koda
parents:
5483
diff
changeset
|
296 |
[AudioManagerController playClickSound]; |
3547 | 297 |
} |
298 |
||
3697 | 299 |
// perform actions based on the activated section, then call updatePreview to visually update the selection |
3547 | 300 |
// and if necessary update the table with a slide animation |
301 |
-(IBAction) segmentedControlChanged:(id) sender { |
|
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
302 |
NSString *mapgen, *staticmap, *mission; |
3547 | 303 |
NSInteger newPage = self.segmentedControl.selectedSegmentIndex; |
3697 | 304 |
|
6000
dbcebcd3d79f
ios frontend: sounds and music have their own class now (with caching\!) instead of being spread here and there (exploiting class methods like a true oop pro)
koda
parents:
5483
diff
changeset
|
305 |
[AudioManagerController playSelectSound]; |
3547 | 306 |
switch (newPage) { |
307 |
case 0: // Random |
|
308 |
mapgen = @"e$mapgen 0"; |
|
3642 | 309 |
staticmap = @""; |
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
310 |
mission = @""; |
3547 | 311 |
[self sliderChanged:nil]; |
312 |
self.slider.enabled = YES; |
|
4349 | 313 |
[externalController fillSections]; |
3547 | 314 |
break; |
3697 | 315 |
|
3547 | 316 |
case 1: // Map |
317 |
mapgen = @"e$mapgen 0"; |
|
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
318 |
// dummy values, these are set by -updatePreview -> -didSelectRowAtIndexPath -> -setDetailsForStaticMap |
3642 | 319 |
staticmap = @"map Bamboo"; |
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
320 |
mission = @""; |
3547 | 321 |
self.slider.enabled = NO; |
3791
98072b3871c1
help page for ingame, some other fixes here and there
koda
parents:
3789
diff
changeset
|
322 |
self.sizeLabel.text = NSLocalizedString(@"No filter",@""); |
4349 | 323 |
[externalController fillSections]; |
3547 | 324 |
break; |
3697 | 325 |
|
3547 | 326 |
case 2: // Maze |
327 |
mapgen = @"e$mapgen 1"; |
|
3642 | 328 |
staticmap = @""; |
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
329 |
mission = @""; |
3547 | 330 |
[self sliderChanged:nil]; |
331 |
self.slider.enabled = YES; |
|
4349 | 332 |
[externalController fillSections]; |
333 |
break; |
|
334 |
||
335 |
case 3: // Mission |
|
336 |
mapgen = @"e$mapgen 0"; |
|
337 |
// dummy values, these are set by -updatePreview -> -didSelectRowAtIndexPath -> -setDetailsForStaticMap |
|
338 |
staticmap = @"map Bamboo"; |
|
339 |
mission = @""; |
|
340 |
self.slider.enabled = NO; |
|
341 |
self.sizeLabel.text = NSLocalizedString(@"No filter",@""); |
|
342 |
[externalController emptySections]; |
|
3547 | 343 |
break; |
3697 | 344 |
|
3547 | 345 |
default: |
346 |
mapgen = nil; |
|
3642 | 347 |
staticmap = nil; |
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
348 |
mission = nil; |
3547 | 349 |
break; |
350 |
} |
|
351 |
self.mapGenCommand = mapgen; |
|
3642 | 352 |
self.staticMapCommand = staticmap; |
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
353 |
self.missionCommand = mission; |
3697 | 354 |
|
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
355 |
[self.tableView reloadData]; |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
356 |
[self updatePreview]; |
3547 | 357 |
oldPage = newPage; |
358 |
} |
|
359 |
||
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
360 |
-(IBAction) buttonPressed:(id) sender { |
4362
8dae325dc625
added missing graphics and fixed some glitches/crashes/bugs
koda
parents:
4356
diff
changeset
|
361 |
[self.parentController buttonPressed:sender]; |
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
362 |
} |
3697 | 363 |
|
4082 | 364 |
#pragma mark - |
365 |
#pragma mark view management |
|
6107 | 366 |
-(NSArray *) dataSourceArray { |
367 |
if (dataSourceArray == nil) { |
|
368 |
NSString *model = [HWUtils modelType]; |
|
369 |
||
370 |
// only folders containing icon.png are a valid theme |
|
371 |
NSArray *themeArrayFull = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:THEMES_DIRECTORY() error:NULL]; |
|
372 |
NSMutableArray *themeArray = [[NSMutableArray alloc] init]; |
|
373 |
for (NSString *themeName in themeArrayFull) { |
|
374 |
NSString *checkPath = [[NSString alloc] initWithFormat:@"%@/%@/icon.png",THEMES_DIRECTORY(),themeName]; |
|
375 |
if ([[NSFileManager defaultManager] fileExistsAtPath:checkPath]) |
|
376 |
[themeArray addObject:themeName]; |
|
377 |
[checkPath release]; |
|
378 |
} |
|
379 |
||
380 |
// remove images that are too big for certain devices without loading the whole image |
|
381 |
NSArray *mapArrayFull = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:MAPS_DIRECTORY() error:NULL]; |
|
382 |
NSMutableArray *mapArray = [[NSMutableArray alloc] init]; |
|
383 |
for (NSString *str in mapArrayFull) { |
|
384 |
CGSize imgSize = [UIImage imageSizeFromMetadataOf:[MAPS_DIRECTORY() stringByAppendingFormat:@"%@/map.png",str]]; |
|
385 |
if (IS_NOT_POWERFUL(model) && imgSize.height > 1024.0f) |
|
386 |
continue; |
|
387 |
if (IS_NOT_VERY_POWERFUL(model) && imgSize.height > 1280.0f) |
|
388 |
continue; |
|
389 |
[mapArray addObject:str]; |
|
390 |
} |
|
391 |
||
392 |
NSArray *missionArrayFull = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:MISSIONS_DIRECTORY() error:NULL]; |
|
393 |
NSMutableArray *missionArray = [[NSMutableArray alloc] init]; |
|
394 |
for (NSString *str in missionArrayFull) { |
|
395 |
CGSize imgSize = [UIImage imageSizeFromMetadataOf:[MISSIONS_DIRECTORY() stringByAppendingFormat:@"%@/map.png",str]]; |
|
396 |
if (IS_NOT_POWERFUL(model) && imgSize.height > 1024.0f) |
|
397 |
continue; |
|
398 |
if (IS_NOT_VERY_POWERFUL(model) && imgSize.height > 1280.0f) |
|
399 |
continue; |
|
400 |
[missionArray addObject:str]; |
|
401 |
} |
|
402 |
NSArray *array = [[NSArray alloc] initWithObjects:themeArray,mapArray,themeArray,missionArray,nil]; |
|
403 |
[missionArray release]; |
|
404 |
[themeArray release]; |
|
405 |
[mapArray release]; |
|
406 |
||
407 |
self.dataSourceArray = array; |
|
408 |
[array release]; |
|
5281 | 409 |
} |
6107 | 410 |
return dataSourceArray; |
3547 | 411 |
} |
412 |
||
6109
f6726ec81e64
finally removed the white border glitch of the ipad preview map, moved initialization from IB to code
koda
parents:
6108
diff
changeset
|
413 |
-(MapPreviewButtonView *)previewButton { |
f6726ec81e64
finally removed the white border glitch of the ipad preview map, moved initialization from IB to code
koda
parents:
6108
diff
changeset
|
414 |
if (previewButton == nil) { |
f6726ec81e64
finally removed the white border glitch of the ipad preview map, moved initialization from IB to code
koda
parents:
6108
diff
changeset
|
415 |
MapPreviewButtonView *preview = [[MapPreviewButtonView alloc] initWithFrame:CGRectMake(736, 26, 256, 128)]; |
f6726ec81e64
finally removed the white border glitch of the ipad preview map, moved initialization from IB to code
koda
parents:
6108
diff
changeset
|
416 |
preview.delegate = self; |
f6726ec81e64
finally removed the white border glitch of the ipad preview map, moved initialization from IB to code
koda
parents:
6108
diff
changeset
|
417 |
[preview addTarget:self action:@selector(mapButtonPressed:) forControlEvents:UIControlEventTouchUpInside]; |
f6726ec81e64
finally removed the white border glitch of the ipad preview map, moved initialization from IB to code
koda
parents:
6108
diff
changeset
|
418 |
[self.view addSubview:preview]; |
f6726ec81e64
finally removed the white border glitch of the ipad preview map, moved initialization from IB to code
koda
parents:
6108
diff
changeset
|
419 |
self.previewButton = preview; |
f6726ec81e64
finally removed the white border glitch of the ipad preview map, moved initialization from IB to code
koda
parents:
6108
diff
changeset
|
420 |
[preview release]; |
f6726ec81e64
finally removed the white border glitch of the ipad preview map, moved initialization from IB to code
koda
parents:
6108
diff
changeset
|
421 |
} |
f6726ec81e64
finally removed the white border glitch of the ipad preview map, moved initialization from IB to code
koda
parents:
6108
diff
changeset
|
422 |
return previewButton; |
f6726ec81e64
finally removed the white border glitch of the ipad preview map, moved initialization from IB to code
koda
parents:
6108
diff
changeset
|
423 |
} |
f6726ec81e64
finally removed the white border glitch of the ipad preview map, moved initialization from IB to code
koda
parents:
6108
diff
changeset
|
424 |
|
3547 | 425 |
-(void) viewDidLoad { |
426 |
[super viewDidLoad]; |
|
3697 | 427 |
|
3547 | 428 |
srandom(time(NULL)); |
3697 | 429 |
|
3547 | 430 |
CGSize screenSize = [[UIScreen mainScreen] bounds].size; |
431 |
self.view.frame = CGRectMake(0, 0, screenSize.height, screenSize.width - 44); |
|
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
432 |
|
3547 | 433 |
// initialize some "default" values |
434 |
self.sizeLabel.text = NSLocalizedString(@"All",@""); |
|
435 |
self.slider.value = 0.05f; |
|
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
436 |
oldValue = 5; |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
437 |
|
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
438 |
busy = NO; |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
439 |
self.lastIndexPath = [NSIndexPath indexPathForRow:-1 inSection:0]; |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
440 |
|
3789
c3eb56754e92
added a smaller version of forts, fixed a couple of regressions
koda
parents:
3783
diff
changeset
|
441 |
// select a map at first because it's faster - done in IB |
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
442 |
oldPage = 1; |
3791
98072b3871c1
help page for ingame, some other fixes here and there
koda
parents:
3789
diff
changeset
|
443 |
if (self.segmentedControl.selectedSegmentIndex == 1) { |
98072b3871c1
help page for ingame, some other fixes here and there
koda
parents:
3789
diff
changeset
|
444 |
self.slider.enabled = NO; |
98072b3871c1
help page for ingame, some other fixes here and there
koda
parents:
3789
diff
changeset
|
445 |
self.sizeLabel.text = NSLocalizedString(@"No filter",@""); |
98072b3871c1
help page for ingame, some other fixes here and there
koda
parents:
3789
diff
changeset
|
446 |
} |
3547 | 447 |
|
448 |
self.templateFilterCommand = @"e$template_filter 0"; |
|
449 |
self.mazeSizeCommand = @"e$maze_size 0"; |
|
450 |
self.mapGenCommand = @"e$mapgen 0"; |
|
3642 | 451 |
self.staticMapCommand = @""; |
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
452 |
self.missionCommand = @""; |
3910
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
453 |
|
6108 | 454 |
if (IS_IPAD()) { |
455 |
[self.tableView setBackgroundColorForAnyTable:[UIColor darkBlueColorTransparent]]; |
|
456 |
self.tableView.layer.borderColor = [[UIColor darkYellowColor] CGColor]; |
|
457 |
self.tableView.layer.borderWidth = 2.7f; |
|
458 |
self.tableView.layer.cornerRadius = 8; |
|
459 |
self.tableView.contentInset = UIEdgeInsetsMake(10, 0, 10, 0); |
|
460 |
} |
|
461 |
self.tableView.separatorColor = [UIColor whiteColor]; |
|
4244 | 462 |
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone; |
3547 | 463 |
} |
464 |
||
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
465 |
-(void) viewWillAppear:(BOOL)animated { |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
466 |
[super viewWillAppear:animated]; |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
467 |
} |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
468 |
|
3547 | 469 |
-(void) viewDidAppear:(BOOL) animated { |
3910
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
470 |
[self updatePreview]; |
3547 | 471 |
[super viewDidAppear:animated]; |
472 |
} |
|
473 |
||
474 |
-(void) viewDidUnload { |
|
475 |
self.previewButton = nil; |
|
476 |
self.seedCommand = nil; |
|
477 |
self.templateFilterCommand = nil; |
|
478 |
self.mapGenCommand = nil; |
|
479 |
self.mazeSizeCommand = nil; |
|
480 |
self.themeCommand = nil; |
|
3642 | 481 |
self.staticMapCommand = nil; |
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
482 |
self.missionCommand = nil; |
3697 | 483 |
|
3547 | 484 |
self.previewButton = nil; |
485 |
self.tableView = nil; |
|
486 |
self.maxLabel = nil; |
|
487 |
self.sizeLabel = nil; |
|
488 |
self.segmentedControl = nil; |
|
489 |
self.slider = nil; |
|
3697 | 490 |
|
3547 | 491 |
self.lastIndexPath = nil; |
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
492 |
self.dataSourceArray = nil; |
3697 | 493 |
|
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
|
494 |
MSG_DIDUNLOAD(); |
3547 | 495 |
[super viewDidUnload]; |
496 |
} |
|
497 |
||
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
498 |
-(void) didReceiveMemoryWarning { |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
499 |
self.dataSourceArray = nil; |
6109
f6726ec81e64
finally removed the white border glitch of the ipad preview map, moved initialization from IB to code
koda
parents:
6108
diff
changeset
|
500 |
self.previewButton = nil; |
4356 | 501 |
[super didReceiveMemoryWarning]; |
3984 | 502 |
|
4356 | 503 |
if (self.view.superview == nil) { |
504 |
self.tableView = nil; |
|
505 |
self.maxLabel = nil; |
|
506 |
self.sizeLabel = nil; |
|
507 |
self.slider = nil; |
|
508 |
} |
|
3971 | 509 |
|
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
510 |
MSG_MEMCLEAN(); |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
511 |
} |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
512 |
|
3547 | 513 |
-(void) dealloc { |
5208 | 514 |
releaseAndNil(seedCommand); |
515 |
releaseAndNil(templateFilterCommand); |
|
516 |
releaseAndNil(mapGenCommand); |
|
517 |
releaseAndNil(mazeSizeCommand); |
|
518 |
releaseAndNil(themeCommand); |
|
519 |
releaseAndNil(staticMapCommand); |
|
520 |
releaseAndNil(missionCommand); |
|
3697 | 521 |
|
5208 | 522 |
releaseAndNil(previewButton); |
523 |
releaseAndNil(tableView); |
|
524 |
releaseAndNil(maxLabel); |
|
525 |
releaseAndNil(sizeLabel); |
|
526 |
releaseAndNil(segmentedControl); |
|
527 |
releaseAndNil(slider); |
|
3697 | 528 |
|
5208 | 529 |
releaseAndNil(lastIndexPath); |
530 |
releaseAndNil(dataSourceArray); |
|
3697 | 531 |
|
3547 | 532 |
[super dealloc]; |
533 |
} |
|
534 |
||
535 |
@end |