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