# HG changeset patch
# User koda
# Date 1289602780 -3600
# Node ID 57a501a69e5fa90a02e5ffc549fe5c4b534b847c
# Parent e033cf015b2c2ac822a9274c47411b1386d480da
update iFrontend with new schemes and weaps, fix up smaller glitches
diff -r e033cf015b2c -r 57a501a69e5f project_files/HedgewarsMobile/Classes/CreationChamber.m
--- a/project_files/HedgewarsMobile/Classes/CreationChamber.m Fri Nov 12 22:47:13 2010 +0100
+++ b/project_files/HedgewarsMobile/Classes/CreationChamber.m Fri Nov 12 23:59:40 2010 +0100
@@ -76,45 +76,52 @@
switch (type) {
case 0: //default
theWeapon = [[NSDictionary alloc] initWithObjectsAndKeys:
- @"9391929422199121032235111001201000000211110101011",@"ammostore_initialqt",
- @"0405040541600655546554464776576666666155510101117",@"ammostore_probability",
- @"0000000000000205500000040007004000000000200000000",@"ammostore_delay",
- @"1311110312111111123114111111111111111211111101111",@"ammostore_crate", nil];
+ @"93919294221991210322351110012010000002111101010111",@"ammostore_initialqt",
+ @"04050405416006555465544647765766666661555101011154",@"ammostore_probability",
+ @"00000000000002055000000400070040000000002000000006",@"ammostore_delay",
+ @"13111103121111111231141111111111111112111111011111",@"ammostore_crate", nil];
break;
case 1: //crazy
theWeapon = [[NSDictionary alloc] initWithObjectsAndKeys:
- @"9999999999999999992999999999999999299999999909999",@"ammostore_initialqt",
- @"1111110111111111111111111111111111111111111101111",@"ammostore_probability",
- @"0000000000000000000000000000000000000000000000000",@"ammostore_delay",
- @"1311110312111111123114111111111111111211110101111",@"ammostore_crate", nil];
+ @"99999999999999999929999999999999992999999999099999",@"ammostore_initialqt",
+ @"11111101111111111111111111111111111111111111011111",@"ammostore_probability",
+ @"00000000000000000000000000000000000000000000000000",@"ammostore_delay",
+ @"13111103121111111231141111111111111112111101011111",@"ammostore_crate", nil];
break;
case 2: //pro mode
theWeapon = [[NSDictionary alloc] initWithObjectsAndKeys:
- @"9090009000000000000009000000000000000000000000000",@"ammostore_initialqt",
- @"0000000000000000000000000000000000000000000000000",@"ammostore_probability",
- @"0000000000000205500000040007004000000000200000000",@"ammostore_delay",
- @"1111111111111111111111111111111111111111100101111",@"ammostore_crate", nil];
+ @"90900090000000000000090000000000000000000000000000",@"ammostore_initialqt",
+ @"00000000000000000000000000000000000000000000000000",@"ammostore_probability",
+ @"00000000000002055000000400070040000000002000000000",@"ammostore_delay",
+ @"11111111111111111111111111111111111111111001011111",@"ammostore_crate", nil];
break;
case 3: //shoppa
theWeapon = [[NSDictionary alloc] initWithObjectsAndKeys:
- @"0000009900000000000000000000000000000000000000000",@"ammostore_initialqt",
- @"4444410044244402210112121222422000000002000400010",@"ammostore_probability",
- @"0000000000000000000000000000000000000000000000000",@"ammostore_delay",
- @"1111111111111111111111111111111111111111101101111",@"ammostore_crate", nil];
+ @"00000099000000000000000000000000000000000000000000",@"ammostore_initialqt",
+ @"44444100442444022101121212224220000000020004000100",@"ammostore_probability",
+ @"00000000000000000000000000000000000000000000000000",@"ammostore_delay",
+ @"11111111111111111111111111111111111111111011011111",@"ammostore_crate", nil];
break;
case 4: //clean slate
theWeapon = [[NSDictionary alloc] initWithObjectsAndKeys:
- @"1010009000010000011000000000000000000000000000001",@"ammostore_initialqt",
- @"0405040541600655546554464776576666666155510101117",@"ammostore_probability",
- @"0000000000000205500000040007004000000000200000000",@"ammostore_delay",
- @"1311110312111111123114111111111111111211111101111",@"ammostore_crate", nil];
+ @"10100090000100000110000000000000000000000000000010",@"ammostore_initialqt",
+ @"04050405416006555465544647765766666661555101011154",@"ammostore_probability",
+ @"00000000000002055000000400070040000000002000000000",@"ammostore_delay",
+ @"13111103121111111231141111111111111112111111011111",@"ammostore_crate", nil];
break;
case 5: //minefield
theWeapon = [[NSDictionary alloc] initWithObjectsAndKeys:
- @"0000009900090000000300000000000000000000000000000",@"ammostore_initialqt",
- @"0000000000000000000000000000000000000000000000000",@"ammostore_probability",
- @"0000000000000205500000040007004000000000200000000",@"ammostore_delay",
- @"1111111111111111111111111111111111111111111101111",@"ammostore_crate", nil];
+ @"00000099000900000003000000000000000000000000000000",@"ammostore_initialqt",
+ @"00000000000000000000000000000000000000000000000000",@"ammostore_probability",
+ @"00000000000002055000000400070040000000002000000000",@"ammostore_delay",
+ @"11111111111111111111111111111111111111111111011111",@"ammostore_crate", nil];
+ break;
+ case 6: //thinking with portals
+ theWeapon = [[NSDictionary alloc] initWithObjectsAndKeys:
+ @"90000090020000000021000000000000001100000900000000",@"ammostore_initialqt",
+ @"04050405416006555465544647765766666661555101011154",@"ammostore_probability",
+ @"00000000000002055000000400070040000000002000000006",@"ammostore_delay",
+ @"13111103121111111231141111111111111112111111011111",@"ammostore_crate", nil];
break;
default:
NSLog(@"Nope");
@@ -176,6 +183,7 @@
[NSNumber numberWithBool:NO], //infattack
[NSNumber numberWithBool:NO], //resetweaps
[NSNumber numberWithBool:NO], //perhogammo
+ [NSNumber numberWithBool:NO], //nowind
nil];
NSMutableDictionary *theScheme = [[NSMutableDictionary alloc] initWithObjectsAndKeys:
diff -r e033cf015b2c -r 57a501a69e5f project_files/HedgewarsMobile/Classes/EditableCellView.m
--- a/project_files/HedgewarsMobile/Classes/EditableCellView.m Fri Nov 12 22:47:13 2010 +0100
+++ b/project_files/HedgewarsMobile/Classes/EditableCellView.m Fri Nov 12 23:59:40 2010 +0100
@@ -37,6 +37,7 @@
textField.returnKeyType = UIReturnKeyDone;
textField.adjustsFontSizeToFitWidth = YES;
textField.userInteractionEnabled = YES;
+ textField.font = [UIFont boldSystemFontOfSize:[UIFont labelFontSize]];
[textField addTarget:self action:@selector(save:) forControlEvents:UIControlEventEditingDidEndOnExit];
[self.contentView addSubview:textField];
@@ -76,8 +77,6 @@
skew +=2;
}
- // sometimes the bold property gets lost
- textField.font = [UIFont boldSystemFontOfSize:[UIFont labelFontSize]];
textField.frame = CGRectMake(boundsX+offset+10, skew+10, 300, [UIFont labelFontSize] + 4);
}
diff -r e033cf015b2c -r 57a501a69e5f project_files/HedgewarsMobile/Classes/LevelViewController.m
--- a/project_files/HedgewarsMobile/Classes/LevelViewController.m Fri Nov 12 22:47:13 2010 +0100
+++ b/project_files/HedgewarsMobile/Classes/LevelViewController.m Fri Nov 12 23:59:40 2010 +0100
@@ -144,6 +144,7 @@
[self.tableView deleteSections:sections withRowAnimation:UITableViewRowAnimationFade];
level = 0;
}
+ [sections release];
DLog(@"New level is %d",level);
for (NSMutableDictionary *hog in hogs)
@@ -151,8 +152,6 @@
[self.tableView reloadData];
[[NSNotificationCenter defaultCenter] postNotificationName:@"setWriteNeedTeams" object:nil];
-
- [sections release];
}
@@ -166,8 +165,10 @@
if (newRow != oldRow) {
NSMutableArray *hogs = [self.teamDictionary objectForKey:@"hedgehogs"];
+ NSInteger level = newRow + 1;
for (NSMutableDictionary *hog in hogs)
- [hog setObject:[NSNumber numberWithInt:newRow+1] forKey:@"level"];
+ [hog setObject:[NSNumber numberWithInt:level] forKey:@"level"];
+ DLog(@"New level is %d",level);
// tell our boss to write this new stuff on disk
[[NSNotificationCenter defaultCenter] postNotificationName:@"setWriteNeedTeams" object:nil];
diff -r e033cf015b2c -r 57a501a69e5f project_files/HedgewarsMobile/Classes/MainMenuViewController.m
--- a/project_files/HedgewarsMobile/Classes/MainMenuViewController.m Fri Nov 12 22:47:13 2010 +0100
+++ b/project_files/HedgewarsMobile/Classes/MainMenuViewController.m Fri Nov 12 23:59:40 2010 +0100
@@ -38,7 +38,7 @@
// check if some configuration files are already set; if they are present it means that the current copy must be updated
-(void) createNecessaryFiles {
NSString *sourceFile, *destinationFile;
- NSString *resDir = [[NSBundle mainBundle] resourcePath];
+ NSString *resourcesDir = [[NSBundle mainBundle] resourcePath];
DLog(@"Creating necessary files");
// SAVES - just delete and overwrite
@@ -47,7 +47,7 @@
[[NSFileManager defaultManager] createDirectoryAtPath:SAVES_DIRECTORY() withIntermediateDirectories:NO attributes:nil error:NULL];
// SETTINGS FILE - merge when present
- NSString *baseSettingsFile = [NSString stringWithFormat:@"%@/Settings/settings.plist",resDir];
+ NSString *baseSettingsFile = [[NSString alloc] initWithFormat:@"%@/Settings/settings.plist",resourcesDir];
if ([[NSFileManager defaultManager] fileExistsAtPath:SETTINGS_FILE()]) {
NSDictionary *settings = [[NSDictionary alloc] initWithContentsOfFile:SETTINGS_FILE()];
NSMutableDictionary *update = [[NSMutableDictionary alloc] initWithContentsOfFile:baseSettingsFile];
@@ -58,6 +58,7 @@
[update release];
} else
[[NSFileManager defaultManager] copyItemAtPath:baseSettingsFile toPath:SETTINGS_FILE() error:NULL];
+ [baseSettingsFile release];
// TEAMS - update exisiting teams with new format
if ([[NSFileManager defaultManager] fileExistsAtPath:TEAMS_DIRECTORY()] == NO) {
@@ -66,12 +67,14 @@
attributes:nil
error:NULL];
// we copy teams only the first time because it's unlikely that newer ones are going to be added
- NSString *baseTeamsDir = [NSString stringWithFormat:@"%@/Settings/Teams",resDir];
+ NSString *baseTeamsDir = [[NSString alloc] initWithFormat:@"%@/Settings/Teams/",resourcesDir];
for (NSString *str in [[NSFileManager defaultManager] contentsOfDirectoryAtPath:baseTeamsDir error:NULL]) {
sourceFile = [baseTeamsDir stringByAppendingString:str];
destinationFile = [TEAMS_DIRECTORY() stringByAppendingString:str];
+ [[NSFileManager defaultManager] removeItemAtPath:destinationFile error:NULL];
[[NSFileManager defaultManager] copyItemAtPath:sourceFile toPath:destinationFile error:NULL];
- }
+ }
+ [baseTeamsDir release];
}
// TODO: is merge needed?
@@ -83,12 +86,14 @@
error:NULL];
// TODO: do the merge if necessary
// we overwrite the default ones because it is likely that new modes are added every release
- NSString *baseSchemesDir = [NSString stringWithFormat:@"%@/Settings/Schemes",resDir];
+ NSString *baseSchemesDir = [[NSString alloc] initWithFormat:@"%@/Settings/Schemes/",resourcesDir];
for (NSString *str in [[NSFileManager defaultManager] contentsOfDirectoryAtPath:baseSchemesDir error:NULL]) {
sourceFile = [baseSchemesDir stringByAppendingString:str];
destinationFile = [SCHEMES_DIRECTORY() stringByAppendingString:str];
+ [[NSFileManager defaultManager] removeItemAtPath:destinationFile error:NULL];
[[NSFileManager defaultManager] copyItemAtPath:sourceFile toPath:destinationFile error:NULL];
}
+ [baseSchemesDir release];
// WEAPONS - always overwrite
if ([[NSFileManager defaultManager] fileExistsAtPath:WEAPONS_DIRECTORY()] == NO)
@@ -102,6 +107,7 @@
createWeaponNamed(@"Shoppa", 3);
createWeaponNamed(@"Clean slate", 4);
createWeaponNamed(@"Minefield", 5);
+ createWeaponNamed(@"Thinking with Portals", 6);
DLog(@"Success");
}
diff -r e033cf015b2c -r 57a501a69e5f project_files/HedgewarsMobile/Classes/SingleSchemeViewController.m
--- a/project_files/HedgewarsMobile/Classes/SingleSchemeViewController.m Fri Nov 12 22:47:13 2010 +0100
+++ b/project_files/HedgewarsMobile/Classes/SingleSchemeViewController.m Fri Nov 12 23:59:40 2010 +0100
@@ -153,6 +153,7 @@
if (row == 0) {
editableCell.textField.text = self.schemeName;
+ editableCell.textField.font = [UIFont boldSystemFontOfSize:[UIFont labelFontSize]];
} else {
editableCell.minimumCharacters = 0;
editableCell.textField.font = [UIFont systemFontOfSize:[UIFont labelFontSize]];
diff -r e033cf015b2c -r 57a501a69e5f project_files/HedgewarsMobile/Classes/SingleWeaponViewController.m
--- a/project_files/HedgewarsMobile/Classes/SingleWeaponViewController.m Fri Nov 12 22:47:13 2010 +0100
+++ b/project_files/HedgewarsMobile/Classes/SingleWeaponViewController.m Fri Nov 12 23:59:40 2010 +0100
@@ -150,6 +150,7 @@
if (row == 0) {
editableCell.textField.text = self.weaponName;
+ editableCell.textField.font = [UIFont boldSystemFontOfSize:[UIFont labelFontSize]];
} else {
editableCell.minimumCharacters = 0;
editableCell.textField.font = [UIFont systemFontOfSize:[UIFont labelFontSize]];
diff -r e033cf015b2c -r 57a501a69e5f project_files/HedgewarsMobile/Classes/TeamConfigViewController.m
--- a/project_files/HedgewarsMobile/Classes/TeamConfigViewController.m Fri Nov 12 22:47:13 2010 +0100
+++ b/project_files/HedgewarsMobile/Classes/TeamConfigViewController.m Fri Nov 12 23:59:40 2010 +0100
@@ -125,7 +125,12 @@
[cell addSubview:squareButton];
[squareButton release];
- UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(12+88+6+36, 10, 103, 25)];
+ NSInteger length;
+ if (IS_IPAD())
+ length = 103;
+ else
+ length = 285;
+ UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(12+88+6+36, 10, length, 25)];
label.textAlignment = UITextAlignmentLeft;
label.minimumFontSize = 11;
label.adjustsFontSizeToFitWidth = YES;
diff -r e033cf015b2c -r 57a501a69e5f project_files/HedgewarsMobile/Resources/Settings/Schemes/Barrel Mayhem.plist
--- a/project_files/HedgewarsMobile/Resources/Settings/Schemes/Barrel Mayhem.plist Fri Nov 12 22:47:13 2010 +0100
+++ b/project_files/HedgewarsMobile/Resources/Settings/Schemes/Barrel Mayhem.plist Fri Nov 12 23:59:40 2010 +0100
@@ -41,6 +41,7 @@
+
diff -r e033cf015b2c -r 57a501a69e5f project_files/HedgewarsMobile/Resources/Settings/Schemes/Clean Slate.plist
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/HedgewarsMobile/Resources/Settings/Schemes/Clean Slate.plist Fri Nov 12 23:59:40 2010 +0100
@@ -0,0 +1,47 @@
+
+
+
+
+ basic
+
+ 100
+ 45
+ 100
+ 15
+ 47
+ 5
+ 5
+ 35
+ 25
+ 3
+ 4
+ 0
+ 2
+
+ gamemod
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff -r e033cf015b2c -r 57a501a69e5f project_files/HedgewarsMobile/Resources/Settings/Schemes/Default.plist
--- a/project_files/HedgewarsMobile/Resources/Settings/Schemes/Default.plist Fri Nov 12 22:47:13 2010 +0100
+++ b/project_files/HedgewarsMobile/Resources/Settings/Schemes/Default.plist Fri Nov 12 23:59:40 2010 +0100
@@ -41,6 +41,7 @@
+
diff -r e033cf015b2c -r 57a501a69e5f project_files/HedgewarsMobile/Resources/Settings/Schemes/Fort Mode.plist
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/HedgewarsMobile/Resources/Settings/Schemes/Fort Mode.plist Fri Nov 12 23:59:40 2010 +0100
@@ -0,0 +1,47 @@
+
+
+
+
+ basic
+
+ 100
+ 45
+ 100
+ 15
+ 47
+ 5
+ 5
+ 35
+ 25
+ 3
+ 0
+ 0
+ 0
+
+ gamemod
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff -r e033cf015b2c -r 57a501a69e5f project_files/HedgewarsMobile/Resources/Settings/Schemes/Minefield.plist
--- a/project_files/HedgewarsMobile/Resources/Settings/Schemes/Minefield.plist Fri Nov 12 22:47:13 2010 +0100
+++ b/project_files/HedgewarsMobile/Resources/Settings/Schemes/Minefield.plist Fri Nov 12 23:59:40 2010 +0100
@@ -41,6 +41,7 @@
+
diff -r e033cf015b2c -r 57a501a69e5f project_files/HedgewarsMobile/Resources/Settings/Schemes/Pro Mode.plist
--- a/project_files/HedgewarsMobile/Resources/Settings/Schemes/Pro Mode.plist Fri Nov 12 22:47:13 2010 +0100
+++ b/project_files/HedgewarsMobile/Resources/Settings/Schemes/Pro Mode.plist Fri Nov 12 23:59:40 2010 +0100
@@ -41,6 +41,7 @@
+
diff -r e033cf015b2c -r 57a501a69e5f project_files/HedgewarsMobile/Resources/Settings/Schemes/Shoppa.plist
--- a/project_files/HedgewarsMobile/Resources/Settings/Schemes/Shoppa.plist Fri Nov 12 22:47:13 2010 +0100
+++ b/project_files/HedgewarsMobile/Resources/Settings/Schemes/Shoppa.plist Fri Nov 12 23:59:40 2010 +0100
@@ -41,6 +41,7 @@
+
diff -r e033cf015b2c -r 57a501a69e5f project_files/HedgewarsMobile/Resources/Settings/Schemes/Thinking with Portals.plist
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/HedgewarsMobile/Resources/Settings/Schemes/Thinking with Portals.plist Fri Nov 12 23:59:40 2010 +0100
@@ -0,0 +1,47 @@
+
+
+
+
+ basic
+
+ 100
+ 45
+ 100
+ 15
+ 47
+ 5
+ 2
+ 25
+ 25
+ 4
+ 5
+ 0
+ 5
+
+ gamemod
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff -r e033cf015b2c -r 57a501a69e5f project_files/HedgewarsMobile/Resources/Settings/Schemes/Timeless.plist
--- a/project_files/HedgewarsMobile/Resources/Settings/Schemes/Timeless.plist Fri Nov 12 22:47:13 2010 +0100
+++ b/project_files/HedgewarsMobile/Resources/Settings/Schemes/Timeless.plist Fri Nov 12 23:59:40 2010 +0100
@@ -41,6 +41,7 @@
+
diff -r e033cf015b2c -r 57a501a69e5f project_files/HedgewarsMobile/Resources/Settings/Schemes/Tunnel Hogs.plist
--- a/project_files/HedgewarsMobile/Resources/Settings/Schemes/Tunnel Hogs.plist Fri Nov 12 22:47:13 2010 +0100
+++ b/project_files/HedgewarsMobile/Resources/Settings/Schemes/Tunnel Hogs.plist Fri Nov 12 23:59:40 2010 +0100
@@ -41,6 +41,7 @@
+
diff -r e033cf015b2c -r 57a501a69e5f project_files/HedgewarsMobile/Resources/Settings/iFrontend/gameFlags_en.plist
--- a/project_files/HedgewarsMobile/Resources/Settings/iFrontend/gameFlags_en.plist Fri Nov 12 22:47:13 2010 +0100
+++ b/project_files/HedgewarsMobile/Resources/Settings/iFrontend/gameFlags_en.plist Fri Nov 12 23:59:40 2010 +0100
@@ -170,5 +170,13 @@
title
Per Hedgehog Ammo
+
+ description
+ Wind will not affect weapons
+ image
+ NoWind
+ title
+ Disable Wind
+