author | antonc27 <antonc27@mail.ru> |
Sat, 30 Dec 2017 01:22:11 +0100 | |
branch | ios-develop |
changeset 12877 | 00215a7ec5f5 |
parent 11287 | 9c021eadd374 |
child 13172 | c129707eb1e6 |
permissions | -rw-r--r-- |
4281 | 1 |
/* |
2 |
* Hedgewars-iOS, a Hedgewars port for iOS devices |
|
6700 | 3 |
* Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@gmail.com> |
4281 | 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 |
|
10108
c68cf030eded
update FSF address. note: two sdl include files (by Sam Lantinga) still have the old FSF address in their copyright - but I ain't gonna touch their copyright headers
sheepluva
parents:
8835
diff
changeset
|
16 |
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
4281 | 17 |
*/ |
18 |
||
19 |
||
20 |
#import "CreationChamber.h" |
|
8835 | 21 |
#import "weapons.h" |
6832 | 22 |
|
6103 | 23 |
@implementation CreationChamber |
24 |
||
6865 | 25 |
#pragma mark Checking status |
12877
00215a7ec5f5
- BIG CHANGE: Convert iOS project to use ARC
antonc27 <antonc27@mail.ru>
parents:
11287
diff
changeset
|
26 |
+ (void)createFirstLaunch { |
6865 | 27 |
DLog(@"Creating necessary files"); |
28 |
NSInteger index; |
|
29 |
||
30 |
// SAVES - just delete and overwrite |
|
31 |
if ([[NSFileManager defaultManager] fileExistsAtPath:SAVES_DIRECTORY()]) |
|
32 |
[[NSFileManager defaultManager] removeItemAtPath:SAVES_DIRECTORY() error:NULL]; |
|
33 |
[[NSFileManager defaultManager] createDirectoryAtPath:SAVES_DIRECTORY() |
|
34 |
withIntermediateDirectories:NO |
|
35 |
attributes:nil |
|
36 |
error:NULL]; |
|
37 |
||
38 |
// SCREENSHOTS - just create it the first time |
|
39 |
if ([[NSFileManager defaultManager] fileExistsAtPath:SCREENSHOTS_DIRECTORY()] == NO) |
|
40 |
[[NSFileManager defaultManager] createDirectoryAtPath:SCREENSHOTS_DIRECTORY() |
|
41 |
withIntermediateDirectories:NO |
|
42 |
attributes:nil |
|
43 |
error:NULL]; |
|
44 |
||
45 |
// SETTINGS - nsuserdefaults ftw |
|
46 |
[self createSettings]; |
|
47 |
||
48 |
// TEAMS - update exisiting teams with new format |
|
49 |
NSArray *teamNames = [[NSArray alloc] initWithObjects:@"Edit Me!",@"Ninjas",@"Pirates",@"Robots",nil]; |
|
50 |
index = 0; |
|
51 |
for (NSString *name in teamNames) |
|
52 |
[self createTeamNamed:name ofType:index++ controlledByAI:[name isEqualToString:@"Robots"]]; |
|
53 |
||
54 |
// SCHEMES - always overwrite and delete custom ones |
|
55 |
if ([[NSFileManager defaultManager] fileExistsAtPath:SCHEMES_DIRECTORY()] == YES) |
|
56 |
[[NSFileManager defaultManager] removeItemAtPath:SCHEMES_DIRECTORY() error:NULL]; |
|
57 |
NSArray *schemeNames = [[NSArray alloc] initWithObjects:@"Default",@"Pro Mode",@"Shoppa",@"Clean Slate", |
|
58 |
@"Minefield",@"Barrel Mayhem",@"Tunnel Hogs",@"Fort Mode",@"Timeless", |
|
11192
3dbea499390d
- 'Construction Mode' ammo set and game parameters added to iOS front-end
antonc27 <antonc27@mail.ru>
parents:
11191
diff
changeset
|
59 |
@"Thinking with Portals",@"King Mode",@"Construction Mode",nil]; |
6865 | 60 |
index = 0; |
61 |
for (NSString *name in schemeNames) |
|
62 |
[self createSchemeNamed:name ofType:index++]; |
|
63 |
||
64 |
// WEAPONS - always overwrite as merge is not needed (missing weaps are 0ed automatically) |
|
65 |
NSArray *weaponNames = [[NSArray alloc] initWithObjects:@"Default",@"Crazy",@"Pro Mode",@"Shoppa",@"Clean Slate", |
|
11194
d77ffd68e1cd
- 'Shoppa Pro' ammo set added to iOS front-end
antonc27 <antonc27@mail.ru>
parents:
11192
diff
changeset
|
66 |
@"Minefield",@"Thinking with Portals",@"One of Everything",@"Highlander",@"Construction Mode",@"Shoppa Pro",nil]; |
6865 | 67 |
index = 0; |
68 |
for (NSString *name in weaponNames) |
|
69 |
[self createWeaponNamed:name ofType:index++]; |
|
70 |
} |
|
71 |
||
6103 | 72 |
#pragma mark Settings |
12877
00215a7ec5f5
- BIG CHANGE: Convert iOS project to use ARC
antonc27 <antonc27@mail.ru>
parents:
11287
diff
changeset
|
73 |
+ (void)createSettings { |
5206 | 74 |
NSUserDefaults *settings = [NSUserDefaults standardUserDefaults]; |
75 |
[settings setObject:[NSNumber numberWithBool:NO] forKey:@"alternate"]; |
|
76 |
[settings setObject:[NSNumber numberWithBool:YES] forKey:@"music"]; |
|
77 |
[settings setObject:[NSNumber numberWithBool:YES] forKey:@"sound"]; |
|
5451
e359a79e3d08
rip out the sync weapons/schemes switch and place it into settings; also perform some runtime check on what can be enabled
koda
parents:
5376
diff
changeset
|
78 |
[settings setObject:[NSNumber numberWithBool:YES] forKey:@"sync_ws"]; |
e359a79e3d08
rip out the sync weapons/schemes switch and place it into settings; also perform some runtime check on what can be enabled
koda
parents:
5376
diff
changeset
|
79 |
|
5207
4c9ae0f484da
some general tweaks (more intelligent use of macros and more caching)
koda
parents:
5206
diff
changeset
|
80 |
// don't overwrite these two strings when present |
4c9ae0f484da
some general tweaks (more intelligent use of macros and more caching)
koda
parents:
5206
diff
changeset
|
81 |
if ([settings objectForKey:@"username"] == nil) |
4c9ae0f484da
some general tweaks (more intelligent use of macros and more caching)
koda
parents:
5206
diff
changeset
|
82 |
[settings setObject:@"" forKey:@"username"]; |
4c9ae0f484da
some general tweaks (more intelligent use of macros and more caching)
koda
parents:
5206
diff
changeset
|
83 |
if ([settings objectForKey:@"password"] == nil) |
4c9ae0f484da
some general tweaks (more intelligent use of macros and more caching)
koda
parents:
5206
diff
changeset
|
84 |
[settings setObject:@"" forKey:@"password"]; |
5206 | 85 |
|
86 |
[settings synchronize]; |
|
87 |
} |
|
4281 | 88 |
|
6103 | 89 |
#pragma mark Teams |
12877
00215a7ec5f5
- BIG CHANGE: Convert iOS project to use ARC
antonc27 <antonc27@mail.ru>
parents:
11287
diff
changeset
|
90 |
+ (void)createTeamNamed:(NSString *)nameWithoutExt { |
6865 | 91 |
[self createTeamNamed:nameWithoutExt ofType:0 controlledByAI:NO]; |
6103 | 92 |
} |
93 |
||
12877
00215a7ec5f5
- BIG CHANGE: Convert iOS project to use ARC
antonc27 <antonc27@mail.ru>
parents:
11287
diff
changeset
|
94 |
+ (void)createTeamNamed:(NSString *)nameWithoutExt ofType:(NSInteger)type { |
6865 | 95 |
[self createTeamNamed:nameWithoutExt ofType:type controlledByAI:NO]; |
6103 | 96 |
} |
97 |
||
12877
00215a7ec5f5
- BIG CHANGE: Convert iOS project to use ARC
antonc27 <antonc27@mail.ru>
parents:
11287
diff
changeset
|
98 |
+ (void)createTeamNamed:(NSString *)nameWithoutExt ofType:(NSInteger)type controlledByAI:(BOOL) shouldAITakeOver { |
4281 | 99 |
NSString *teamsDirectory = TEAMS_DIRECTORY(); |
100 |
||
101 |
if (![[NSFileManager defaultManager] fileExistsAtPath: teamsDirectory]) { |
|
102 |
[[NSFileManager defaultManager] createDirectoryAtPath:teamsDirectory |
|
103 |
withIntermediateDirectories:NO |
|
104 |
attributes:nil |
|
105 |
error:NULL]; |
|
106 |
} |
|
107 |
||
6104 | 108 |
NSArray *customNames; |
109 |
NSArray *customHats; |
|
110 |
NSString *flag, *grave, *voicepack, *fort; |
|
111 |
switch (type) { |
|
112 |
default: // default |
|
113 |
customNames = [[NSArray alloc] initWithObjects:@"No Name",@"Unnamed",@"Anonymous",@"Nameless",@"Incognito",@"Unidentified", |
|
114 |
@"Uknown",@"Secret",nil]; |
|
115 |
customHats = [[NSArray alloc] initWithObjects:@"NoHat",@"NoHat",@"NoHat",@"NoHat",@"NoHat",@"NoHat",@"NoHat",@"NoHat",nil]; |
|
116 |
flag = @"hedgewars"; |
|
117 |
grave = @"Statue"; |
|
118 |
voicepack = @"Default"; |
|
119 |
fort = @"Plane"; |
|
120 |
break; |
|
121 |
case 1: // ninjas |
|
122 |
customNames = [[NSArray alloc] initWithObjects:@"Shinobi",@"Ukemi",@"Godai",@"Ninpo",@"Tatsujin",@"Arashi",@"Bushi",@"Itami",nil]; |
|
123 |
customHats = [[NSArray alloc] initWithObjects:@"NinjaFull",@"NinjaStraight",@"NinjaTriangle",@"NinjaFull",@"NinjaStraight", |
|
124 |
@"NinjaTriangle",@"NinjaFull",@"NinjaTriangle",nil]; |
|
125 |
flag = @"japan"; |
|
126 |
grave = @"bp2"; |
|
127 |
voicepack = @"Singer"; |
|
128 |
fort = @"Wood"; |
|
129 |
break; |
|
130 |
case 2: // pirates |
|
131 |
customNames = [[NSArray alloc] initWithObjects:@"Toothless Wayne",@"Long-nose Kidd",@"Eye-patch Jim",@"Rackham Blood",@"One-eyed Ayee", |
|
132 |
@"Dirty Ben",@"Morris",@"Cruise Seymour",nil]; |
|
133 |
customHats = [[NSArray alloc] initWithObjects:@"pirate_jack_bandana",@"pirate_jack",@"dwarf",@"pirate_jack_bandana",@"pirate_jack", |
|
134 |
@"dwarf",@"pirate_jack_bandana",@"pirate_jack",nil]; |
|
135 |
flag = @"cm_pirate"; |
|
136 |
grave = @"chest"; |
|
137 |
voicepack = @"Pirate"; |
|
138 |
fort = @"Hydrant"; |
|
139 |
break; |
|
140 |
case 3: // robots |
|
141 |
customNames = [[NSArray alloc] initWithObjects:@"HAL",@"R2-D2",@"Wall-E",@"Robocop",@"Optimus Prime",@"Terminator",@"C-3PO",@"KITT",nil]; |
|
142 |
customHats = [[NSArray alloc] initWithObjects:@"cyborg1",@"cyborg2",@"cyborg1",@"cyborg2",@"cyborg1",@"cyborg2",@"cyborg1", |
|
143 |
@"cyborg2",nil]; |
|
144 |
flag = @"cm_binary"; |
|
145 |
grave = @"Rip"; |
|
146 |
voicepack = @"Robot"; |
|
147 |
fort = @"UFO"; |
|
148 |
break; |
|
149 |
} |
|
4281 | 150 |
|
6104 | 151 |
NSMutableArray *hedgehogs = [[NSMutableArray alloc] initWithCapacity:HW_getMaxNumberOfHogs()]; |
4281 | 152 |
for (int i = 0; i < HW_getMaxNumberOfHogs(); i++) { |
153 |
NSDictionary *hog = [[NSDictionary alloc] initWithObjectsAndKeys: |
|
6104 | 154 |
[NSNumber numberWithInt:(shouldAITakeOver ? 4 : 0)],@"level", |
155 |
[customNames objectAtIndex:i],@"hogname", |
|
156 |
[customHats objectAtIndex:i],@"hat", |
|
4281 | 157 |
nil]; |
158 |
[hedgehogs addObject:hog]; |
|
159 |
} |
|
160 |
||
161 |
NSDictionary *theTeam = [[NSDictionary alloc] initWithObjectsAndKeys: |
|
162 |
@"0",@"hash", |
|
6104 | 163 |
grave,@"grave", |
164 |
fort,@"fort", |
|
165 |
voicepack,@"voicepack", |
|
166 |
flag,@"flag", |
|
4281 | 167 |
hedgehogs,@"hedgehogs", |
168 |
nil]; |
|
169 |
||
170 |
NSString *teamFile = [[NSString alloc] initWithFormat:@"%@/%@.plist", teamsDirectory, nameWithoutExt]; |
|
171 |
||
172 |
[theTeam writeToFile:teamFile atomically:YES]; |
|
173 |
} |
|
174 |
||
6103 | 175 |
#pragma mark Weapons |
12877
00215a7ec5f5
- BIG CHANGE: Convert iOS project to use ARC
antonc27 <antonc27@mail.ru>
parents:
11287
diff
changeset
|
176 |
+ (void)createWeaponNamed:(NSString *)nameWithoutExt { |
6865 | 177 |
[self createWeaponNamed:nameWithoutExt ofType:0]; |
6103 | 178 |
} |
179 |
||
12877
00215a7ec5f5
- BIG CHANGE: Convert iOS project to use ARC
antonc27 <antonc27@mail.ru>
parents:
11287
diff
changeset
|
180 |
+ (void)createWeaponNamed:(NSString *)nameWithoutExt ofType:(NSInteger)type { |
4281 | 181 |
NSString *weaponsDirectory = WEAPONS_DIRECTORY(); |
182 |
||
183 |
if (![[NSFileManager defaultManager] fileExistsAtPath: weaponsDirectory]) { |
|
184 |
[[NSFileManager defaultManager] createDirectoryAtPath:weaponsDirectory |
|
185 |
withIntermediateDirectories:NO |
|
186 |
attributes:nil |
|
187 |
error:NULL]; |
|
188 |
} |
|
189 |
||
5200
7440fe992e73
* move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents:
5185
diff
changeset
|
190 |
NSInteger ammolineSize = HW_getNumberOfWeapons(); |
7440fe992e73
* move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents:
5185
diff
changeset
|
191 |
NSString *qt, *prob, *delay, *crate; |
4281 | 192 |
switch (type) { |
4607 | 193 |
default: //default |
5200
7440fe992e73
* move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents:
5185
diff
changeset
|
194 |
qt = [[NSString alloc] initWithBytes:AMMOLINE_DEFAULT_QT length:ammolineSize encoding:NSUTF8StringEncoding]; |
5376 | 195 |
prob = [[NSString alloc] initWithBytes:AMMOLINE_DEFAULT_PROB length:ammolineSize encoding:NSUTF8StringEncoding]; |
196 |
delay = [[NSString alloc] initWithBytes:AMMOLINE_DEFAULT_DELAY length:ammolineSize encoding:NSUTF8StringEncoding]; |
|
197 |
crate = [[NSString alloc] initWithBytes:AMMOLINE_DEFAULT_CRATE length:ammolineSize encoding:NSUTF8StringEncoding]; |
|
4281 | 198 |
break; |
6104 | 199 |
case 1: //crazy |
5200
7440fe992e73
* move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents:
5185
diff
changeset
|
200 |
qt = [[NSString alloc] initWithBytes:AMMOLINE_CRAZY_QT length:ammolineSize encoding:NSUTF8StringEncoding]; |
7440fe992e73
* move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents:
5185
diff
changeset
|
201 |
prob = [[NSString alloc] initWithBytes:AMMOLINE_CRAZY_PROB length:ammolineSize encoding:NSUTF8StringEncoding]; |
7440fe992e73
* move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents:
5185
diff
changeset
|
202 |
delay = [[NSString alloc] initWithBytes:AMMOLINE_CRAZY_DELAY length:ammolineSize encoding:NSUTF8StringEncoding]; |
7440fe992e73
* move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents:
5185
diff
changeset
|
203 |
crate = [[NSString alloc] initWithBytes:AMMOLINE_CRAZY_CRATE length:ammolineSize encoding:NSUTF8StringEncoding]; |
4281 | 204 |
break; |
6104 | 205 |
case 2: //pro mode |
5200
7440fe992e73
* move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents:
5185
diff
changeset
|
206 |
qt = [[NSString alloc] initWithBytes:AMMOLINE_PROMODE_QT length:ammolineSize encoding:NSUTF8StringEncoding]; |
7440fe992e73
* move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents:
5185
diff
changeset
|
207 |
prob = [[NSString alloc] initWithBytes:AMMOLINE_PROMODE_PROB length:ammolineSize encoding:NSUTF8StringEncoding]; |
7440fe992e73
* move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents:
5185
diff
changeset
|
208 |
delay = [[NSString alloc] initWithBytes:AMMOLINE_PROMODE_DELAY length:ammolineSize encoding:NSUTF8StringEncoding]; |
7440fe992e73
* move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents:
5185
diff
changeset
|
209 |
crate = [[NSString alloc] initWithBytes:AMMOLINE_PROMODE_CRATE length:ammolineSize encoding:NSUTF8StringEncoding]; |
4281 | 210 |
break; |
6104 | 211 |
case 3: //shoppa |
5200
7440fe992e73
* move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents:
5185
diff
changeset
|
212 |
qt = [[NSString alloc] initWithBytes:AMMOLINE_SHOPPA_QT length:ammolineSize encoding:NSUTF8StringEncoding]; |
7440fe992e73
* move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents:
5185
diff
changeset
|
213 |
prob = [[NSString alloc] initWithBytes:AMMOLINE_SHOPPA_PROB length:ammolineSize encoding:NSUTF8StringEncoding]; |
7440fe992e73
* move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents:
5185
diff
changeset
|
214 |
delay = [[NSString alloc] initWithBytes:AMMOLINE_SHOPPA_DELAY length:ammolineSize encoding:NSUTF8StringEncoding]; |
7440fe992e73
* move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents:
5185
diff
changeset
|
215 |
crate = [[NSString alloc] initWithBytes:AMMOLINE_SHOPPA_CRATE length:ammolineSize encoding:NSUTF8StringEncoding]; |
4281 | 216 |
break; |
6104 | 217 |
case 4: //clean slate |
5200
7440fe992e73
* move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents:
5185
diff
changeset
|
218 |
qt = [[NSString alloc] initWithBytes:AMMOLINE_CLEAN_QT length:ammolineSize encoding:NSUTF8StringEncoding]; |
7440fe992e73
* move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents:
5185
diff
changeset
|
219 |
prob = [[NSString alloc] initWithBytes:AMMOLINE_CLEAN_PROB length:ammolineSize encoding:NSUTF8StringEncoding]; |
7440fe992e73
* move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents:
5185
diff
changeset
|
220 |
delay = [[NSString alloc] initWithBytes:AMMOLINE_CLEAN_DELAY length:ammolineSize encoding:NSUTF8StringEncoding]; |
7440fe992e73
* move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents:
5185
diff
changeset
|
221 |
crate = [[NSString alloc] initWithBytes:AMMOLINE_CLEAN_CRATE length:ammolineSize encoding:NSUTF8StringEncoding]; |
4281 | 222 |
break; |
6104 | 223 |
case 5: //minefield |
5200
7440fe992e73
* move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents:
5185
diff
changeset
|
224 |
qt = [[NSString alloc] initWithBytes:AMMOLINE_MINES_QT length:ammolineSize encoding:NSUTF8StringEncoding]; |
7440fe992e73
* move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents:
5185
diff
changeset
|
225 |
prob = [[NSString alloc] initWithBytes:AMMOLINE_MINES_PROB length:ammolineSize encoding:NSUTF8StringEncoding]; |
7440fe992e73
* move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents:
5185
diff
changeset
|
226 |
delay = [[NSString alloc] initWithBytes:AMMOLINE_MINES_DELAY length:ammolineSize encoding:NSUTF8StringEncoding]; |
7440fe992e73
* move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents:
5185
diff
changeset
|
227 |
crate = [[NSString alloc] initWithBytes:AMMOLINE_MINES_CRATE length:ammolineSize encoding:NSUTF8StringEncoding]; |
4284
57a501a69e5f
update iFrontend with new schemes and weaps, fix up smaller glitches
koda
parents:
4281
diff
changeset
|
228 |
break; |
6104 | 229 |
case 6: //thinking with portals |
5200
7440fe992e73
* move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents:
5185
diff
changeset
|
230 |
qt = [[NSString alloc] initWithBytes:AMMOLINE_PORTALS_QT length:ammolineSize encoding:NSUTF8StringEncoding]; |
7440fe992e73
* move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents:
5185
diff
changeset
|
231 |
prob = [[NSString alloc] initWithBytes:AMMOLINE_PORTALS_PROB length:ammolineSize encoding:NSUTF8StringEncoding]; |
7440fe992e73
* move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents:
5185
diff
changeset
|
232 |
delay = [[NSString alloc] initWithBytes:AMMOLINE_PORTALS_DELAY length:ammolineSize encoding:NSUTF8StringEncoding]; |
7440fe992e73
* move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents:
5185
diff
changeset
|
233 |
crate = [[NSString alloc] initWithBytes:AMMOLINE_PORTALS_CRATE length:ammolineSize encoding:NSUTF8StringEncoding]; |
4281 | 234 |
break; |
11190
ee8e2494eaee
- 'One of everything' ammo set added to iOS front-end
antonc27 <antonc27@mail.ru>
parents:
10108
diff
changeset
|
235 |
case 7: //one of everything |
ee8e2494eaee
- 'One of everything' ammo set added to iOS front-end
antonc27 <antonc27@mail.ru>
parents:
10108
diff
changeset
|
236 |
qt = [[NSString alloc] initWithBytes:AMMOLINE_ONEEVERY_QT length:ammolineSize encoding:NSUTF8StringEncoding]; |
ee8e2494eaee
- 'One of everything' ammo set added to iOS front-end
antonc27 <antonc27@mail.ru>
parents:
10108
diff
changeset
|
237 |
prob = [[NSString alloc] initWithBytes:AMMOLINE_ONEEVERY_PROB length:ammolineSize encoding:NSUTF8StringEncoding]; |
ee8e2494eaee
- 'One of everything' ammo set added to iOS front-end
antonc27 <antonc27@mail.ru>
parents:
10108
diff
changeset
|
238 |
delay = [[NSString alloc] initWithBytes:AMMOLINE_ONEEVERY_DELAY length:ammolineSize encoding:NSUTF8StringEncoding]; |
ee8e2494eaee
- 'One of everything' ammo set added to iOS front-end
antonc27 <antonc27@mail.ru>
parents:
10108
diff
changeset
|
239 |
crate = [[NSString alloc] initWithBytes:AMMOLINE_ONEEVERY_CRATE length:ammolineSize encoding:NSUTF8StringEncoding]; |
ee8e2494eaee
- 'One of everything' ammo set added to iOS front-end
antonc27 <antonc27@mail.ru>
parents:
10108
diff
changeset
|
240 |
break; |
11191
fa6f6e8b927c
- 'Highlander' ammo set added to iOS front-end
antonc27 <antonc27@mail.ru>
parents:
11190
diff
changeset
|
241 |
case 8: //highlander |
fa6f6e8b927c
- 'Highlander' ammo set added to iOS front-end
antonc27 <antonc27@mail.ru>
parents:
11190
diff
changeset
|
242 |
qt = [[NSString alloc] initWithBytes:AMMOLINE_HIGHLANDER_QT length:ammolineSize encoding:NSUTF8StringEncoding]; |
fa6f6e8b927c
- 'Highlander' ammo set added to iOS front-end
antonc27 <antonc27@mail.ru>
parents:
11190
diff
changeset
|
243 |
prob = [[NSString alloc] initWithBytes:AMMOLINE_HIGHLANDER_PROB length:ammolineSize encoding:NSUTF8StringEncoding]; |
fa6f6e8b927c
- 'Highlander' ammo set added to iOS front-end
antonc27 <antonc27@mail.ru>
parents:
11190
diff
changeset
|
244 |
delay = [[NSString alloc] initWithBytes:AMMOLINE_HIGHLANDER_DELAY length:ammolineSize encoding:NSUTF8StringEncoding]; |
fa6f6e8b927c
- 'Highlander' ammo set added to iOS front-end
antonc27 <antonc27@mail.ru>
parents:
11190
diff
changeset
|
245 |
crate = [[NSString alloc] initWithBytes:AMMOLINE_HIGHLANDER_CRATE length:ammolineSize encoding:NSUTF8StringEncoding]; |
fa6f6e8b927c
- 'Highlander' ammo set added to iOS front-end
antonc27 <antonc27@mail.ru>
parents:
11190
diff
changeset
|
246 |
break; |
11192
3dbea499390d
- 'Construction Mode' ammo set and game parameters added to iOS front-end
antonc27 <antonc27@mail.ru>
parents:
11191
diff
changeset
|
247 |
case 9: //construction mode |
3dbea499390d
- 'Construction Mode' ammo set and game parameters added to iOS front-end
antonc27 <antonc27@mail.ru>
parents:
11191
diff
changeset
|
248 |
qt = [[NSString alloc] initWithBytes:AMMOLINE_CONSTRUCTION_QT length:ammolineSize encoding:NSUTF8StringEncoding]; |
3dbea499390d
- 'Construction Mode' ammo set and game parameters added to iOS front-end
antonc27 <antonc27@mail.ru>
parents:
11191
diff
changeset
|
249 |
prob = [[NSString alloc] initWithBytes:AMMOLINE_CONSTRUCTION_PROB length:ammolineSize encoding:NSUTF8StringEncoding]; |
3dbea499390d
- 'Construction Mode' ammo set and game parameters added to iOS front-end
antonc27 <antonc27@mail.ru>
parents:
11191
diff
changeset
|
250 |
delay = [[NSString alloc] initWithBytes:AMMOLINE_CONSTRUCTION_DELAY length:ammolineSize encoding:NSUTF8StringEncoding]; |
3dbea499390d
- 'Construction Mode' ammo set and game parameters added to iOS front-end
antonc27 <antonc27@mail.ru>
parents:
11191
diff
changeset
|
251 |
crate = [[NSString alloc] initWithBytes:AMMOLINE_CONSTRUCTION_CRATE length:ammolineSize encoding:NSUTF8StringEncoding]; |
3dbea499390d
- 'Construction Mode' ammo set and game parameters added to iOS front-end
antonc27 <antonc27@mail.ru>
parents:
11191
diff
changeset
|
252 |
break; |
11194
d77ffd68e1cd
- 'Shoppa Pro' ammo set added to iOS front-end
antonc27 <antonc27@mail.ru>
parents:
11192
diff
changeset
|
253 |
case 10: //shoppa pro |
d77ffd68e1cd
- 'Shoppa Pro' ammo set added to iOS front-end
antonc27 <antonc27@mail.ru>
parents:
11192
diff
changeset
|
254 |
qt = [[NSString alloc] initWithBytes:AMMOLINE_SHOPPAPRO_QT length:ammolineSize encoding:NSUTF8StringEncoding]; |
d77ffd68e1cd
- 'Shoppa Pro' ammo set added to iOS front-end
antonc27 <antonc27@mail.ru>
parents:
11192
diff
changeset
|
255 |
prob = [[NSString alloc] initWithBytes:AMMOLINE_SHOPPAPRO_PROB length:ammolineSize encoding:NSUTF8StringEncoding]; |
d77ffd68e1cd
- 'Shoppa Pro' ammo set added to iOS front-end
antonc27 <antonc27@mail.ru>
parents:
11192
diff
changeset
|
256 |
delay = [[NSString alloc] initWithBytes:AMMOLINE_SHOPPAPRO_DELAY length:ammolineSize encoding:NSUTF8StringEncoding]; |
d77ffd68e1cd
- 'Shoppa Pro' ammo set added to iOS front-end
antonc27 <antonc27@mail.ru>
parents:
11192
diff
changeset
|
257 |
crate = [[NSString alloc] initWithBytes:AMMOLINE_SHOPPAPRO_CRATE length:ammolineSize encoding:NSUTF8StringEncoding]; |
d77ffd68e1cd
- 'Shoppa Pro' ammo set added to iOS front-end
antonc27 <antonc27@mail.ru>
parents:
11192
diff
changeset
|
258 |
break; |
4281 | 259 |
} |
260 |
||
5200
7440fe992e73
* move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents:
5185
diff
changeset
|
261 |
NSDictionary *theWeapon = [[NSDictionary alloc] initWithObjectsAndKeys: qt,@"ammostore_initialqt", |
7440fe992e73
* move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents:
5185
diff
changeset
|
262 |
prob,@"ammostore_probability", delay,@"ammostore_delay", crate,@"ammostore_crate", nil]; |
7440fe992e73
* move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents:
5185
diff
changeset
|
263 |
|
4281 | 264 |
NSString *weaponFile = [[NSString alloc] initWithFormat:@"%@/%@.plist", weaponsDirectory, nameWithoutExt]; |
265 |
[theWeapon writeToFile:weaponFile atomically:YES]; |
|
266 |
} |
|
267 |
||
6103 | 268 |
#pragma mark Schemes |
12877
00215a7ec5f5
- BIG CHANGE: Convert iOS project to use ARC
antonc27 <antonc27@mail.ru>
parents:
11287
diff
changeset
|
269 |
+ (void)createSchemeNamed:(NSString *)nameWithoutExt { |
6865 | 270 |
[self createSchemeNamed:nameWithoutExt ofType:0]; |
6103 | 271 |
} |
272 |
||
12877
00215a7ec5f5
- BIG CHANGE: Convert iOS project to use ARC
antonc27 <antonc27@mail.ru>
parents:
11287
diff
changeset
|
273 |
+ (void)createSchemeNamed:(NSString *)nameWithoutExt ofType:(NSInteger)type { |
4281 | 274 |
NSString *schemesDirectory = SCHEMES_DIRECTORY(); |
275 |
||
276 |
if (![[NSFileManager defaultManager] fileExistsAtPath: schemesDirectory]) { |
|
277 |
[[NSFileManager defaultManager] createDirectoryAtPath:schemesDirectory |
|
278 |
withIntermediateDirectories:NO |
|
279 |
attributes:nil |
|
280 |
error:NULL]; |
|
281 |
} |
|
282 |
||
5181 | 283 |
// load data to get the size of the arrays and their default values |
5185
7607a64e1853
remove the trailing _en from scheme data and use the macros available instead of creating a string every time
koda
parents:
5181
diff
changeset
|
284 |
NSArray *basicSettings = [[NSArray alloc] initWithContentsOfFile:BASICFLAGS_FILE()]; |
5181 | 285 |
NSMutableArray *basicArray = [[NSMutableArray alloc] initWithCapacity:[basicSettings count]]; |
286 |
for (NSDictionary *basicDict in basicSettings) |
|
287 |
[basicArray addObject:[basicDict objectForKey:@"default"]]; |
|
4281 | 288 |
|
5185
7607a64e1853
remove the trailing _en from scheme data and use the macros available instead of creating a string every time
koda
parents:
5181
diff
changeset
|
289 |
NSArray *mods = [[NSArray alloc] initWithContentsOfFile:GAMEMODS_FILE()]; |
5181 | 290 |
NSMutableArray *gamemodArray= [[NSMutableArray alloc] initWithCapacity:[mods count]]; |
6908
896ed2afcfb8
ios: turn on more warning messages and start correcting them
koda
parents:
6865
diff
changeset
|
291 |
for (NSUInteger i = 0; i < [mods count]; i++) |
5181 | 292 |
[gamemodArray addObject:[NSNumber numberWithBool:NO]]; |
293 |
||
5984 | 294 |
switch (type) { |
6104 | 295 |
default: // default |
5984 | 296 |
[gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]]; |
297 |
break; |
|
6104 | 298 |
case 1: // pro mode |
5984 | 299 |
[basicArray replaceObjectAtIndex:2 withObject:[NSNumber numberWithInt:15]]; |
300 |
[basicArray replaceObjectAtIndex:7 withObject:[NSNumber numberWithInt:0]]; |
|
301 |
[basicArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithInt:0]]; |
|
302 |
[gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]]; |
|
303 |
[gamemodArray replaceObjectAtIndex:14 withObject:[NSNumber numberWithBool:YES]]; |
|
304 |
break; |
|
6104 | 305 |
case 2: // shoppa |
5984 | 306 |
[basicArray replaceObjectAtIndex:2 withObject:[NSNumber numberWithInt:30]]; |
307 |
[basicArray replaceObjectAtIndex:3 withObject:[NSNumber numberWithInt:50]]; |
|
308 |
[basicArray replaceObjectAtIndex:7 withObject:[NSNumber numberWithInt:1]]; |
|
309 |
[basicArray replaceObjectAtIndex:8 withObject:[NSNumber numberWithInt:0]]; |
|
310 |
[basicArray replaceObjectAtIndex:9 withObject:[NSNumber numberWithInt:25]]; |
|
311 |
[basicArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithInt:0]]; |
|
312 |
[basicArray replaceObjectAtIndex:13 withObject:[NSNumber numberWithInt:0]]; |
|
11287
9c021eadd374
- Added 'Air Mines' flag for Scheme Settings
antonc27 <antonc27@mail.ru>
parents:
11194
diff
changeset
|
313 |
[basicArray replaceObjectAtIndex:15 withObject:[NSNumber numberWithInt:8]]; |
5984 | 314 |
[gamemodArray replaceObjectAtIndex:1 withObject:[NSNumber numberWithBool:YES]]; |
315 |
[gamemodArray replaceObjectAtIndex:2 withObject:[NSNumber numberWithBool:YES]]; |
|
316 |
[gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]]; |
|
317 |
[gamemodArray replaceObjectAtIndex:14 withObject:[NSNumber numberWithBool:YES]]; |
|
318 |
[gamemodArray replaceObjectAtIndex:15 withObject:[NSNumber numberWithBool:YES]]; |
|
319 |
[gamemodArray replaceObjectAtIndex:19 withObject:[NSNumber numberWithBool:YES]]; |
|
320 |
break; |
|
6104 | 321 |
case 3: // clean slate |
5984 | 322 |
[gamemodArray replaceObjectAtIndex:6 withObject:[NSNumber numberWithBool:YES]]; |
323 |
[gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]]; |
|
324 |
[gamemodArray replaceObjectAtIndex:18 withObject:[NSNumber numberWithBool:YES]]; |
|
325 |
[gamemodArray replaceObjectAtIndex:19 withObject:[NSNumber numberWithBool:YES]]; |
|
326 |
break; |
|
6104 | 327 |
case 4: // minefield |
5984 | 328 |
[basicArray replaceObjectAtIndex:0 withObject:[NSNumber numberWithInt:50]]; |
329 |
[basicArray replaceObjectAtIndex:2 withObject:[NSNumber numberWithInt:30]]; |
|
330 |
[basicArray replaceObjectAtIndex:7 withObject:[NSNumber numberWithInt:0]]; |
|
331 |
[basicArray replaceObjectAtIndex:10 withObject:[NSNumber numberWithInt:0]]; |
|
332 |
[basicArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithInt:80]]; |
|
333 |
[basicArray replaceObjectAtIndex:13 withObject:[NSNumber numberWithInt:0]]; |
|
334 |
[gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]]; |
|
335 |
[gamemodArray replaceObjectAtIndex:14 withObject:[NSNumber numberWithBool:YES]]; |
|
336 |
[gamemodArray replaceObjectAtIndex:15 withObject:[NSNumber numberWithBool:YES]]; |
|
337 |
break; |
|
6104 | 338 |
case 5: // barrel mayhem |
5984 | 339 |
[basicArray replaceObjectAtIndex:2 withObject:[NSNumber numberWithInt:30]]; |
340 |
[basicArray replaceObjectAtIndex:7 withObject:[NSNumber numberWithInt:0]]; |
|
341 |
[basicArray replaceObjectAtIndex:10 withObject:[NSNumber numberWithInt:0]]; |
|
342 |
[basicArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithInt:0]]; |
|
343 |
[basicArray replaceObjectAtIndex:13 withObject:[NSNumber numberWithInt:40]]; |
|
344 |
[gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]]; |
|
345 |
[gamemodArray replaceObjectAtIndex:14 withObject:[NSNumber numberWithBool:YES]]; |
|
346 |
break; |
|
6104 | 347 |
case 6: // tunnel hogs |
5984 | 348 |
[basicArray replaceObjectAtIndex:2 withObject:[NSNumber numberWithInt:30]]; |
349 |
[basicArray replaceObjectAtIndex:9 withObject:[NSNumber numberWithInt:3]]; |
|
350 |
[basicArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithInt:10]]; |
|
351 |
[basicArray replaceObjectAtIndex:12 withObject:[NSNumber numberWithInt:10]]; |
|
352 |
[basicArray replaceObjectAtIndex:13 withObject:[NSNumber numberWithInt:10]]; |
|
11287
9c021eadd374
- Added 'Air Mines' flag for Scheme Settings
antonc27 <antonc27@mail.ru>
parents:
11194
diff
changeset
|
353 |
[basicArray replaceObjectAtIndex:15 withObject:[NSNumber numberWithInt:4]]; |
5984 | 354 |
[gamemodArray replaceObjectAtIndex:2 withObject:[NSNumber numberWithBool:YES]]; |
355 |
[gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]]; |
|
356 |
[gamemodArray replaceObjectAtIndex:14 withObject:[NSNumber numberWithBool:YES]]; |
|
357 |
[gamemodArray replaceObjectAtIndex:15 withObject:[NSNumber numberWithBool:YES]]; |
|
358 |
[gamemodArray replaceObjectAtIndex:16 withObject:[NSNumber numberWithBool:YES]]; |
|
359 |
break; |
|
6104 | 360 |
case 7: // fort mode |
5984 | 361 |
[basicArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithInt:0]]; |
362 |
[basicArray replaceObjectAtIndex:13 withObject:[NSNumber numberWithInt:0]]; |
|
363 |
[gamemodArray replaceObjectAtIndex:2 withObject:[NSNumber numberWithBool:YES]]; |
|
364 |
[gamemodArray replaceObjectAtIndex:3 withObject:[NSNumber numberWithBool:YES]]; |
|
365 |
[gamemodArray replaceObjectAtIndex:10 withObject:[NSNumber numberWithBool:YES]]; |
|
366 |
[gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]]; |
|
367 |
break; |
|
6104 | 368 |
case 8: // timeless |
5984 | 369 |
[basicArray replaceObjectAtIndex:2 withObject:[NSNumber numberWithInt:100]]; |
370 |
[basicArray replaceObjectAtIndex:4 withObject:[NSNumber numberWithInt:0]]; |
|
371 |
[basicArray replaceObjectAtIndex:5 withObject:[NSNumber numberWithInt:0]]; |
|
372 |
[basicArray replaceObjectAtIndex:9 withObject:[NSNumber numberWithInt:30]]; |
|
373 |
[basicArray replaceObjectAtIndex:10 withObject:[NSNumber numberWithInt:5]]; |
|
374 |
[basicArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithInt:3]]; |
|
375 |
[basicArray replaceObjectAtIndex:12 withObject:[NSNumber numberWithInt:10]]; |
|
376 |
[gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]]; |
|
377 |
[gamemodArray replaceObjectAtIndex:20 withObject:[NSNumber numberWithBool:YES]]; |
|
378 |
break; |
|
6104 | 379 |
case 9: // thinking with portals |
5984 | 380 |
[basicArray replaceObjectAtIndex:7 withObject:[NSNumber numberWithInt:2]]; |
381 |
[basicArray replaceObjectAtIndex:8 withObject:[NSNumber numberWithInt:25]]; |
|
382 |
[basicArray replaceObjectAtIndex:10 withObject:[NSNumber numberWithInt:4]]; |
|
383 |
[basicArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithInt:5]]; |
|
384 |
[basicArray replaceObjectAtIndex:13 withObject:[NSNumber numberWithInt:5]]; |
|
11287
9c021eadd374
- Added 'Air Mines' flag for Scheme Settings
antonc27 <antonc27@mail.ru>
parents:
11194
diff
changeset
|
385 |
[basicArray replaceObjectAtIndex:15 withObject:[NSNumber numberWithInt:4]]; |
5984 | 386 |
[gamemodArray replaceObjectAtIndex:9 withObject:[NSNumber numberWithBool:YES]]; |
387 |
[gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]]; |
|
388 |
break; |
|
6104 | 389 |
case 10: // king mode |
5984 | 390 |
[gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]]; |
391 |
[gamemodArray replaceObjectAtIndex:12 withObject:[NSNumber numberWithBool:YES]]; |
|
392 |
break; |
|
11192
3dbea499390d
- 'Construction Mode' ammo set and game parameters added to iOS front-end
antonc27 <antonc27@mail.ru>
parents:
11191
diff
changeset
|
393 |
case 11: // construction mode |
3dbea499390d
- 'Construction Mode' ammo set and game parameters added to iOS front-end
antonc27 <antonc27@mail.ru>
parents:
11191
diff
changeset
|
394 |
[basicArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithInt:0]]; |
3dbea499390d
- 'Construction Mode' ammo set and game parameters added to iOS front-end
antonc27 <antonc27@mail.ru>
parents:
11191
diff
changeset
|
395 |
[basicArray replaceObjectAtIndex:13 withObject:[NSNumber numberWithInt:0]]; |
3dbea499390d
- 'Construction Mode' ammo set and game parameters added to iOS front-end
antonc27 <antonc27@mail.ru>
parents:
11191
diff
changeset
|
396 |
[gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]]; |
3dbea499390d
- 'Construction Mode' ammo set and game parameters added to iOS front-end
antonc27 <antonc27@mail.ru>
parents:
11191
diff
changeset
|
397 |
[gamemodArray replaceObjectAtIndex:15 withObject:[NSNumber numberWithBool:YES]]; |
3dbea499390d
- 'Construction Mode' ammo set and game parameters added to iOS front-end
antonc27 <antonc27@mail.ru>
parents:
11191
diff
changeset
|
398 |
[gamemodArray replaceObjectAtIndex:16 withObject:[NSNumber numberWithBool:YES]]; |
3dbea499390d
- 'Construction Mode' ammo set and game parameters added to iOS front-end
antonc27 <antonc27@mail.ru>
parents:
11191
diff
changeset
|
399 |
[gamemodArray replaceObjectAtIndex:18 withObject:[NSNumber numberWithBool:YES]]; |
3dbea499390d
- 'Construction Mode' ammo set and game parameters added to iOS front-end
antonc27 <antonc27@mail.ru>
parents:
11191
diff
changeset
|
400 |
[gamemodArray replaceObjectAtIndex:20 withObject:[NSNumber numberWithBool:YES]]; |
3dbea499390d
- 'Construction Mode' ammo set and game parameters added to iOS front-end
antonc27 <antonc27@mail.ru>
parents:
11191
diff
changeset
|
401 |
break; |
5984 | 402 |
} |
5181 | 403 |
|
4281 | 404 |
NSMutableDictionary *theScheme = [[NSMutableDictionary alloc] initWithObjectsAndKeys: |
405 |
basicArray,@"basic", |
|
406 |
gamemodArray,@"gamemod", |
|
407 |
nil]; |
|
5984 | 408 |
|
4281 | 409 |
NSString *schemeFile = [[NSString alloc] initWithFormat:@"%@/%@.plist", schemesDirectory, nameWithoutExt]; |
8441 | 410 |
|
4281 | 411 |
[theScheme writeToFile:schemeFile atomically:YES]; |
412 |
} |
|
6103 | 413 |
|
414 |
@end |