author | koda |
Mon, 26 Mar 2012 03:36:11 +0200 | |
changeset 6823 | e54a68b9b844 |
parent 6822 | 206db098f8c5 |
child 6829 | 60b039d88dab |
permissions | -rw-r--r-- |
3829 | 1 |
/* |
2 |
* Hedgewars-iOS, a Hedgewars port for iOS devices |
|
6700 | 3 |
* Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@gmail.com> |
3829 | 4 |
* |
5 |
* This program is free software; you can redistribute it and/or modify |
|
6 |
* it under the terms of the GNU General Public License as published by |
|
7 |
* the Free Software Foundation; version 2 of the License |
|
8 |
* |
|
9 |
* This program is distributed in the hope that it will be useful, |
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 |
* GNU General Public License for more details. |
|
13 |
* |
|
14 |
* You should have received a copy of the GNU General Public License |
|
15 |
* along with this program; if not, write to the Free Software |
|
16 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
17 |
* |
|
18 |
* File created on 22/04/2010. |
|
19 |
*/ |
|
20 |
||
3547 | 21 |
|
22 |
#import "MapConfigViewController.h" |
|
6108 | 23 |
#import <QuartzCore/QuartzCore.h> |
4349 | 24 |
#import "SchemeWeaponConfigViewController.h" |
3547 | 25 |
|
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
26 |
#define scIndex self.segmentedControl.selectedSegmentIndex |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
27 |
#define isRandomness() (segmentedControl.selectedSegmentIndex == 0 || segmentedControl.selectedSegmentIndex == 2) |
3547 | 28 |
|
29 |
@implementation MapConfigViewController |
|
3642 | 30 |
@synthesize previewButton, maxHogs, seedCommand, templateFilterCommand, mapGenCommand, mazeSizeCommand, themeCommand, staticMapCommand, |
6634
e00762923086
ios game configuration page supports rotation, with some enhancements (like the new slider); some glitches here and there
koda
parents:
6115
diff
changeset
|
31 |
missionCommand, tableView, maxLabel, segmentedControl, slider, lastIndexPath, dataSourceArray, busy, |
6115
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6109
diff
changeset
|
32 |
oldPage, oldValue; |
3547 | 33 |
|
34 |
||
35 |
-(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { |
|
36 |
return rotationManager(interfaceOrientation); |
|
37 |
} |
|
38 |
||
6109
f6726ec81e64
finally removed the white border glitch of the ipad preview map, moved initialization from IB to code
koda
parents:
6108
diff
changeset
|
39 |
-(IBAction) mapButtonPressed:(id) sender { |
6000
dbcebcd3d79f
ios frontend: sounds and music have their own class now (with caching\!) instead of being spread here and there (exploiting class methods like a true oop pro)
koda
parents:
5483
diff
changeset
|
40 |
[AudioManagerController playClickSound]; |
3783 | 41 |
[self updatePreview]; |
42 |
} |
|
43 |
||
44 |
-(void) updatePreview { |
|
3547 | 45 |
// don't generate a new preview while it's already generating one |
6115
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6109
diff
changeset
|
46 |
if (self.busy) |
3547 | 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]; |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
58 |
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
|
59 |
// 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
|
60 |
[self turnOffWidgets]; |
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
61 |
[self.previewButton updatePreviewWithSeed:seed]; |
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
62 |
// the preview for static maps is loaded in didSelectRowAtIndexPath |
3547 | 63 |
} |
3910
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
64 |
[seed release]; |
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
65 |
|
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
66 |
// perform as if user clicked on an entry |
6109
f6726ec81e64
finally removed the white border glitch of the ipad preview map, moved initialization from IB to code
koda
parents:
6108
diff
changeset
|
67 |
NSIndexPath *theIndex = [NSIndexPath indexPathForRow:(random()%[source count]) inSection:0]; |
3547 | 68 |
[self tableView:self.tableView didSelectRowAtIndexPath:theIndex]; |
6078
8c0cc07731e5
headers cleanup, converted some function-only sources into proper class method files, more use of OOP power, removed some 'respondsToSelector' calls, moved defines into their own header, more use of objc categories
koda
parents:
6000
diff
changeset
|
69 |
if (IS_NOT_POWERFUL([HWUtils modelType]) == NO) |
4287 | 70 |
[self.tableView scrollToRowAtIndexPath:theIndex atScrollPosition:UITableViewScrollPositionMiddle animated:YES]; |
3547 | 71 |
} |
72 |
||
73 |
-(void) turnOffWidgets { |
|
74 |
busy = YES; |
|
75 |
self.previewButton.alpha = 0.5f; |
|
76 |
self.previewButton.enabled = NO; |
|
6115
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6109
diff
changeset
|
77 |
self.maxLabel.text = NSLocalizedString(@"Loading...",@"");; |
3547 | 78 |
self.segmentedControl.enabled = NO; |
79 |
self.slider.enabled = NO; |
|
80 |
} |
|
81 |
||
6115
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6109
diff
changeset
|
82 |
#pragma mark - |
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6109
diff
changeset
|
83 |
#pragma mark MapPreviewButtonView delegate methods |
3547 | 84 |
-(void) turnOnWidgets { |
85 |
self.previewButton.alpha = 1.0f; |
|
86 |
self.previewButton.enabled = YES; |
|
87 |
self.segmentedControl.enabled = YES; |
|
88 |
self.slider.enabled = YES; |
|
6115
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6109
diff
changeset
|
89 |
self.busy = NO; |
3547 | 90 |
} |
3697 | 91 |
|
6115
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6109
diff
changeset
|
92 |
-(void) setMaxLabelText:(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]; |
6115
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6109
diff
changeset
|
94 |
self.maxLabel.text = [NSString stringWithFormat:@"%@ %@",NSLocalizedString(@"Max Hogs:",@""),str]; |
3547 | 95 |
} |
96 |
||
3910
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
97 |
-(NSDictionary *)getDataForEngine { |
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
98 |
NSDictionary *dictForEngine = [NSDictionary dictionaryWithObjectsAndKeys: |
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
99 |
self.seedCommand,@"seedCommand", |
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
100 |
self.templateFilterCommand,@"templateFilterCommand", |
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
101 |
self.mapGenCommand,@"mapGenCommand", |
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
102 |
self.mazeSizeCommand,@"mazeSizeCommand", |
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
103 |
nil]; |
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
104 |
return dictForEngine; |
3547 | 105 |
} |
106 |
||
107 |
#pragma mark - |
|
108 |
#pragma mark Table view data source |
|
109 |
-(NSInteger) numberOfSectionsInTableView:(UITableView *)tableView { |
|
110 |
return 1; |
|
111 |
} |
|
112 |
||
113 |
-(NSInteger) tableView:(UITableView *)aTableView numberOfRowsInSection:(NSInteger) section { |
|
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
114 |
return [[self.dataSourceArray objectAtIndex:scIndex] count]; |
3547 | 115 |
} |
116 |
||
117 |
-(UITableViewCell *)tableView:(UITableView *)aTableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { |
|
118 |
static NSString *CellIdentifier = @"Cell"; |
|
119 |
NSInteger row = [indexPath row]; |
|
3697 | 120 |
|
3547 | 121 |
UITableViewCell *cell = [aTableView dequeueReusableCellWithIdentifier:CellIdentifier]; |
3697 | 122 |
if (cell == nil) |
3547 | 123 |
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; |
3697 | 124 |
|
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
125 |
NSArray *source = [self.dataSourceArray objectAtIndex:scIndex]; |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
126 |
|
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
127 |
NSString *labelString = [source objectAtIndex:row]; |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
128 |
cell.textLabel.text = labelString; |
3996 | 129 |
cell.textLabel.adjustsFontSizeToFitWidth = YES; |
130 |
cell.textLabel.minimumFontSize = 7; |
|
6078
8c0cc07731e5
headers cleanup, converted some function-only sources into proper class method files, more use of OOP power, removed some 'respondsToSelector' calls, moved defines into their own header, more use of objc categories
koda
parents:
6000
diff
changeset
|
131 |
cell.textLabel.textColor = [UIColor lightYellowColor]; |
4476
4bf74e158f44
team selection completely refactored, now has animation and more performance
koda
parents:
4362
diff
changeset
|
132 |
cell.textLabel.backgroundColor = [UIColor clearColor]; |
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
133 |
|
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
134 |
if (isRandomness()) { |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
135 |
UIImage *image = [[UIImage alloc] initWithContentsOfFile:[NSString stringWithFormat:@"%@/%@/icon.png",THEMES_DIRECTORY(),labelString]]; |
3547 | 136 |
cell.imageView.image = image; |
137 |
[image release]; |
|
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
138 |
} else |
3547 | 139 |
cell.imageView.image = nil; |
3697 | 140 |
|
3703
12d17c6e8855
halfway-through finishing the frontend with new graphics by Tiy + initial 'About' page set up
koda
parents:
3697
diff
changeset
|
141 |
if (row == [self.lastIndexPath row]) { |
12d17c6e8855
halfway-through finishing the frontend with new graphics by Tiy + initial 'About' page set up
koda
parents:
3697
diff
changeset
|
142 |
UIImageView *checkbox = [[UIImageView alloc] initWithImage:[UIImage imageWithContentsOfFile:@"checkbox.png"]]; |
12d17c6e8855
halfway-through finishing the frontend with new graphics by Tiy + initial 'About' page set up
koda
parents:
3697
diff
changeset
|
143 |
cell.accessoryView = checkbox; |
12d17c6e8855
halfway-through finishing the frontend with new graphics by Tiy + initial 'About' page set up
koda
parents:
3697
diff
changeset
|
144 |
[checkbox release]; |
12d17c6e8855
halfway-through finishing the frontend with new graphics by Tiy + initial 'About' page set up
koda
parents:
3697
diff
changeset
|
145 |
} else |
12d17c6e8855
halfway-through finishing the frontend with new graphics by Tiy + initial 'About' page set up
koda
parents:
3697
diff
changeset
|
146 |
cell.accessoryView = nil; |
3547 | 147 |
|
6078
8c0cc07731e5
headers cleanup, converted some function-only sources into proper class method files, more use of OOP power, removed some 'respondsToSelector' calls, moved defines into their own header, more use of objc categories
koda
parents:
6000
diff
changeset
|
148 |
cell.backgroundColor = [UIColor blackColorTransparent]; |
3547 | 149 |
return cell; |
150 |
} |
|
151 |
||
3910
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
152 |
// this set details for a static map (called by didSelectRowAtIndexPath) |
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
153 |
-(void) setDetailsForStaticMap:(NSInteger) index { |
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
154 |
NSArray *source = [self.dataSourceArray objectAtIndex:scIndex]; |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
155 |
|
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
156 |
NSString *fileCfg = [[NSString alloc] initWithFormat:@"%@/%@/map.cfg", |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
157 |
(scIndex == 1) ? MAPS_DIRECTORY() : MISSIONS_DIRECTORY(),[source objectAtIndex:index]]; |
3910
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
158 |
NSString *contents = [[NSString alloc] initWithContentsOfFile:fileCfg encoding:NSUTF8StringEncoding error:NULL]; |
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
159 |
[fileCfg release]; |
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
160 |
NSArray *split = [contents componentsSeparatedByString:@"\n"]; |
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
161 |
[contents release]; |
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
162 |
|
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
163 |
// if the number is not set we keep 18 standard; |
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
164 |
// sometimes it's not set but there are trailing characters, we get around them with the second equation |
6115
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6109
diff
changeset
|
165 |
NSString *max; |
3910
dd47efbdec46
move all preview drawing code into its own class (for a simplified and more readable MapConfigViewController)
koda
parents:
3829
diff
changeset
|
166 |
if ([split count] > 1 && [[split objectAtIndex:1] intValue] > 0) |
6115
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6109
diff
changeset
|
167 |
max = [split objectAtIndex:1]; |
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
168 |
else |
6115
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6109
diff
changeset
|
169 |
max = @"18"; |
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6109
diff
changeset
|
170 |
[self setMaxLabelText:max]; |
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 - |
|
4082 | 213 |
#pragma mark slider & segmentedControl & button |
3547 | 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) { |
|
6669 | 242 |
labelText = NSLocalizedString(@"Large",@""); |
3547 | 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) { |
|
6669 | 260 |
labelText = NSLocalizedString(@"Small",@""); |
3547 | 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 |
|
6634
e00762923086
ios game configuration page supports rotation, with some enhancements (like the new slider); some glitches here and there
koda
parents:
6115
diff
changeset
|
283 |
self.slider.textValue = labelText; |
3547 | 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 |
} |
|
6000
dbcebcd3d79f
ios frontend: sounds and music have their own class now (with caching\!) instead of being spread here and there (exploiting class methods like a true oop pro)
koda
parents:
5483
diff
changeset
|
295 |
[AudioManagerController playClickSound]; |
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 |
|
6000
dbcebcd3d79f
ios frontend: sounds and music have their own class now (with caching\!) instead of being spread here and there (exploiting class methods like a true oop pro)
koda
parents:
5483
diff
changeset
|
304 |
[AudioManagerController playSelectSound]; |
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; |
|
6115
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6109
diff
changeset
|
312 |
[SchemeWeaponConfigViewController fillInstanceSections]; |
3547 | 313 |
break; |
3697 | 314 |
|
3547 | 315 |
case 1: // Map |
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; |
6115
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6109
diff
changeset
|
321 |
[SchemeWeaponConfigViewController fillInstanceSections]; |
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; |
|
6115
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6109
diff
changeset
|
330 |
[SchemeWeaponConfigViewController fillInstanceSections]; |
4349 | 331 |
break; |
332 |
||
333 |
case 3: // Mission |
|
334 |
mapgen = @"e$mapgen 0"; |
|
335 |
// dummy values, these are set by -updatePreview -> -didSelectRowAtIndexPath -> -setDetailsForStaticMap |
|
336 |
staticmap = @"map Bamboo"; |
|
337 |
mission = @""; |
|
338 |
self.slider.enabled = NO; |
|
6115
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6109
diff
changeset
|
339 |
[SchemeWeaponConfigViewController emptyInstanceSections]; |
3547 | 340 |
break; |
3697 | 341 |
|
3547 | 342 |
default: |
343 |
mapgen = nil; |
|
3642 | 344 |
staticmap = nil; |
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
345 |
mission = nil; |
3547 | 346 |
break; |
347 |
} |
|
348 |
self.mapGenCommand = mapgen; |
|
3642 | 349 |
self.staticMapCommand = staticmap; |
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
350 |
self.missionCommand = mission; |
3697 | 351 |
|
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
352 |
[self.tableView reloadData]; |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
353 |
[self updatePreview]; |
3547 | 354 |
oldPage = newPage; |
355 |
} |
|
356 |
||
4082 | 357 |
#pragma mark - |
358 |
#pragma mark view management |
|
6107 | 359 |
-(NSArray *) dataSourceArray { |
360 |
if (dataSourceArray == nil) { |
|
361 |
NSString *model = [HWUtils modelType]; |
|
362 |
||
363 |
// only folders containing icon.png are a valid theme |
|
364 |
NSArray *themeArrayFull = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:THEMES_DIRECTORY() error:NULL]; |
|
365 |
NSMutableArray *themeArray = [[NSMutableArray alloc] init]; |
|
366 |
for (NSString *themeName in themeArrayFull) { |
|
367 |
NSString *checkPath = [[NSString alloc] initWithFormat:@"%@/%@/icon.png",THEMES_DIRECTORY(),themeName]; |
|
368 |
if ([[NSFileManager defaultManager] fileExistsAtPath:checkPath]) |
|
369 |
[themeArray addObject:themeName]; |
|
370 |
[checkPath release]; |
|
371 |
} |
|
372 |
||
373 |
// remove images that are too big for certain devices without loading the whole image |
|
374 |
NSArray *mapArrayFull = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:MAPS_DIRECTORY() error:NULL]; |
|
375 |
NSMutableArray *mapArray = [[NSMutableArray alloc] init]; |
|
376 |
for (NSString *str in mapArrayFull) { |
|
377 |
CGSize imgSize = [UIImage imageSizeFromMetadataOf:[MAPS_DIRECTORY() stringByAppendingFormat:@"%@/map.png",str]]; |
|
378 |
if (IS_NOT_POWERFUL(model) && imgSize.height > 1024.0f) |
|
379 |
continue; |
|
380 |
if (IS_NOT_VERY_POWERFUL(model) && imgSize.height > 1280.0f) |
|
381 |
continue; |
|
382 |
[mapArray addObject:str]; |
|
383 |
} |
|
384 |
||
385 |
NSArray *missionArrayFull = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:MISSIONS_DIRECTORY() error:NULL]; |
|
386 |
NSMutableArray *missionArray = [[NSMutableArray alloc] init]; |
|
387 |
for (NSString *str in missionArrayFull) { |
|
388 |
CGSize imgSize = [UIImage imageSizeFromMetadataOf:[MISSIONS_DIRECTORY() stringByAppendingFormat:@"%@/map.png",str]]; |
|
389 |
if (IS_NOT_POWERFUL(model) && imgSize.height > 1024.0f) |
|
390 |
continue; |
|
391 |
if (IS_NOT_VERY_POWERFUL(model) && imgSize.height > 1280.0f) |
|
392 |
continue; |
|
393 |
[missionArray addObject:str]; |
|
394 |
} |
|
395 |
NSArray *array = [[NSArray alloc] initWithObjects:themeArray,mapArray,themeArray,missionArray,nil]; |
|
396 |
[missionArray release]; |
|
397 |
[themeArray release]; |
|
398 |
[mapArray release]; |
|
399 |
||
400 |
self.dataSourceArray = array; |
|
401 |
[array release]; |
|
5281 | 402 |
} |
6107 | 403 |
return dataSourceArray; |
3547 | 404 |
} |
405 |
||
406 |
-(void) viewDidLoad { |
|
407 |
[super viewDidLoad]; |
|
408 |
srandom(time(NULL)); |
|
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
409 |
|
3547 | 410 |
// initialize some "default" values |
411 |
self.slider.value = 0.05f; |
|
6115
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6109
diff
changeset
|
412 |
self.slider.enabled = NO; |
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6109
diff
changeset
|
413 |
self.oldValue = 5; |
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6109
diff
changeset
|
414 |
self.busy = NO; |
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6109
diff
changeset
|
415 |
self.oldPage = self.segmentedControl.selectedSegmentIndex; |
3547 | 416 |
|
417 |
self.templateFilterCommand = @"e$template_filter 0"; |
|
418 |
self.mazeSizeCommand = @"e$maze_size 0"; |
|
419 |
self.mapGenCommand = @"e$mapgen 0"; |
|
3642 | 420 |
self.staticMapCommand = @""; |
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
421 |
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
|
422 |
|
6108 | 423 |
if (IS_IPAD()) { |
424 |
[self.tableView setBackgroundColorForAnyTable:[UIColor darkBlueColorTransparent]]; |
|
425 |
self.tableView.layer.borderColor = [[UIColor darkYellowColor] CGColor]; |
|
426 |
self.tableView.layer.borderWidth = 2.7f; |
|
427 |
self.tableView.layer.cornerRadius = 8; |
|
428 |
self.tableView.contentInset = UIEdgeInsetsMake(10, 0, 10, 0); |
|
6115
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6109
diff
changeset
|
429 |
|
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6109
diff
changeset
|
430 |
UILabel *backLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 14, 300, 190) andTitle:nil withBorderWidth:2.3f]; |
6634
e00762923086
ios game configuration page supports rotation, with some enhancements (like the new slider); some glitches here and there
koda
parents:
6115
diff
changeset
|
431 |
backLabel.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin; |
6115
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6109
diff
changeset
|
432 |
[self.view insertSubview:backLabel belowSubview:self.segmentedControl]; |
485cfecadc9a
HUGE refactoring of the ipad interface, finally understood how to use interface builder with custom uiviewcontrollers, as well as converted some uitableviewcontrollers to uiviewcontrollers for simplicity
koda
parents:
6109
diff
changeset
|
433 |
[backLabel release]; |
6108 | 434 |
} |
435 |
self.tableView.separatorColor = [UIColor whiteColor]; |
|
4244 | 436 |
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone; |
3547 | 437 |
} |
438 |
||
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
439 |
-(void) viewWillAppear:(BOOL)animated { |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
440 |
[super viewWillAppear:animated]; |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
441 |
} |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
442 |
|
3547 | 443 |
-(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
|
444 |
[self updatePreview]; |
3547 | 445 |
[super viewDidAppear:animated]; |
446 |
} |
|
447 |
||
448 |
-(void) viewDidUnload { |
|
449 |
self.previewButton = nil; |
|
450 |
self.seedCommand = nil; |
|
451 |
self.templateFilterCommand = nil; |
|
452 |
self.mapGenCommand = nil; |
|
453 |
self.mazeSizeCommand = nil; |
|
454 |
self.themeCommand = nil; |
|
3642 | 455 |
self.staticMapCommand = nil; |
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
456 |
self.missionCommand = nil; |
3697 | 457 |
|
3547 | 458 |
self.tableView = nil; |
459 |
self.maxLabel = nil; |
|
460 |
self.segmentedControl = nil; |
|
461 |
self.slider = nil; |
|
3697 | 462 |
|
3547 | 463 |
self.lastIndexPath = nil; |
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
464 |
self.dataSourceArray = nil; |
3697 | 465 |
|
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
|
466 |
MSG_DIDUNLOAD(); |
3547 | 467 |
[super viewDidUnload]; |
468 |
} |
|
469 |
||
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
470 |
-(void) didReceiveMemoryWarning { |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
471 |
self.dataSourceArray = nil; |
4356 | 472 |
[super didReceiveMemoryWarning]; |
3984 | 473 |
|
4356 | 474 |
if (self.view.superview == nil) { |
6823 | 475 |
self.previewButton = nil; |
4356 | 476 |
self.tableView = nil; |
477 |
self.maxLabel = nil; |
|
478 |
self.slider = nil; |
|
479 |
} |
|
3971 | 480 |
|
3911
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
481 |
MSG_MEMCLEAN(); |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
482 |
} |
46d7a5cf8ac6
further rework of MapConfigViewController, lists missions correctly (they don't load fine yet)
koda
parents:
3910
diff
changeset
|
483 |
|
3547 | 484 |
-(void) dealloc { |
5208 | 485 |
releaseAndNil(seedCommand); |
486 |
releaseAndNil(templateFilterCommand); |
|
487 |
releaseAndNil(mapGenCommand); |
|
488 |
releaseAndNil(mazeSizeCommand); |
|
489 |
releaseAndNil(themeCommand); |
|
490 |
releaseAndNil(staticMapCommand); |
|
491 |
releaseAndNil(missionCommand); |
|
3697 | 492 |
|
5208 | 493 |
releaseAndNil(previewButton); |
494 |
releaseAndNil(tableView); |
|
495 |
releaseAndNil(maxLabel); |
|
496 |
releaseAndNil(segmentedControl); |
|
497 |
releaseAndNil(slider); |
|
3697 | 498 |
|
5208 | 499 |
releaseAndNil(lastIndexPath); |
500 |
releaseAndNil(dataSourceArray); |
|
3697 | 501 |
|
3547 | 502 |
[super dealloc]; |
503 |
} |
|
504 |
||
505 |
@end |