author | koda |
Thu, 30 Sep 2010 22:31:38 +0200 | |
changeset 3920 | a54ca6185307 |
parent 3912 | e11df2de6af2 |
child 3926 | 668b71f31e51 |
permissions | -rw-r--r-- |
3829 | 1 |
/* |
2 |
* Hedgewars-iOS, a Hedgewars port for iOS devices |
|
3 |
* Copyright (c) 2009-2010 Vittorio Giovara <vittorio.giovara@gmail.com> |
|
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" |
|
23 |
#import "PascalImports.h" |
|
24 |
#import "CommodityFunctions.h" |
|
25 |
#import "UIImageExtra.h" |
|
26 |
||
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
27 |
#define scIndex self.segmentedControl.selectedSegmentIndex |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
28 |
#define isRandomness() (segmentedControl.selectedSegmentIndex == 0 || segmentedControl.selectedSegmentIndex == 2) |
3547 | 29 |
|
30 |
@implementation MapConfigViewController |
|
3642 | 31 |
@synthesize previewButton, maxHogs, seedCommand, templateFilterCommand, mapGenCommand, mazeSizeCommand, themeCommand, staticMapCommand, |
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
32 |
missionCommand, tableView, maxLabel, sizeLabel, segmentedControl, slider, lastIndexPath, dataSourceArray, busy, delegate; |
3547 | 33 |
|
34 |
||
35 |
-(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { |
|
36 |
return rotationManager(interfaceOrientation); |
|
37 |
} |
|
38 |
||
3783 | 39 |
-(IBAction) mapButtonPressed { |
40 |
playSound(@"clickSound"); |
|
41 |
[self updatePreview]; |
|
42 |
} |
|
43 |
||
44 |
-(void) updatePreview { |
|
3547 | 45 |
// don't generate a new preview while it's already generating one |
46 |
if (busy) |
|
47 |
return; |
|
3697 | 48 |
|
3547 | 49 |
// generate a seed |
50 |
CFUUIDRef uuid = CFUUIDCreate(kCFAllocatorDefault); |
|
51 |
NSString *seed = (NSString *)CFUUIDCreateString(kCFAllocatorDefault, uuid); |
|
52 |
CFRelease(uuid); |
|
53 |
NSString *seedCmd = [[NSString alloc] initWithFormat:@"eseed {%@}", seed]; |
|
54 |
self.seedCommand = seedCmd; |
|
55 |
[seedCmd release]; |
|
3697 | 56 |
|
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
57 |
NSArray *source = [self.dataSourceArray objectAtIndex:scIndex]; |
3547 | 58 |
NSIndexPath *theIndex; |
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
59 |
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
|
60 |
// 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
|
61 |
[self turnOffWidgets]; |
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
62 |
[self.previewButton updatePreviewWithSeed:seed]; |
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
63 |
theIndex = [NSIndexPath indexPathForRow:(random()%[source count]) inSection:0]; |
3547 | 64 |
} else { |
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
65 |
theIndex = [NSIndexPath indexPathForRow:(random()%[source count]) inSection:0]; |
3910
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
66 |
// the preview for static maps is loaded in didSelectRowAtIndexPath |
3547 | 67 |
} |
3910
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
68 |
[seed release]; |
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
69 |
|
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
70 |
// perform as if user clicked on an entry |
3547 | 71 |
[self tableView:self.tableView didSelectRowAtIndexPath:theIndex]; |
72 |
[self.tableView scrollToRowAtIndexPath:theIndex atScrollPosition:UITableViewScrollPositionNone animated:YES]; |
|
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 |
|
3792 | 125 |
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) |
3703
12d17c6e8855
halfway-through finishing the frontend with new graphics by Tiy + initial 'About' page set up
koda
parents:
3697
diff
changeset
|
126 |
cell.textLabel.textColor = UICOLOR_HW_YELLOW_TEXT; |
3697 | 127 |
|
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
128 |
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
|
129 |
|
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
130 |
NSString *labelString = [source objectAtIndex:row]; |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
131 |
cell.textLabel.text = labelString; |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
132 |
|
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
133 |
if (isRandomness()) { |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
134 |
UIImage *image = [[UIImage alloc] initWithContentsOfFile:[NSString stringWithFormat:@"%@/%@/icon.png",THEMES_DIRECTORY(),labelString]]; |
3547 | 135 |
cell.imageView.image = image; |
136 |
[image release]; |
|
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
137 |
} else |
3547 | 138 |
cell.imageView.image = nil; |
3697 | 139 |
|
3703
12d17c6e8855
halfway-through finishing the frontend with new graphics by Tiy + initial 'About' page set up
koda
parents:
3697
diff
changeset
|
140 |
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
|
141 |
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
|
142 |
cell.accessoryView = checkbox; |
12d17c6e8855
halfway-through finishing the frontend with new graphics by Tiy + initial 'About' page set up
koda
parents:
3697
diff
changeset
|
143 |
[checkbox release]; |
12d17c6e8855
halfway-through finishing the frontend with new graphics by Tiy + initial 'About' page set up
koda
parents:
3697
diff
changeset
|
144 |
} else |
12d17c6e8855
halfway-through finishing the frontend with new graphics by Tiy + initial 'About' page set up
koda
parents:
3697
diff
changeset
|
145 |
cell.accessoryView = nil; |
3547 | 146 |
|
3703
12d17c6e8855
halfway-through finishing the frontend with new graphics by Tiy + initial 'About' page set up
koda
parents:
3697
diff
changeset
|
147 |
cell.backgroundColor = [UIColor blackColor]; |
3547 | 148 |
return cell; |
149 |
} |
|
150 |
||
3910
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
151 |
// 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
|
152 |
-(void) setDetailsForStaticMap:(NSInteger) index { |
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
153 |
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
|
154 |
|
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
155 |
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
|
156 |
(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
|
157 |
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
|
158 |
[fileCfg release]; |
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
159 |
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
|
160 |
[contents release]; |
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
161 |
|
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
162 |
// 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
|
163 |
// 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
|
164 |
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
|
165 |
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
|
166 |
else |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
167 |
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
|
168 |
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
|
169 |
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
|
170 |
[max release]; |
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
171 |
|
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
172 |
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
|
173 |
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
|
174 |
|
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
175 |
if (scIndex != 3) |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
176 |
self.missionCommand = @""; |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
177 |
else |
3920
a54ca6185307
updated lua loading in the ifrontend and also fixed masked maps
koda
parents:
3912
diff
changeset
|
178 |
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
|
179 |
} |
3547 | 180 |
|
181 |
#pragma mark - |
|
182 |
#pragma mark Table view delegate |
|
183 |
-(void) tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { |
|
184 |
int newRow = [indexPath row]; |
|
185 |
int oldRow = (lastIndexPath != nil) ? [lastIndexPath row] : -1; |
|
3697 | 186 |
|
3547 | 187 |
if (newRow != oldRow) { |
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
188 |
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
|
189 |
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
|
190 |
// 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
|
191 |
self.themeCommand = [NSString stringWithFormat:@"etheme %@", [source objectAtIndex:newRow]]; |
3642 | 192 |
} else { |
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
193 |
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
|
194 |
(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
|
195 |
[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
|
196 |
[self setDetailsForStaticMap:newRow]; |
3642 | 197 |
} |
3697 | 198 |
|
199 |
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
|
200 |
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
|
201 |
newCell.accessoryView = checkbox; |
12d17c6e8855
halfway-through finishing the frontend with new graphics by Tiy + initial 'About' page set up
koda
parents:
3697
diff
changeset
|
202 |
[checkbox release]; |
3547 | 203 |
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
|
204 |
oldCell.accessoryView = nil; |
3547 | 205 |
|
206 |
self.lastIndexPath = indexPath; |
|
207 |
[aTableView selectRowAtIndexPath:indexPath animated:YES scrollPosition:UITableViewScrollPositionNone]; |
|
208 |
} |
|
209 |
[aTableView deselectRowAtIndexPath:indexPath animated:YES]; |
|
210 |
} |
|
211 |
||
212 |
#pragma mark - |
|
213 |
#pragma mark slider & segmentedControl |
|
214 |
// this updates the label and the command keys when the slider is moved, depending of the selection in segmentedControl |
|
215 |
// no methods are called by this routine and you can pass nil to it |
|
216 |
-(IBAction) sliderChanged:(id) sender { |
|
217 |
NSString *labelText; |
|
218 |
NSString *templateCommand; |
|
219 |
NSString *mazeCommand; |
|
3697 | 220 |
|
3547 | 221 |
switch ((int)(self.slider.value*100)) { |
222 |
case 0: |
|
223 |
if (self.segmentedControl.selectedSegmentIndex == 0) { |
|
224 |
labelText = NSLocalizedString(@"Wacky",@""); |
|
225 |
} else { |
|
226 |
labelText = NSLocalizedString(@"Large Floating Islands",@""); |
|
227 |
} |
|
228 |
templateCommand = @"e$template_filter 5"; |
|
229 |
mazeCommand = @"e$maze_size 5"; |
|
230 |
break; |
|
231 |
case 1: |
|
232 |
if (self.segmentedControl.selectedSegmentIndex == 0) { |
|
233 |
labelText = NSLocalizedString(@"Cavern",@""); |
|
234 |
} else { |
|
235 |
labelText = NSLocalizedString(@"Medium Floating Islands",@""); |
|
236 |
} |
|
237 |
templateCommand = @"e$template_filter 4"; |
|
238 |
mazeCommand = @"e$maze_size 4"; |
|
239 |
break; |
|
240 |
case 2: |
|
241 |
if (self.segmentedControl.selectedSegmentIndex == 0) { |
|
242 |
labelText = NSLocalizedString(@"Small",@""); |
|
243 |
} else { |
|
244 |
labelText = NSLocalizedString(@"Small Floating Islands",@""); |
|
245 |
} |
|
246 |
templateCommand = @"e$template_filter 1"; |
|
247 |
mazeCommand = @"e$maze_size 3"; |
|
248 |
break; |
|
249 |
case 3: |
|
250 |
if (self.segmentedControl.selectedSegmentIndex == 0) { |
|
251 |
labelText = NSLocalizedString(@"Medium",@""); |
|
252 |
} else { |
|
253 |
labelText = NSLocalizedString(@"Large Tunnels",@""); |
|
254 |
} |
|
255 |
templateCommand = @"e$template_filter 2"; |
|
256 |
mazeCommand = @"e$maze_size 2"; |
|
257 |
break; |
|
258 |
case 4: |
|
259 |
if (self.segmentedControl.selectedSegmentIndex == 0) { |
|
260 |
labelText = NSLocalizedString(@"Large",@""); |
|
261 |
} else { |
|
262 |
labelText = NSLocalizedString(@"Medium Tunnels",@""); |
|
263 |
} |
|
264 |
templateCommand = @"e$template_filter 3"; |
|
265 |
mazeCommand = @"e$maze_size 1"; |
|
266 |
break; |
|
267 |
case 5: |
|
268 |
if (self.segmentedControl.selectedSegmentIndex == 0) { |
|
269 |
labelText = NSLocalizedString(@"All",@""); |
|
270 |
} else { |
|
271 |
labelText = NSLocalizedString(@"Small Tunnels",@""); |
|
272 |
} |
|
273 |
templateCommand = @"e$template_filter 0"; |
|
274 |
mazeCommand = @"e$maze_size 0"; |
|
275 |
break; |
|
276 |
default: |
|
277 |
labelText = nil; |
|
278 |
templateCommand = nil; |
|
279 |
mazeCommand = nil; |
|
280 |
break; |
|
281 |
} |
|
3697 | 282 |
|
3547 | 283 |
self.sizeLabel.text = labelText; |
284 |
self.templateFilterCommand = templateCommand; |
|
285 |
self.mazeSizeCommand = mazeCommand; |
|
286 |
} |
|
287 |
||
288 |
// update preview (if not busy and if its value really changed) as soon as the user lifts its finger up |
|
289 |
-(IBAction) sliderEndedChanging:(id) sender { |
|
290 |
int num = (int) (self.slider.value * 100); |
|
291 |
if (oldValue != num) { |
|
292 |
[self updatePreview]; |
|
293 |
oldValue = num; |
|
294 |
} |
|
3783 | 295 |
playSound(@"clickSound"); |
3547 | 296 |
} |
297 |
||
3697 | 298 |
// perform actions based on the activated section, then call updatePreview to visually update the selection |
3547 | 299 |
// and if necessary update the table with a slide animation |
300 |
-(IBAction) segmentedControlChanged:(id) sender { |
|
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
301 |
NSString *mapgen, *staticmap, *mission; |
3547 | 302 |
NSInteger newPage = self.segmentedControl.selectedSegmentIndex; |
3697 | 303 |
|
3783 | 304 |
playSound(@"selSound"); |
3547 | 305 |
switch (newPage) { |
306 |
case 0: // Random |
|
307 |
mapgen = @"e$mapgen 0"; |
|
3642 | 308 |
staticmap = @""; |
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
309 |
mission = @""; |
3547 | 310 |
[self sliderChanged:nil]; |
311 |
self.slider.enabled = YES; |
|
312 |
break; |
|
3697 | 313 |
|
3547 | 314 |
case 1: // Map |
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
315 |
case 3: // Mission |
3547 | 316 |
mapgen = @"e$mapgen 0"; |
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
317 |
// dummy values, these are set by -updatePreview -> -didSelectRowAtIndexPath -> -setDetailsForStaticMap |
3642 | 318 |
staticmap = @"map Bamboo"; |
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
319 |
mission = @""; |
3547 | 320 |
self.slider.enabled = NO; |
3791
98072b3871c1
help page for ingame, some other fixes here and there
koda
parents:
3789
diff
changeset
|
321 |
self.sizeLabel.text = NSLocalizedString(@"No filter",@""); |
3547 | 322 |
break; |
3697 | 323 |
|
3547 | 324 |
case 2: // Maze |
325 |
mapgen = @"e$mapgen 1"; |
|
3642 | 326 |
staticmap = @""; |
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
327 |
mission = @""; |
3547 | 328 |
[self sliderChanged:nil]; |
329 |
self.slider.enabled = YES; |
|
330 |
break; |
|
3697 | 331 |
|
3547 | 332 |
default: |
333 |
mapgen = nil; |
|
3642 | 334 |
staticmap = nil; |
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
335 |
mission = nil; |
3547 | 336 |
break; |
337 |
} |
|
338 |
self.mapGenCommand = mapgen; |
|
3642 | 339 |
self.staticMapCommand = staticmap; |
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
340 |
self.missionCommand = mission; |
3697 | 341 |
|
3547 | 342 |
// nice animation for updating the table when appropriate (on iphone) |
343 |
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) |
|
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
344 |
if (((oldPage == 0 || oldPage == 2) && (newPage == 1 || newPage == 3)) || |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
345 |
((oldPage == 1 || oldPage == 3) && (newPage == 0 || newPage == 2)) || |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
346 |
((oldPage == 1 && newPage == 3) || (oldPage == 3 || newPage == 1))) { |
3547 | 347 |
self.tableView.frame = CGRectMake(480, 0, 185, 276); |
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
348 |
[UIView beginAnimations:@"moving in table" context:NULL]; |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
349 |
self.tableView.frame = CGRectMake(295, 0, 185, 276); |
3547 | 350 |
[UIView commitAnimations]; |
351 |
} |
|
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
352 |
|
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
353 |
[self.tableView reloadData]; |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
354 |
[self updatePreview]; |
3547 | 355 |
oldPage = newPage; |
356 |
} |
|
357 |
||
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
358 |
#pragma mark - |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
359 |
#pragma mark delegate functions for iPad |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
360 |
-(IBAction) buttonPressed:(id) sender { |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
361 |
if (self.delegate != nil && [delegate respondsToSelector:@selector(buttonPressed:)]) |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
362 |
[self.delegate buttonPressed:(UIButton *)sender]; |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
363 |
} |
3697 | 364 |
|
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
365 |
-(void) loadDataSourceArray { |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
366 |
// themes.cfg contains all the user-selectable themes |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
367 |
NSString *string = [[NSString alloc] initWithContentsOfFile:[THEMES_DIRECTORY() stringByAppendingString:@"/themes.cfg"] |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
368 |
encoding:NSUTF8StringEncoding |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
369 |
error:NULL]; |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
370 |
NSMutableArray *themeArray = [[NSMutableArray alloc] initWithArray:[string componentsSeparatedByString:@"\n"]]; |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
371 |
[string release]; |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
372 |
// remove a trailing "" element |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
373 |
[themeArray removeLastObject]; |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
374 |
NSArray *mapArray = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:MAPS_DIRECTORY() error:NULL]; |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
375 |
NSArray *missionArray = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:MISSIONS_DIRECTORY() error:NULL]; |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
376 |
|
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
377 |
NSArray *array = [[NSArray alloc] initWithObjects:themeArray,mapArray,themeArray,missionArray,nil]; |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
378 |
self.dataSourceArray = array; |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
379 |
[array release]; |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
380 |
[themeArray release]; |
3547 | 381 |
} |
382 |
||
383 |
#pragma mark - |
|
384 |
#pragma mark view management |
|
385 |
-(void) viewDidLoad { |
|
386 |
[super viewDidLoad]; |
|
3697 | 387 |
|
3547 | 388 |
srandom(time(NULL)); |
3697 | 389 |
|
3547 | 390 |
CGSize screenSize = [[UIScreen mainScreen] bounds].size; |
391 |
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
|
392 |
|
3547 | 393 |
// initialize some "default" values |
394 |
self.sizeLabel.text = NSLocalizedString(@"All",@""); |
|
395 |
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
|
396 |
oldValue = 5; |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
397 |
|
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
398 |
busy = NO; |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
399 |
[self loadDataSourceArray]; |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
400 |
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
|
401 |
|
3789
c3eb56754e92
added a smaller version of forts, fixed a couple of regressions
koda
parents:
3783
diff
changeset
|
402 |
// 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
|
403 |
oldPage = 1; |
3791
98072b3871c1
help page for ingame, some other fixes here and there
koda
parents:
3789
diff
changeset
|
404 |
if (self.segmentedControl.selectedSegmentIndex == 1) { |
98072b3871c1
help page for ingame, some other fixes here and there
koda
parents:
3789
diff
changeset
|
405 |
self.slider.enabled = NO; |
98072b3871c1
help page for ingame, some other fixes here and there
koda
parents:
3789
diff
changeset
|
406 |
self.sizeLabel.text = NSLocalizedString(@"No filter",@""); |
98072b3871c1
help page for ingame, some other fixes here and there
koda
parents:
3789
diff
changeset
|
407 |
} |
3547 | 408 |
|
409 |
self.templateFilterCommand = @"e$template_filter 0"; |
|
410 |
self.mazeSizeCommand = @"e$maze_size 0"; |
|
411 |
self.mapGenCommand = @"e$mapgen 0"; |
|
3642 | 412 |
self.staticMapCommand = @""; |
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
413 |
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
|
414 |
|
3703
12d17c6e8855
halfway-through finishing the frontend with new graphics by Tiy + initial 'About' page set up
koda
parents:
3697
diff
changeset
|
415 |
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { |
12d17c6e8855
halfway-through finishing the frontend with new graphics by Tiy + initial 'About' page set up
koda
parents:
3697
diff
changeset
|
416 |
[self.tableView setBackgroundView:nil]; |
12d17c6e8855
halfway-through finishing the frontend with new graphics by Tiy + initial 'About' page set up
koda
parents:
3697
diff
changeset
|
417 |
self.view.backgroundColor = [UIColor clearColor]; |
12d17c6e8855
halfway-through finishing the frontend with new graphics by Tiy + initial 'About' page set up
koda
parents:
3697
diff
changeset
|
418 |
self.tableView.separatorColor = UICOLOR_HW_YELLOW_BODER; |
12d17c6e8855
halfway-through finishing the frontend with new graphics by Tiy + initial 'About' page set up
koda
parents:
3697
diff
changeset
|
419 |
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone; |
12d17c6e8855
halfway-through finishing the frontend with new graphics by Tiy + initial 'About' page set up
koda
parents:
3697
diff
changeset
|
420 |
self.tableView.rowHeight = 45; |
12d17c6e8855
halfway-through finishing the frontend with new graphics by Tiy + initial 'About' page set up
koda
parents:
3697
diff
changeset
|
421 |
} |
3547 | 422 |
} |
423 |
||
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
424 |
-(void) viewWillAppear:(BOOL)animated { |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
425 |
if (self.dataSourceArray == nil) |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
426 |
[self loadDataSourceArray]; |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
427 |
[super viewWillAppear:animated]; |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
428 |
} |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
429 |
|
3547 | 430 |
-(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
|
431 |
[self updatePreview]; |
3547 | 432 |
[super viewDidAppear:animated]; |
433 |
} |
|
434 |
||
435 |
-(void) viewDidUnload { |
|
3705 | 436 |
self.delegate = nil; |
437 |
||
3547 | 438 |
self.previewButton = nil; |
439 |
self.seedCommand = nil; |
|
440 |
self.templateFilterCommand = nil; |
|
441 |
self.mapGenCommand = nil; |
|
442 |
self.mazeSizeCommand = nil; |
|
443 |
self.themeCommand = nil; |
|
3642 | 444 |
self.staticMapCommand = nil; |
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
445 |
self.missionCommand = nil; |
3697 | 446 |
|
3547 | 447 |
self.previewButton = nil; |
448 |
self.tableView = nil; |
|
449 |
self.maxLabel = nil; |
|
450 |
self.sizeLabel = nil; |
|
451 |
self.segmentedControl = nil; |
|
452 |
self.slider = nil; |
|
3697 | 453 |
|
3547 | 454 |
self.lastIndexPath = nil; |
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
455 |
self.dataSourceArray = nil; |
3697 | 456 |
|
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
|
457 |
MSG_DIDUNLOAD(); |
3547 | 458 |
[super viewDidUnload]; |
459 |
} |
|
460 |
||
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
461 |
-(void) didReceiveMemoryWarning { |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
462 |
[super didReceiveMemoryWarning]; |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
463 |
self.dataSourceArray = nil; |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
464 |
// maybe we can save some more |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
465 |
MSG_MEMCLEAN(); |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
466 |
} |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
467 |
|
3547 | 468 |
-(void) dealloc { |
3705 | 469 |
self.delegate = nil; |
470 |
||
3547 | 471 |
[seedCommand release]; |
472 |
[templateFilterCommand release]; |
|
473 |
[mapGenCommand release]; |
|
474 |
[mazeSizeCommand release]; |
|
475 |
[themeCommand release]; |
|
3642 | 476 |
[staticMapCommand release]; |
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
477 |
[missionCommand release]; |
3697 | 478 |
|
3547 | 479 |
[previewButton release]; |
480 |
[tableView release]; |
|
481 |
[maxLabel release]; |
|
482 |
[sizeLabel release]; |
|
483 |
[segmentedControl release]; |
|
484 |
[slider release]; |
|
3697 | 485 |
|
3547 | 486 |
[lastIndexPath release]; |
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
487 |
[dataSourceArray release]; |
3697 | 488 |
|
3547 | 489 |
[super dealloc]; |
490 |
} |
|
491 |
||
492 |
@end |