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