author | sheepluva |
Wed, 29 Dec 2010 14:59:56 +0100 | |
changeset 4774 | d81c6e14416d |
parent 4505 | 4a8f87eb67cb |
child 4976 | 088d40d8aba2 |
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; |
4476
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4362
diff
changeset
|
142 |
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
|
143 |
|
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
144 |
if (isRandomness()) { |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
145 |
UIImage *image = [[UIImage alloc] initWithContentsOfFile:[NSString stringWithFormat:@"%@/%@/icon.png",THEMES_DIRECTORY(),labelString]]; |
3547 | 146 |
cell.imageView.image = image; |
147 |
[image release]; |
|
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
148 |
} else |
3547 | 149 |
cell.imageView.image = nil; |
3697 | 150 |
|
3703
12d17c6e8855
halfway-through finishing the frontend with new graphics by Tiy + initial 'About' page set up
koda
parents:
3697
diff
changeset
|
151 |
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
|
152 |
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
|
153 |
cell.accessoryView = checkbox; |
12d17c6e8855
halfway-through finishing the frontend with new graphics by Tiy + initial 'About' page set up
koda
parents:
3697
diff
changeset
|
154 |
[checkbox release]; |
12d17c6e8855
halfway-through finishing the frontend with new graphics by Tiy + initial 'About' page set up
koda
parents:
3697
diff
changeset
|
155 |
} else |
12d17c6e8855
halfway-through finishing the frontend with new graphics by Tiy + initial 'About' page set up
koda
parents:
3697
diff
changeset
|
156 |
cell.accessoryView = nil; |
3547 | 157 |
|
4476
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4362
diff
changeset
|
158 |
cell.backgroundColor = UICOLOR_HW_ALMOSTBLACK; |
3547 | 159 |
return cell; |
160 |
} |
|
161 |
||
3910
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
162 |
// 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
|
163 |
-(void) setDetailsForStaticMap:(NSInteger) index { |
3926
668b71f31e51
use dynamic data from engine instead of using hardcoded values
koda
parents:
3920
diff
changeset
|
164 |
if (self.dataSourceArray == nil) |
668b71f31e51
use dynamic data from engine instead of using hardcoded values
koda
parents:
3920
diff
changeset
|
165 |
[self loadDataSourceArray]; |
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
166 |
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
|
167 |
|
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
168 |
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
|
169 |
(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
|
170 |
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
|
171 |
[fileCfg release]; |
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
172 |
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
|
173 |
[contents release]; |
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
174 |
|
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
175 |
// 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
|
176 |
// 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
|
177 |
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
|
178 |
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
|
179 |
else |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
180 |
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
|
181 |
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
|
182 |
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
|
183 |
[max release]; |
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
184 |
|
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
185 |
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
|
186 |
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
|
187 |
|
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
188 |
if (scIndex != 3) |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
189 |
self.missionCommand = @""; |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
190 |
else |
3920
a54ca6185307
updated lua loading in the ifrontend and also fixed masked maps
koda
parents:
3912
diff
changeset
|
191 |
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
|
192 |
} |
3547 | 193 |
|
194 |
#pragma mark - |
|
195 |
#pragma mark Table view delegate |
|
196 |
-(void) tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { |
|
197 |
int newRow = [indexPath row]; |
|
198 |
int oldRow = (lastIndexPath != nil) ? [lastIndexPath row] : -1; |
|
3697 | 199 |
|
3547 | 200 |
if (newRow != oldRow) { |
3926
668b71f31e51
use dynamic data from engine instead of using hardcoded values
koda
parents:
3920
diff
changeset
|
201 |
if (self.dataSourceArray == nil) |
668b71f31e51
use dynamic data from engine instead of using hardcoded values
koda
parents:
3920
diff
changeset
|
202 |
[self loadDataSourceArray]; |
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
203 |
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
|
204 |
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
|
205 |
// 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
|
206 |
self.themeCommand = [NSString stringWithFormat:@"etheme %@", [source objectAtIndex:newRow]]; |
3642 | 207 |
} else { |
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
208 |
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
|
209 |
(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
|
210 |
[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
|
211 |
[self setDetailsForStaticMap:newRow]; |
3642 | 212 |
} |
3697 | 213 |
|
214 |
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
|
215 |
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
|
216 |
newCell.accessoryView = checkbox; |
12d17c6e8855
halfway-through finishing the frontend with new graphics by Tiy + initial 'About' page set up
koda
parents:
3697
diff
changeset
|
217 |
[checkbox release]; |
3547 | 218 |
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
|
219 |
oldCell.accessoryView = nil; |
3547 | 220 |
|
221 |
self.lastIndexPath = indexPath; |
|
222 |
[aTableView selectRowAtIndexPath:indexPath animated:YES scrollPosition:UITableViewScrollPositionNone]; |
|
223 |
} |
|
224 |
[aTableView deselectRowAtIndexPath:indexPath animated:YES]; |
|
225 |
} |
|
226 |
||
227 |
#pragma mark - |
|
4082 | 228 |
#pragma mark slider & segmentedControl & button |
3547 | 229 |
// this updates the label and the command keys when the slider is moved, depending of the selection in segmentedControl |
230 |
// no methods are called by this routine and you can pass nil to it |
|
231 |
-(IBAction) sliderChanged:(id) sender { |
|
232 |
NSString *labelText; |
|
233 |
NSString *templateCommand; |
|
234 |
NSString *mazeCommand; |
|
3697 | 235 |
|
3547 | 236 |
switch ((int)(self.slider.value*100)) { |
237 |
case 0: |
|
238 |
if (self.segmentedControl.selectedSegmentIndex == 0) { |
|
239 |
labelText = NSLocalizedString(@"Wacky",@""); |
|
240 |
} else { |
|
241 |
labelText = NSLocalizedString(@"Large Floating Islands",@""); |
|
242 |
} |
|
243 |
templateCommand = @"e$template_filter 5"; |
|
244 |
mazeCommand = @"e$maze_size 5"; |
|
245 |
break; |
|
246 |
case 1: |
|
247 |
if (self.segmentedControl.selectedSegmentIndex == 0) { |
|
248 |
labelText = NSLocalizedString(@"Cavern",@""); |
|
249 |
} else { |
|
250 |
labelText = NSLocalizedString(@"Medium Floating Islands",@""); |
|
251 |
} |
|
252 |
templateCommand = @"e$template_filter 4"; |
|
253 |
mazeCommand = @"e$maze_size 4"; |
|
254 |
break; |
|
255 |
case 2: |
|
256 |
if (self.segmentedControl.selectedSegmentIndex == 0) { |
|
257 |
labelText = NSLocalizedString(@"Small",@""); |
|
258 |
} else { |
|
259 |
labelText = NSLocalizedString(@"Small Floating Islands",@""); |
|
260 |
} |
|
261 |
templateCommand = @"e$template_filter 1"; |
|
262 |
mazeCommand = @"e$maze_size 3"; |
|
263 |
break; |
|
264 |
case 3: |
|
265 |
if (self.segmentedControl.selectedSegmentIndex == 0) { |
|
266 |
labelText = NSLocalizedString(@"Medium",@""); |
|
267 |
} else { |
|
268 |
labelText = NSLocalizedString(@"Large Tunnels",@""); |
|
269 |
} |
|
270 |
templateCommand = @"e$template_filter 2"; |
|
271 |
mazeCommand = @"e$maze_size 2"; |
|
272 |
break; |
|
273 |
case 4: |
|
274 |
if (self.segmentedControl.selectedSegmentIndex == 0) { |
|
275 |
labelText = NSLocalizedString(@"Large",@""); |
|
276 |
} else { |
|
277 |
labelText = NSLocalizedString(@"Medium Tunnels",@""); |
|
278 |
} |
|
279 |
templateCommand = @"e$template_filter 3"; |
|
280 |
mazeCommand = @"e$maze_size 1"; |
|
281 |
break; |
|
282 |
case 5: |
|
283 |
if (self.segmentedControl.selectedSegmentIndex == 0) { |
|
284 |
labelText = NSLocalizedString(@"All",@""); |
|
285 |
} else { |
|
286 |
labelText = NSLocalizedString(@"Small Tunnels",@""); |
|
287 |
} |
|
288 |
templateCommand = @"e$template_filter 0"; |
|
289 |
mazeCommand = @"e$maze_size 0"; |
|
290 |
break; |
|
291 |
default: |
|
292 |
labelText = nil; |
|
293 |
templateCommand = nil; |
|
294 |
mazeCommand = nil; |
|
295 |
break; |
|
296 |
} |
|
3697 | 297 |
|
3547 | 298 |
self.sizeLabel.text = labelText; |
299 |
self.templateFilterCommand = templateCommand; |
|
300 |
self.mazeSizeCommand = mazeCommand; |
|
301 |
} |
|
302 |
||
303 |
// update preview (if not busy and if its value really changed) as soon as the user lifts its finger up |
|
304 |
-(IBAction) sliderEndedChanging:(id) sender { |
|
305 |
int num = (int) (self.slider.value * 100); |
|
306 |
if (oldValue != num) { |
|
307 |
[self updatePreview]; |
|
308 |
oldValue = num; |
|
309 |
} |
|
3783 | 310 |
playSound(@"clickSound"); |
3547 | 311 |
} |
312 |
||
3697 | 313 |
// perform actions based on the activated section, then call updatePreview to visually update the selection |
3547 | 314 |
// and if necessary update the table with a slide animation |
315 |
-(IBAction) segmentedControlChanged:(id) sender { |
|
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
316 |
NSString *mapgen, *staticmap, *mission; |
3547 | 317 |
NSInteger newPage = self.segmentedControl.selectedSegmentIndex; |
3697 | 318 |
|
3783 | 319 |
playSound(@"selSound"); |
3547 | 320 |
switch (newPage) { |
321 |
case 0: // Random |
|
322 |
mapgen = @"e$mapgen 0"; |
|
3642 | 323 |
staticmap = @""; |
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
324 |
mission = @""; |
3547 | 325 |
[self sliderChanged:nil]; |
326 |
self.slider.enabled = YES; |
|
4349 | 327 |
[externalController fillSections]; |
3547 | 328 |
break; |
3697 | 329 |
|
3547 | 330 |
case 1: // Map |
331 |
mapgen = @"e$mapgen 0"; |
|
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
332 |
// dummy values, these are set by -updatePreview -> -didSelectRowAtIndexPath -> -setDetailsForStaticMap |
3642 | 333 |
staticmap = @"map Bamboo"; |
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
334 |
mission = @""; |
3547 | 335 |
self.slider.enabled = NO; |
3791
98072b3871c1
help page for ingame, some other fixes here and there
koda
parents:
3789
diff
changeset
|
336 |
self.sizeLabel.text = NSLocalizedString(@"No filter",@""); |
4349 | 337 |
[externalController fillSections]; |
3547 | 338 |
break; |
3697 | 339 |
|
3547 | 340 |
case 2: // Maze |
341 |
mapgen = @"e$mapgen 1"; |
|
3642 | 342 |
staticmap = @""; |
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
343 |
mission = @""; |
3547 | 344 |
[self sliderChanged:nil]; |
345 |
self.slider.enabled = YES; |
|
4349 | 346 |
[externalController fillSections]; |
347 |
break; |
|
348 |
||
349 |
case 3: // Mission |
|
350 |
mapgen = @"e$mapgen 0"; |
|
351 |
// dummy values, these are set by -updatePreview -> -didSelectRowAtIndexPath -> -setDetailsForStaticMap |
|
352 |
staticmap = @"map Bamboo"; |
|
353 |
mission = @""; |
|
354 |
self.slider.enabled = NO; |
|
355 |
self.sizeLabel.text = NSLocalizedString(@"No filter",@""); |
|
356 |
[externalController emptySections]; |
|
3547 | 357 |
break; |
3697 | 358 |
|
3547 | 359 |
default: |
360 |
mapgen = nil; |
|
3642 | 361 |
staticmap = nil; |
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
362 |
mission = nil; |
3547 | 363 |
break; |
364 |
} |
|
365 |
self.mapGenCommand = mapgen; |
|
3642 | 366 |
self.staticMapCommand = staticmap; |
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
367 |
self.missionCommand = mission; |
3697 | 368 |
|
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
369 |
[self.tableView reloadData]; |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
370 |
[self updatePreview]; |
3547 | 371 |
oldPage = newPage; |
372 |
} |
|
373 |
||
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
374 |
-(IBAction) buttonPressed:(id) sender { |
4362
8dae325dc625
added missing graphics and fixed some glitches/crashes/bugs
koda
parents:
4356
diff
changeset
|
375 |
[self.parentController buttonPressed:sender]; |
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
376 |
} |
3697 | 377 |
|
4082 | 378 |
#pragma mark - |
379 |
#pragma mark view management |
|
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
380 |
-(void) loadDataSourceArray { |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
381 |
// 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
|
382 |
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
|
383 |
encoding:NSUTF8StringEncoding |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
384 |
error:NULL]; |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
385 |
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
|
386 |
[string release]; |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
387 |
// remove a trailing "" element |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
388 |
[themeArray removeLastObject]; |
4505
4a8f87eb67cb
disable large maps also on iphone3gs and ipodtouch3g, they fail to load sometimes
koda
parents:
4476
diff
changeset
|
389 |
|
4a8f87eb67cb
disable large maps also on iphone3gs and ipodtouch3g, they fail to load sometimes
koda
parents:
4476
diff
changeset
|
390 |
// remove images that are too big for certain devices without loading the whole image |
4290 | 391 |
NSArray *mapArrayFull = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:MAPS_DIRECTORY() error:NULL]; |
392 |
NSMutableArray *mapArray = [[NSMutableArray alloc] init]; |
|
393 |
for (NSString *str in mapArrayFull) { |
|
394 |
CGSize imgSize = PSPNGSizeFromMetaData([MAPS_DIRECTORY() stringByAppendingFormat:@"%@/map.png",str]); |
|
395 |
if (IS_NOT_POWERFUL() && imgSize.height > 1024.0f) |
|
396 |
continue; |
|
4505
4a8f87eb67cb
disable large maps also on iphone3gs and ipodtouch3g, they fail to load sometimes
koda
parents:
4476
diff
changeset
|
397 |
if (IS_NOT_VERY_POWERFUL() && imgSize.height > 1280.0f) |
4290 | 398 |
continue; |
399 |
[mapArray addObject:str]; |
|
400 |
} |
|
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
401 |
|
4290 | 402 |
NSArray *missionArrayFull = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:MISSIONS_DIRECTORY() error:NULL]; |
403 |
NSMutableArray *missionArray = [[NSMutableArray alloc] init]; |
|
404 |
for (NSString *str in missionArrayFull) { |
|
405 |
CGSize imgSize = PSPNGSizeFromMetaData([MISSIONS_DIRECTORY() stringByAppendingFormat:@"%@/map.png",str]); |
|
406 |
if (IS_NOT_POWERFUL() && imgSize.height > 1024.0f) |
|
407 |
continue; |
|
4505
4a8f87eb67cb
disable large maps also on iphone3gs and ipodtouch3g, they fail to load sometimes
koda
parents:
4476
diff
changeset
|
408 |
if (IS_NOT_VERY_POWERFUL() && imgSize.height > 1280.0f) |
4290 | 409 |
continue; |
410 |
[missionArray addObject:str]; |
|
411 |
} |
|
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
412 |
NSArray *array = [[NSArray alloc] initWithObjects:themeArray,mapArray,themeArray,missionArray,nil]; |
4290 | 413 |
[missionArray release]; |
414 |
[themeArray release]; |
|
415 |
[mapArray release]; |
|
416 |
||
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
417 |
self.dataSourceArray = array; |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
418 |
[array release]; |
3547 | 419 |
} |
420 |
||
421 |
-(void) viewDidLoad { |
|
422 |
[super viewDidLoad]; |
|
3697 | 423 |
|
3547 | 424 |
srandom(time(NULL)); |
3697 | 425 |
|
3547 | 426 |
CGSize screenSize = [[UIScreen mainScreen] bounds].size; |
427 |
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
|
428 |
|
3547 | 429 |
// initialize some "default" values |
430 |
self.sizeLabel.text = NSLocalizedString(@"All",@""); |
|
431 |
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
|
432 |
oldValue = 5; |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
433 |
|
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
434 |
busy = NO; |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
435 |
[self loadDataSourceArray]; |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
436 |
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
|
437 |
|
3789
c3eb56754e92
added a smaller version of forts, fixed a couple of regressions
koda
parents:
3783
diff
changeset
|
438 |
// 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
|
439 |
oldPage = 1; |
3791
98072b3871c1
help page for ingame, some other fixes here and there
koda
parents:
3789
diff
changeset
|
440 |
if (self.segmentedControl.selectedSegmentIndex == 1) { |
98072b3871c1
help page for ingame, some other fixes here and there
koda
parents:
3789
diff
changeset
|
441 |
self.slider.enabled = NO; |
98072b3871c1
help page for ingame, some other fixes here and there
koda
parents:
3789
diff
changeset
|
442 |
self.sizeLabel.text = NSLocalizedString(@"No filter",@""); |
98072b3871c1
help page for ingame, some other fixes here and there
koda
parents:
3789
diff
changeset
|
443 |
} |
3547 | 444 |
|
445 |
self.templateFilterCommand = @"e$template_filter 0"; |
|
446 |
self.mazeSizeCommand = @"e$maze_size 0"; |
|
447 |
self.mapGenCommand = @"e$mapgen 0"; |
|
3642 | 448 |
self.staticMapCommand = @""; |
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
449 |
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
|
450 |
|
4244 | 451 |
if ([self.tableView respondsToSelector:@selector(setBackgroundView:)]) |
452 |
[self.tableView setBackgroundView:nil]; |
|
4356 | 453 |
self.tableView.backgroundColor = [UIColor clearColor]; |
4244 | 454 |
self.tableView.separatorColor = UICOLOR_HW_YELLOW_BODER; |
455 |
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone; |
|
3547 | 456 |
} |
457 |
||
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
458 |
-(void) viewWillAppear:(BOOL)animated { |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
459 |
if (self.dataSourceArray == nil) |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
460 |
[self loadDataSourceArray]; |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
461 |
[super viewWillAppear:animated]; |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
462 |
} |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
463 |
|
3547 | 464 |
-(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
|
465 |
[self updatePreview]; |
3547 | 466 |
[super viewDidAppear:animated]; |
467 |
} |
|
468 |
||
469 |
-(void) viewDidUnload { |
|
470 |
self.previewButton = nil; |
|
471 |
self.seedCommand = nil; |
|
472 |
self.templateFilterCommand = nil; |
|
473 |
self.mapGenCommand = nil; |
|
474 |
self.mazeSizeCommand = nil; |
|
475 |
self.themeCommand = nil; |
|
3642 | 476 |
self.staticMapCommand = nil; |
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
477 |
self.missionCommand = nil; |
3697 | 478 |
|
3547 | 479 |
self.previewButton = nil; |
480 |
self.tableView = nil; |
|
481 |
self.maxLabel = nil; |
|
482 |
self.sizeLabel = nil; |
|
483 |
self.segmentedControl = nil; |
|
484 |
self.slider = nil; |
|
3697 | 485 |
|
3547 | 486 |
self.lastIndexPath = nil; |
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
487 |
self.dataSourceArray = nil; |
3697 | 488 |
|
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
|
489 |
MSG_DIDUNLOAD(); |
3547 | 490 |
[super viewDidUnload]; |
491 |
} |
|
492 |
||
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
493 |
-(void) didReceiveMemoryWarning { |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
494 |
self.dataSourceArray = nil; |
4356 | 495 |
[super didReceiveMemoryWarning]; |
3984 | 496 |
|
4356 | 497 |
if (self.view.superview == nil) { |
498 |
self.tableView = nil; |
|
499 |
self.maxLabel = nil; |
|
500 |
self.sizeLabel = nil; |
|
501 |
self.slider = nil; |
|
502 |
} |
|
3971 | 503 |
|
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
504 |
MSG_MEMCLEAN(); |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
505 |
} |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
506 |
|
3547 | 507 |
-(void) dealloc { |
508 |
[seedCommand release]; |
|
509 |
[templateFilterCommand release]; |
|
510 |
[mapGenCommand release]; |
|
511 |
[mazeSizeCommand release]; |
|
512 |
[themeCommand release]; |
|
3642 | 513 |
[staticMapCommand release]; |
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
514 |
[missionCommand release]; |
3697 | 515 |
|
3547 | 516 |
[previewButton release]; |
517 |
[tableView release]; |
|
518 |
[maxLabel release]; |
|
519 |
[sizeLabel release]; |
|
520 |
[segmentedControl release]; |
|
521 |
[slider release]; |
|
3697 | 522 |
|
3547 | 523 |
[lastIndexPath release]; |
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
524 |
[dataSourceArray release]; |
3697 | 525 |
|
3547 | 526 |
[super dealloc]; |
527 |
} |
|
528 |
||
529 |
@end |