author | koda |
Sun, 22 Aug 2010 22:08:39 +0200 | |
changeset 3752 | 73c2d7d5643b |
parent 3697 | d5b30d6373fc |
child 3753 | bb5a0252fb56 |
permissions | -rw-r--r-- |
3547 | 1 |
// |
2 |
// SingleSchemeViewController.m |
|
3 |
// Hedgewars |
|
4 |
// |
|
5 |
// Created by Vittorio on 23/05/10. |
|
6 |
// Copyright 2010 __MyCompanyName__. All rights reserved. |
|
7 |
// |
|
8 |
||
9 |
#import "SingleSchemeViewController.h" |
|
10 |
#import <QuartzCore/QuartzCore.h> |
|
11 |
#import "CommodityFunctions.h" |
|
12 |
#import "UIImageExtra.h" |
|
13 |
||
3573 | 14 |
#define LABEL_TAG 12345 |
15 |
#define SLIDER_TAG 54321 |
|
16 |
||
3547 | 17 |
@implementation SingleSchemeViewController |
3659 | 18 |
@synthesize schemeName, schemeArray, basicSettingList, gameModifierArray; |
3547 | 19 |
|
20 |
-(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation { |
|
21 |
return rotationManager(interfaceOrientation); |
|
22 |
} |
|
23 |
||
24 |
#pragma mark - |
|
25 |
#pragma mark View lifecycle |
|
26 |
-(void) viewDidLoad { |
|
27 |
[super viewDidLoad]; |
|
28 |
||
29 |
NSArray *mods = [[NSArray alloc] initWithObjects: |
|
30 |
[NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Fort Mode",@""),@"title", |
|
31 |
NSLocalizedString(@"Defend your fort and destroy the opponents (two team colours max)",@""),@"description", |
|
32 |
@"Forts",@"image",nil], |
|
33 |
[NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Divide Team",@""),@"title", |
|
34 |
NSLocalizedString(@"Teams will start on opposite sides of the terrain (two team colours max)",@""),@"description", |
|
35 |
@"TeamsDivide",@"image",nil], |
|
36 |
[NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Solid Land",@""),@"title", |
|
37 |
NSLocalizedString(@"Land can not be destroyed",@""),@"description", |
|
38 |
@"Solid",@"image",nil], |
|
39 |
[NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Add Border",@""),@"title", |
|
40 |
NSLocalizedString(@"Add an indestructable border around the terrain",@""),@"description", |
|
41 |
@"Border",@"image",nil], |
|
42 |
[NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Low Gravity",@""),@"title", |
|
43 |
NSLocalizedString(@"Lower gravity",@""),@"description", |
|
44 |
@"LowGravity",@"image",nil], |
|
45 |
[NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Laser Sight",@""),@"title", |
|
46 |
NSLocalizedString(@"Assisted aiming with laser sight",@""),@"description", |
|
47 |
@"LaserSight",@"image",nil], |
|
48 |
[NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Invulnerable",@""),@"title", |
|
49 |
NSLocalizedString(@"All hogs have a personal forcefield",@""),@"description", |
|
50 |
@"Invulnerable",@"image",nil], |
|
51 |
[NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Add Mines",@""),@"title", |
|
52 |
NSLocalizedString(@"Enable random mines",@""),@"description", |
|
53 |
@"Mines",@"image",nil], |
|
54 |
[NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Vampirism Mode",@""),@"title", |
|
55 |
NSLocalizedString(@"Gain 80% of the damage you do back in health",@""),@"description", |
|
56 |
@"Vampiric",@"image",nil], |
|
57 |
[NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Karma Mode",@""),@"title", |
|
58 |
NSLocalizedString(@"Share your opponents pain, share their damage",@""),@"description", |
|
59 |
@"Karma",@"image",nil], |
|
60 |
[NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Artillery Mode",@""),@"title", |
|
61 |
NSLocalizedString(@"Your hogs are unable to move, test your aim",@""),@"description", |
|
62 |
@"Artillery",@"image",nil], |
|
63 |
[NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Random Order",@""),@"title", |
|
64 |
NSLocalizedString(@"Order of play is random instead of in room order",@""),@"description", |
|
65 |
@"RandomOrder",@"image",nil], |
|
66 |
[NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"King Mode",@""),@"title", |
|
67 |
NSLocalizedString(@"Play with a King. If he dies, your side loses",@""),@"description", |
|
68 |
@"King",@"image",nil], |
|
69 |
[NSDictionary dictionaryWithObjectsAndKeys: NSLocalizedString(@"Place Hedgehogs",@""),@"title", |
|
70 |
NSLocalizedString(@"Take turns placing your hedgehogs pre-game",@""),@"description", |
|
71 |
@"PlaceHog",@"image",nil], |
|
72 |
[NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Clan Shares Ammo",@""),@"title", |
|
73 |
NSLocalizedString(@"Ammo is shared between all clan teams",@""),@"description", |
|
74 |
@"SharedAmmo",@"image",nil], |
|
75 |
[NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Disable Girders",@""),@"title", |
|
76 |
NSLocalizedString(@"Disable girders when generating random maps",@""),@"description", |
|
77 |
@"DisableGirders",@"image",nil], |
|
78 |
[NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Disable Land Objects",@""),@"title", |
|
79 |
NSLocalizedString(@"Disable land objects when generating maps",@""),@"description", |
|
80 |
@"DisableLandObjects",@"image",nil], |
|
3752
73c2d7d5643b
add the new flag, fix a couple of hicups in creating config files, swap animation between settings and lobby
koda
parents:
3697
diff
changeset
|
81 |
[NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"AI Survival Mode",@""),@"title", |
73c2d7d5643b
add the new flag, fix a couple of hicups in creating config files, swap animation between settings and lobby
koda
parents:
3697
diff
changeset
|
82 |
NSLocalizedString(@"AI-controlled hogs respawn on death",@""),@"description", |
73c2d7d5643b
add the new flag, fix a couple of hicups in creating config files, swap animation between settings and lobby
koda
parents:
3697
diff
changeset
|
83 |
@"AISurvival",@"image",nil], |
3547 | 84 |
nil]; |
85 |
self.gameModifierArray = mods; |
|
86 |
[mods release]; |
|
3697 | 87 |
|
3547 | 88 |
NSArray *basicSettings = [[NSArray alloc] initWithObjects: |
3573 | 89 |
[NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Damage Modifier",@""),@"title",@"Damage",@"image", |
90 |
[NSNumber numberWithInt:100],@"default",[NSNumber numberWithInt:10],@"min",[NSNumber numberWithInt:300],@"max",nil], |
|
91 |
[NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Turn Time",@""),@"title",@"Time",@"image", |
|
92 |
[NSNumber numberWithInt:45],@"default",[NSNumber numberWithInt:1],@"min",[NSNumber numberWithInt:99],@"max",nil], |
|
93 |
[NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Initial Health",@""),@"title",@"Health",@"image", |
|
94 |
[NSNumber numberWithInt:100],@"default",[NSNumber numberWithInt:50],@"min",[NSNumber numberWithInt:200],@"max",nil], |
|
95 |
[NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Sudden Death Timeout",@""),@"title",@"SuddenDeath",@"image", |
|
96 |
[NSNumber numberWithInt:15],@"default",[NSNumber numberWithInt:0],@"min",[NSNumber numberWithInt:50],@"max",nil], |
|
97 |
[NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Crate Drops",@""),@"title",@"Box",@"image", |
|
98 |
[NSNumber numberWithInt:5],@"default",[NSNumber numberWithInt:0],@"min",[NSNumber numberWithInt:9],@"max",nil], |
|
99 |
[NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Mines Time",@""),@"title",@"Time",@"image", |
|
100 |
[NSNumber numberWithInt:3],@"default",[NSNumber numberWithInt:0],@"min",[NSNumber numberWithInt:3],@"max",nil], |
|
101 |
[NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Mines Number",@""),@"title",@"Mine",@"image", |
|
102 |
[NSNumber numberWithInt:4],@"default",[NSNumber numberWithInt:1],@"min",[NSNumber numberWithInt:80],@"max",nil], |
|
103 |
[NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Dud Mines Probability",@""),@"title",@"Dud",@"image", |
|
104 |
[NSNumber numberWithInt:0],@"default",[NSNumber numberWithInt:0],@"min",[NSNumber numberWithInt:100],@"max",nil], |
|
105 |
[NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@"Explosives",@""),@"title",@"Damage",@"image", |
|
106 |
[NSNumber numberWithInt:2],@"default",[NSNumber numberWithInt:0],@"min",[NSNumber numberWithInt:40],@"max",nil], |
|
3547 | 107 |
nil]; |
108 |
self.basicSettingList = basicSettings; |
|
109 |
[basicSettings release]; |
|
3697 | 110 |
|
3659 | 111 |
self.title = NSLocalizedString(@"Edit scheme preferences",@""); |
3547 | 112 |
} |
113 |
||
114 |
// load from file |
|
115 |
-(void) viewWillAppear:(BOOL) animated { |
|
116 |
[super viewWillAppear:animated]; |
|
3697 | 117 |
|
3659 | 118 |
NSString *schemeFile = [[NSString alloc] initWithFormat:@"%@/%@.plist",SCHEMES_DIRECTORY(),self.schemeName]; |
3547 | 119 |
NSMutableArray *scheme = [[NSMutableArray alloc] initWithContentsOfFile:schemeFile]; |
3621 | 120 |
[schemeFile release]; |
3547 | 121 |
self.schemeArray = scheme; |
122 |
[scheme release]; |
|
3697 | 123 |
|
3547 | 124 |
[self.tableView reloadData]; |
125 |
} |
|
126 |
||
127 |
// save to file |
|
128 |
-(void) viewWillDisappear:(BOOL) animated { |
|
129 |
[super viewWillDisappear:animated]; |
|
3697 | 130 |
|
3659 | 131 |
NSString *schemeFile = [[NSString alloc] initWithFormat:@"%@/%@.plist",SCHEMES_DIRECTORY(),self.schemeName]; |
3547 | 132 |
[self.schemeArray writeToFile:schemeFile atomically:YES]; |
133 |
[schemeFile release]; |
|
134 |
} |
|
135 |
||
136 |
#pragma mark - |
|
3659 | 137 |
#pragma mark editableCellView delegate |
3547 | 138 |
// set the new value |
3697 | 139 |
-(void) saveTextFieldValue:(NSString *)textString withTag:(NSInteger) tagValue { |
3659 | 140 |
// delete old file |
141 |
[[NSFileManager defaultManager] removeItemAtPath:[NSString stringWithFormat:@"%@/%@.plist",SCHEMES_DIRECTORY(),self.schemeName] error:NULL]; |
|
142 |
// update filename |
|
143 |
self.schemeName = textString; |
|
144 |
// save new file |
|
145 |
[self.schemeArray writeToFile:[NSString stringWithFormat:@"%@/%@.plist",SCHEMES_DIRECTORY(),self.schemeName] atomically:YES]; |
|
3547 | 146 |
} |
147 |
||
148 |
#pragma mark - |
|
149 |
#pragma mark Table view data source |
|
150 |
-(NSInteger) numberOfSectionsInTableView:(UITableView *)tableView { |
|
151 |
return 3; |
|
152 |
} |
|
153 |
||
154 |
-(NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { |
|
155 |
switch (section) { |
|
156 |
case 0: |
|
157 |
return 1; |
|
158 |
break; |
|
159 |
case 1: |
|
160 |
return [self.basicSettingList count]; |
|
161 |
break; |
|
162 |
case 2: |
|
163 |
return [self.gameModifierArray count]; |
|
164 |
default: |
|
165 |
break; |
|
166 |
} |
|
167 |
return 0; |
|
168 |
} |
|
169 |
||
3573 | 170 |
-(UITableViewCell *)tableView:(UITableView *)aTableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { |
3547 | 171 |
static NSString *CellIdentifier0 = @"Cell0"; |
172 |
static NSString *CellIdentifier1 = @"Cell1"; |
|
173 |
static NSString *CellIdentifier2 = @"Cell2"; |
|
3697 | 174 |
|
3547 | 175 |
UITableViewCell *cell = nil; |
3659 | 176 |
EditableCellView *editableCell = nil; |
3547 | 177 |
NSInteger row = [indexPath row]; |
3697 | 178 |
|
3547 | 179 |
switch ([indexPath section]) { |
180 |
case 0: |
|
3659 | 181 |
editableCell = (EditableCellView *)[aTableView dequeueReusableCellWithIdentifier:CellIdentifier0]; |
182 |
if (editableCell == nil) { |
|
3697 | 183 |
editableCell = [[[EditableCellView alloc] initWithStyle:UITableViewCellStyleDefault |
3547 | 184 |
reuseIdentifier:CellIdentifier0] autorelease]; |
3659 | 185 |
editableCell.delegate = self; |
3547 | 186 |
} |
3697 | 187 |
|
3659 | 188 |
editableCell.textField.text = self.schemeName; |
189 |
editableCell.detailTextLabel.text = nil; |
|
190 |
editableCell.imageView.image = nil; |
|
191 |
editableCell.selectionStyle = UITableViewCellSelectionStyleNone; |
|
192 |
cell = editableCell; |
|
3547 | 193 |
break; |
194 |
case 1: |
|
3573 | 195 |
cell = [aTableView dequeueReusableCellWithIdentifier:CellIdentifier1]; |
196 |
NSDictionary *detail = [self.basicSettingList objectAtIndex:row]; |
|
197 |
// need to offset this section (see format in CommodityFunctions.m and above) |
|
198 |
NSInteger gmSize = [self.gameModifierArray count]; |
|
3547 | 199 |
if (cell == nil) { |
3697 | 200 |
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 |
3547 | 201 |
reuseIdentifier:CellIdentifier1] autorelease]; |
3697 | 202 |
|
3643
858b20bafb6e
reworked the ammunition configuration page (visually)
koda
parents:
3623
diff
changeset
|
203 |
int offset = 0; |
858b20bafb6e
reworked the ammunition configuration page (visually)
koda
parents:
3623
diff
changeset
|
204 |
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) |
3659 | 205 |
offset = 50; |
3697 | 206 |
|
3643
858b20bafb6e
reworked the ammunition configuration page (visually)
koda
parents:
3623
diff
changeset
|
207 |
UISlider *slider = [[UISlider alloc] initWithFrame:CGRectMake(offset+260, 12, offset+150, 23)]; |
3573 | 208 |
slider.maximumValue = [[detail objectForKey:@"max"] floatValue]; |
209 |
slider.minimumValue = [[detail objectForKey:@"min"] floatValue]; |
|
210 |
slider.tag = row+gmSize; |
|
211 |
[slider addTarget:self action:@selector(sliderChanged:) forControlEvents:UIControlEventValueChanged]; |
|
212 |
[cell.contentView addSubview:slider]; |
|
213 |
[slider release]; |
|
3697 | 214 |
|
3573 | 215 |
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(50, 7, 200, 30)]; |
216 |
label.tag = LABEL_TAG; |
|
217 |
label.backgroundColor = [UIColor clearColor]; |
|
218 |
label.font = [UIFont boldSystemFontOfSize:[UIFont labelFontSize]]; |
|
219 |
[cell.contentView addSubview:label]; |
|
220 |
[label release]; |
|
3547 | 221 |
} |
3697 | 222 |
|
3547 | 223 |
UIImage *img = [[UIImage alloc] initWithContentsOfFile:[NSString stringWithFormat:@"%@/icon%@.png",BTN_DIRECTORY(),[[self.basicSettingList objectAtIndex:row] objectForKey:@"image"]]]; |
3623 | 224 |
cell.imageView.image = img; |
3547 | 225 |
[img release]; |
3697 | 226 |
|
3573 | 227 |
UILabel *cellLabel = (UILabel *)[cell.contentView viewWithTag:LABEL_TAG]; |
228 |
cellLabel.text = [[self.basicSettingList objectAtIndex:row] objectForKey:@"title"]; |
|
3697 | 229 |
|
3573 | 230 |
UISlider *cellSlider = (UISlider *)[cell.contentView viewWithTag:row+gmSize]; |
231 |
cellSlider.value = [[self.schemeArray objectAtIndex:row+gmSize] floatValue]; |
|
3697 | 232 |
|
3573 | 233 |
// forced to use this weird format otherwise the label disappears when size of the text is bigger than the original |
3574 | 234 |
NSString *prestring = [NSString stringWithFormat:@"%d",[[self.schemeArray objectAtIndex:row+gmSize] intValue]]; |
235 |
while ([prestring length] <= 4) |
|
236 |
prestring = [NSString stringWithFormat:@" %@",prestring]; |
|
237 |
cell.detailTextLabel.text = prestring; |
|
3697 | 238 |
|
3574 | 239 |
cell.selectionStyle = UITableViewCellSelectionStyleBlue; |
3547 | 240 |
break; |
241 |
case 2: |
|
3573 | 242 |
cell = [aTableView dequeueReusableCellWithIdentifier:CellIdentifier2]; |
3547 | 243 |
if (cell == nil) { |
244 |
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle |
|
245 |
reuseIdentifier:CellIdentifier2] autorelease]; |
|
246 |
UISwitch *onOff = [[UISwitch alloc] init]; |
|
247 |
onOff.tag = row; |
|
248 |
[onOff addTarget:self action:@selector(toggleSwitch:) forControlEvents:UIControlEventValueChanged]; |
|
249 |
cell.accessoryView = onOff; |
|
250 |
[onOff release]; |
|
251 |
} |
|
3697 | 252 |
|
3547 | 253 |
UIImage *image = [[UIImage alloc] initWithContentsOfFile:[NSString stringWithFormat:@"%@/btn%@.png",BTN_DIRECTORY(),[[self.gameModifierArray objectAtIndex:row] objectForKey:@"image"]]]; |
254 |
cell.imageView.image = image; |
|
255 |
[image release]; |
|
256 |
[cell.imageView.layer setCornerRadius:7.0f]; |
|
3573 | 257 |
[cell.imageView.layer setBorderWidth:1]; |
3547 | 258 |
[cell.imageView.layer setMasksToBounds:YES]; |
259 |
cell.textLabel.text = [[self.gameModifierArray objectAtIndex:row] objectForKey:@"title"]; |
|
260 |
cell.detailTextLabel.text = [[self.gameModifierArray objectAtIndex:row] objectForKey:@"description"]; |
|
261 |
[(UISwitch *)cell.accessoryView setOn:[[self.schemeArray objectAtIndex:row] boolValue] animated:NO]; |
|
3697 | 262 |
|
3574 | 263 |
cell.selectionStyle = UITableViewCellSelectionStyleNone; |
3547 | 264 |
} |
3697 | 265 |
|
3547 | 266 |
return cell; |
267 |
} |
|
268 |
||
269 |
-(void) toggleSwitch:(id) sender { |
|
270 |
UISwitch *theSwitch = (UISwitch *)sender; |
|
271 |
[self.schemeArray replaceObjectAtIndex:theSwitch.tag withObject:[NSNumber numberWithBool:theSwitch.on]]; |
|
272 |
} |
|
273 |
||
3573 | 274 |
-(void) sliderChanged:(id) sender { |
275 |
// need to offset this section (see format in CommodityFunctions.m and above) |
|
276 |
NSInteger gmSize = [self.gameModifierArray count]; |
|
277 |
// the slider that changed is sent as object |
|
278 |
UISlider *theSlider = (UISlider *)sender; |
|
279 |
// create the indexPath of the row of the slider |
|
280 |
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:theSlider.tag-gmSize inSection:1]; |
|
281 |
// get its cell |
|
282 |
UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:indexPath]; |
|
283 |
// grab the associated label |
|
284 |
UILabel *label = (UILabel *)cell.detailTextLabel; |
|
285 |
// modify it |
|
3574 | 286 |
label.text = [NSString stringWithFormat:@"%d",(int)theSlider.value]; |
3573 | 287 |
// save changes in the main array (remember that you need to offset it) |
288 |
[self.schemeArray replaceObjectAtIndex:theSlider.tag withObject:[NSNumber numberWithInt:(int)theSlider.value]]; |
|
289 |
} |
|
3547 | 290 |
|
291 |
#pragma mark - |
|
292 |
#pragma mark Table view delegate |
|
293 |
-(void) tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { |
|
3573 | 294 |
UITableViewCell *cell = [aTableView cellForRowAtIndexPath:indexPath]; |
3659 | 295 |
EditableCellView *editableCell = nil; |
3573 | 296 |
UISlider *cellSlider = nil; |
3697 | 297 |
|
3573 | 298 |
switch ([indexPath section]) { |
299 |
case 0: |
|
3659 | 300 |
editableCell = (EditableCellView *)cell; |
301 |
[editableCell replyKeyboard]; |
|
3573 | 302 |
break; |
303 |
case 1: |
|
304 |
cellSlider = (UISlider *)[cell.contentView viewWithTag:[indexPath row]+[self.gameModifierArray count]]; |
|
305 |
[cellSlider setValue:[[[self.basicSettingList objectAtIndex:[indexPath row]] objectForKey:@"default"] floatValue] animated:YES]; |
|
306 |
[self sliderChanged:cellSlider]; |
|
307 |
//cell.detailTextLabel.text = [[[self.basicSettingList objectAtIndex:[indexPath row]] objectForKey:@"default"] stringValue]; |
|
308 |
break; |
|
309 |
case 2: |
|
3574 | 310 |
/*sw = (UISwitch *)cell.accessoryView; |
3573 | 311 |
[sw setOn:!sw.on animated:YES]; |
3574 | 312 |
[self toggleSwitch:sw];*/ |
3573 | 313 |
break; |
314 |
default: |
|
315 |
break; |
|
3547 | 316 |
} |
3697 | 317 |
|
3547 | 318 |
[aTableView deselectRowAtIndexPath:indexPath animated:YES]; |
319 |
} |
|
320 |
||
3659 | 321 |
-(NSString *)tableView:(UITableView *)aTableView titleForHeaderInSection:(NSInteger)section { |
322 |
NSString *sectionTitle = nil; |
|
323 |
switch (section) { |
|
324 |
case 0: |
|
325 |
sectionTitle = NSLocalizedString(@"Scheme Name", @""); |
|
326 |
break; |
|
327 |
case 1: |
|
328 |
sectionTitle = NSLocalizedString(@"Game Settings", @""); |
|
329 |
break; |
|
330 |
case 2: |
|
331 |
sectionTitle = NSLocalizedString(@"Game Modifiers", @""); |
|
332 |
break; |
|
333 |
default: |
|
334 |
DLog(@"nope"); |
|
335 |
break; |
|
336 |
} |
|
337 |
return sectionTitle; |
|
338 |
} |
|
3547 | 339 |
|
340 |
#pragma mark - |
|
341 |
#pragma mark Memory management |
|
342 |
-(void) didReceiveMemoryWarning { |
|
343 |
[super didReceiveMemoryWarning]; |
|
344 |
} |
|
345 |
||
346 |
-(void) viewDidUnload { |
|
3659 | 347 |
self.schemeName = nil; |
3547 | 348 |
self.schemeArray = nil; |
349 |
self.basicSettingList = nil; |
|
350 |
self.gameModifierArray = nil; |
|
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
|
351 |
MSG_DIDUNLOAD(); |
3547 | 352 |
[super viewDidUnload]; |
353 |
} |
|
354 |
||
355 |
-(void) dealloc { |
|
3659 | 356 |
[schemeName release]; |
3547 | 357 |
[schemeArray release]; |
358 |
[basicSettingList release]; |
|
359 |
[gameModifierArray release]; |
|
360 |
[super dealloc]; |
|
361 |
} |
|
362 |
||
363 |
@end |