# HG changeset patch # User koda # Date 1303942596 -7200 # Node ID 7607a64e1853f4041f0b865d9f55793284ac93c5 # Parent bf7bba60ed93a07dcc9cb8c55c87eabcfe2a4606 remove the trailing _en from scheme data and use the macros available instead of creating a string every time diff -r bf7bba60ed93 -r 7607a64e1853 project_files/HedgewarsMobile/Classes/AboutViewController.m --- a/project_files/HedgewarsMobile/Classes/AboutViewController.m Wed Apr 27 11:11:45 2011 -0400 +++ b/project_files/HedgewarsMobile/Classes/AboutViewController.m Thu Apr 28 00:16:36 2011 +0200 @@ -34,8 +34,7 @@ self.tableView.backgroundView = nil; self.tableView.allowsSelection = NO; - NSString *strPath = [NSString stringWithFormat:@"%@/credits.plist",IFRONTEND_DIRECTORY()]; - NSArray *array = [[NSArray alloc] initWithContentsOfFile:strPath]; + NSArray *array = [[NSArray alloc] initWithContentsOfFile:CREDITS_FILE()]; self.people = array; [array release]; diff -r bf7bba60ed93 -r 7607a64e1853 project_files/HedgewarsMobile/Classes/CommodityFunctions.h --- a/project_files/HedgewarsMobile/Classes/CommodityFunctions.h Wed Apr 27 11:11:45 2011 -0400 +++ b/project_files/HedgewarsMobile/Classes/CommodityFunctions.h Thu Apr 28 00:16:36 2011 +0200 @@ -26,6 +26,9 @@ #define SETTINGS_FILE() [DOCUMENTS_FOLDER() stringByAppendingString:@"/settings.plist"] #define DEBUG_FILE() [DOCUMENTS_FOLDER() stringByAppendingString:@"/hw-game.log"] #define HEDGEHOG_FILE() [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Settings/Images/hedgehog.png"] +#define BASICFLAGS_FILE() [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Settings/basicFlags.plist"] +#define GAMEMODS_FILE() [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Settings/gameMods.plist"] +#define CREDITS_FILE() [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Settings/credits.plist"] #define TEAMS_DIRECTORY() [DOCUMENTS_FOLDER() stringByAppendingString:@"/Teams/"] #define WEAPONS_DIRECTORY() [DOCUMENTS_FOLDER() stringByAppendingString:@"/Weapons/"] @@ -44,7 +47,6 @@ #define MAPS_DIRECTORY() [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Data/Maps/"] #define MISSIONS_DIRECTORY() [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Data/Missions/Maps/"] #define LOCALE_DIRECTORY() [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Data/Locale/"] -#define IFRONTEND_DIRECTORY() [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Settings/iFrontend/"] #define MSG_MEMCLEAN() DLog(@"has cleaned up some memory"); #define MSG_DIDUNLOAD() DLog(@"unloaded"); diff -r bf7bba60ed93 -r 7607a64e1853 project_files/HedgewarsMobile/Classes/CreationChamber.m --- a/project_files/HedgewarsMobile/Classes/CreationChamber.m Wed Apr 27 11:11:45 2011 -0400 +++ b/project_files/HedgewarsMobile/Classes/CreationChamber.m Thu Apr 28 00:16:36 2011 +0200 @@ -183,7 +183,6 @@ void createSchemeNamed (NSString *nameWithoutExt) { NSString *schemesDirectory = SCHEMES_DIRECTORY(); - NSString *path = nil; if (![[NSFileManager defaultManager] fileExistsAtPath: schemesDirectory]) { [[NSFileManager defaultManager] createDirectoryAtPath:schemesDirectory @@ -193,15 +192,13 @@ } // load data to get the size of the arrays and their default values - path = [NSString stringWithFormat:@"%@/basicFlags_en.plist",IFRONTEND_DIRECTORY()]; - NSArray *basicSettings = [[NSArray alloc] initWithContentsOfFile:path]; + NSArray *basicSettings = [[NSArray alloc] initWithContentsOfFile:BASICFLAGS_FILE()]; NSMutableArray *basicArray = [[NSMutableArray alloc] initWithCapacity:[basicSettings count]]; for (NSDictionary *basicDict in basicSettings) [basicArray addObject:[basicDict objectForKey:@"default"]]; [basicSettings release]; - path = [NSString stringWithFormat:@"%@/gameFlags_en.plist",IFRONTEND_DIRECTORY()]; - NSArray *mods = [[NSArray alloc] initWithContentsOfFile:path]; + NSArray *mods = [[NSArray alloc] initWithContentsOfFile:GAMEMODS_FILE()]; NSMutableArray *gamemodArray= [[NSMutableArray alloc] initWithCapacity:[mods count]]; for (int i = 0; i < [mods count]; i++) [gamemodArray addObject:[NSNumber numberWithBool:NO]]; diff -r bf7bba60ed93 -r 7607a64e1853 project_files/HedgewarsMobile/Classes/EngineProtocolNetwork.m --- a/project_files/HedgewarsMobile/Classes/EngineProtocolNetwork.m Wed Apr 27 11:11:45 2011 -0400 +++ b/project_files/HedgewarsMobile/Classes/EngineProtocolNetwork.m Thu Apr 28 00:16:36 2011 +0200 @@ -173,7 +173,7 @@ int result = 0; int mask = 0x00000004; - // pack the gameflags in a single var and send it + // pack the game modifiers in a single var and send it for (NSNumber *value in gamemodArray) { if ([value boolValue] == YES) result |= mask; @@ -183,15 +183,12 @@ [self sendToEngine:flags]; [flags release]; - // game modifiers - NSString *path = [[NSString alloc] initWithFormat:@"%@/basicFlags_en.plist",IFRONTEND_DIRECTORY()]; - NSArray *mods = [[NSArray alloc] initWithContentsOfFile:path]; - [path release]; - + // basic game flags result = [[basicArray objectAtIndex:0] intValue]; + NSArray *basic = [[NSArray alloc] initWithContentsOfFile:BASICFLAGS_FILE()]; for (int i = 1; i < [basicArray count]; i++) { - NSDictionary *dict = [mods objectAtIndex:i]; + NSDictionary *dict = [basic objectAtIndex:i]; NSString *command = [dict objectForKey:@"command"]; NSInteger value = [[basicArray objectAtIndex:i] intValue]; if ([[dict objectForKey:@"checkOverMax"] boolValue] && value >= [[dict objectForKey:@"max"] intValue]) @@ -202,7 +199,7 @@ [self sendToEngine:strToSend]; [strToSend release]; } - [mods release]; + [basic release]; [schemeDictionary release]; return result; diff -r bf7bba60ed93 -r 7607a64e1853 project_files/HedgewarsMobile/Classes/SingleSchemeViewController.m --- a/project_files/HedgewarsMobile/Classes/SingleSchemeViewController.m Wed Apr 27 11:11:45 2011 -0400 +++ b/project_files/HedgewarsMobile/Classes/SingleSchemeViewController.m Thu Apr 28 00:16:36 2011 +0200 @@ -52,17 +52,14 @@ #pragma mark View lifecycle -(void) viewDidLoad { [super viewDidLoad]; - NSString *path = nil; // title, description, image name (+btn) - path = [NSString stringWithFormat:@"%@/gameFlags_en.plist",IFRONTEND_DIRECTORY()]; - NSArray *mods = [[NSArray alloc] initWithContentsOfFile:path]; + NSArray *mods = [[NSArray alloc] initWithContentsOfFile:GAMEMODS_FILE()]; self.gameModifierArray = mods; [mods release]; // title, image name (+icon), default value, max value, min value - path = [NSString stringWithFormat:@"%@/basicFlags_en.plist",IFRONTEND_DIRECTORY()]; - NSArray *basicSettings = [[NSArray alloc] initWithContentsOfFile:path]; + NSArray *basicSettings = [[NSArray alloc] initWithContentsOfFile:BASICFLAGS_FILE()]; self.basicSettingList = basicSettings; [basicSettings release]; diff -r bf7bba60ed93 -r 7607a64e1853 project_files/HedgewarsMobile/Resources/Settings/basicFlags.plist --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/project_files/HedgewarsMobile/Resources/Settings/basicFlags.plist Thu Apr 28 00:16:36 2011 +0200 @@ -0,0 +1,270 @@ + + + + + + default + 100 + image + Health + max + 200 + min + 50 + title + Initial Health + + + checkOverMax + + times1000 + + command + e$damagepct + default + 100 + image + Damage + max + 300 + min + 10 + title + Damage Modifier + + + checkOverMax + + times1000 + + command + e$turntime + default + 45 + image + Time + max + 100 + min + 1 + title + Turn Time + + + checkOverMax + + times1000 + + command + e$sd_turns + default + 15 + image + SuddenDeath + max + 50 + min + 0 + title + Sudden Death Timeout + + + checkOverMax + + times1000 + + command + e$waterrise + default + 47 + image + SuddenDeath + max + 100 + min + 0 + title + Water Rise Amount + + + checkOverMax + + times1000 + + command + e$healthdec + default + 5 + image + SuddenDeath + max + 100 + min + 0 + title + Health Decrease + + + checkOverMax + + times1000 + + command + e$ropepct + default + 100 + image + Rope + max + 999 + min + 25 + title + Rope Length (%) + + + checkOverMax + + times1000 + + command + e$casefreq + default + 5 + image + Box + max + 9 + min + 0 + title + Crate Drop Turns + + + checkOverMax + + times1000 + + command + e$healthprob + default + 35 + image + Health + max + 100 + min + 0 + title + Health Kit Probability (%) + + + checkOverMax + + times1000 + + command + e$hcaseamount + default + 25 + image + Health + max + 200 + min + 0 + title + Health Amount in Kit + + + checkOverMax + + times1000 + + command + e$minestime + default + 3 + image + Time + max + 5 + min + -1 + title + Mines Time + + + checkOverMax + + times1000 + + command + e$minesnum + default + 4 + image + Mine + max + 80 + min + 0 + title + Mines Number + + + checkOverMax + + times1000 + + command + e$minedudpct + default + 0 + image + Dud + max + 100 + min + 0 + title + Dud Mines Probability (%) + + + checkOverMax + + times1000 + + command + e$explosives + default + 2 + image + Damage + max + 40 + min + 0 + title + Explosives + + + checkOverMax + + times1000 + + command + e$getawaytime + default + 100 + image + Time + max + 999 + min + 0 + title + Get Away Time (%) + + + diff -r bf7bba60ed93 -r 7607a64e1853 project_files/HedgewarsMobile/Resources/Settings/credits.plist --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/project_files/HedgewarsMobile/Resources/Settings/credits.plist Thu Apr 28 00:16:36 2011 +0200 @@ -0,0 +1,116 @@ + + + + + + Andrey "UnC0Rr" Korotaev + Igor "Displacer" Ulyanov + Derek "Nemo" Pomery + Martin "Affect" Boze + David "Krawek" Cuadrado + Martin "Ttsmj" Minarik + Kristian "TheXception" Lehmann + Vittorio "Koda" Giovara + Mario "Smaxx" Liebisch + Carlos "Palewolf" Vives + Richard "Sheepluva" Korlyi + Henning "Prg" Kühn + Henrik "Henek" Rostedt + + + John "Fizzy" Dum + Joshua Frese + Stanko Tadić + Julien Koesten + Joshua O'Sullivan + Nils Luck + Trey Perry + + + Stephen "Armagon" Alexander + John "Fizzy" Dum + Jonatan Nilsson + Daniel Martin + + + Romulo Fernandes Machado + Svetoslav Stefanov + Petr Řezáček + Jie Luo + Andrey Korotaev + Nina Kuisma + Antoine Turmel + Peter Hüwe, Mario Liebisch + Luca Bonora + Adam Etienne + Maciej Mroziński, Wojciech Latkowski, Maciej Górny + Fábio Canário + Andrey Korotaev + Jose Riha + Carlos Vives + Niklas Grahn + Eugene V. Lyubimkin + + + Aleksey Andreev + Aleksander Rudalev + Natasha Korotaeva + Adam Higerd + + + Engine, frontend, net server author + Desktop frontend improvements + Many engine and frontend improvements + Drillrocket, Ballgun, RC Plane weapons + Mine number and time game settings + Desktop frontend improvements + Desktop frontend improvements + Mac OS X and iPhone version + Gamepad support + Many engine improvements and graphics + Many engine and server improvements + Maze maps + Engine and frontend improvements + + + Main graphics + + + + + + Some hats + + + Hedgehogs voice + + + + + + Brazilian Portuguese + Bulgarian + Czech + Chinese + English + Finnish + French + German + Italian + Japanese + Polish + Portuguese + Russian + Slovak + Spanish + Swedish + Ukrainian + + + + + + + + + diff -r bf7bba60ed93 -r 7607a64e1853 project_files/HedgewarsMobile/Resources/Settings/gameMods.plist --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/project_files/HedgewarsMobile/Resources/Settings/gameMods.plist Thu Apr 28 00:16:36 2011 +0200 @@ -0,0 +1,198 @@ + + + + + + description + Land can not be destroyed + image + Solid + title + Solid Land + + + description + Add an indestructable border around the terrain + image + Border + title + Add Border + + + description + Teams will start on opposite sides of the terrain + image + TeamsDivide + title + Divide Team (max 2 teams) + + + description + Lower gravity + image + LowGravity + title + Low Gravity + + + description + Assisted aiming with laser sight + image + LaserSight + title + Laser Sight + + + description + All hogs have a personal forcefield + image + Invulnerable + title + Invulnerable + + + description + All (living) hedgehogs are fully restored at the end of turn + image + ResetHealth + title + Reset Health + + + description + Gain 80% of the damage you do back in health + image + Vampiric + title + Vampirism Mode + + + description + Share your opponents pain, share their damage + image + Karma + title + Karma Mode + + + description + Your hogs are unable to move, test your aim + image + Artillery + title + Artillery Mode + + + description + Defend your fort and destroy the opponents + image + Forts + title + Fort Mode + + + description + Order of play is random instead of in room order + image + RandomOrder + title + Random Order + + + description + Play with a King; when he dies, your side loses + image + King + title + King Mode + + + description + Take turns placing your hedgehogs pre-game + image + PlaceHog + title + Place Hedgehogs + + + description + Ammo is shared between all clan teams + image + SharedAmmo + title + Clan Shares Ammo + + + description + Disable girders when generating random maps + image + DisableGirders + title + Disable Girders + + + description + Disable land objects when generating maps + image + DisableLandObjects + title + Disable Land Objects + + + description + AI-controlled hogs respawn on death + image + AISurvival + title + AI Survival Mode + + + description + Attacking does not end your turn + image + InfAttack + title + Unlimited Attacks + + + description + Weapons are reset to starting values each turn + image + ResetWeps + title + Reset Weapons + + + description + Each hedgehog has its own ammo + image + PerHogAmmo + title + Per Hedgehog Ammo + + + description + You will not have to worry about wind any more + image + NoWind + title + Disable Wind + + + description + Wind will affect almost everything + image + MoreWind + title + More Wind + + + description + Clan teams take turns sharing their time + image + TagTeam + title + Tag Team + + + diff -r bf7bba60ed93 -r 7607a64e1853 project_files/HedgewarsMobile/Resources/Settings/iFrontend/basicFlags_en.plist --- a/project_files/HedgewarsMobile/Resources/Settings/iFrontend/basicFlags_en.plist Wed Apr 27 11:11:45 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,270 +0,0 @@ - - - - - - default - 100 - image - Health - max - 200 - min - 50 - title - Initial Health - - - checkOverMax - - times1000 - - command - e$damagepct - default - 100 - image - Damage - max - 300 - min - 10 - title - Damage Modifier - - - checkOverMax - - times1000 - - command - e$turntime - default - 45 - image - Time - max - 100 - min - 1 - title - Turn Time - - - checkOverMax - - times1000 - - command - e$sd_turns - default - 15 - image - SuddenDeath - max - 50 - min - 0 - title - Sudden Death Timeout - - - checkOverMax - - times1000 - - command - e$waterrise - default - 47 - image - SuddenDeath - max - 100 - min - 0 - title - Water Rise Amount - - - checkOverMax - - times1000 - - command - e$healthdec - default - 5 - image - SuddenDeath - max - 100 - min - 0 - title - Health Decrease - - - checkOverMax - - times1000 - - command - e$ropepct - default - 100 - image - Rope - max - 999 - min - 25 - title - Rope Length (%) - - - checkOverMax - - times1000 - - command - e$casefreq - default - 5 - image - Box - max - 9 - min - 0 - title - Crate Drop Turns - - - checkOverMax - - times1000 - - command - e$healthprob - default - 35 - image - Health - max - 100 - min - 0 - title - Health Kit Probability (%) - - - checkOverMax - - times1000 - - command - e$hcaseamount - default - 25 - image - Health - max - 200 - min - 0 - title - Health Amount in Kit - - - checkOverMax - - times1000 - - command - e$minestime - default - 3 - image - Time - max - 5 - min - -1 - title - Mines Time - - - checkOverMax - - times1000 - - command - e$minesnum - default - 4 - image - Mine - max - 80 - min - 0 - title - Mines Number - - - checkOverMax - - times1000 - - command - e$minedudpct - default - 0 - image - Dud - max - 100 - min - 0 - title - Dud Mines Probability (%) - - - checkOverMax - - times1000 - - command - e$explosives - default - 2 - image - Damage - max - 40 - min - 0 - title - Explosives - - - checkOverMax - - times1000 - - command - e$getawaytime - default - 100 - image - Time - max - 999 - min - 0 - title - Get Away Time (%) - - - diff -r bf7bba60ed93 -r 7607a64e1853 project_files/HedgewarsMobile/Resources/Settings/iFrontend/credits.plist --- a/project_files/HedgewarsMobile/Resources/Settings/iFrontend/credits.plist Wed Apr 27 11:11:45 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,116 +0,0 @@ - - - - - - Andrey "UnC0Rr" Korotaev - Igor "Displacer" Ulyanov - Derek "Nemo" Pomery - Martin "Affect" Boze - David "Krawek" Cuadrado - Martin "Ttsmj" Minarik - Kristian "TheXception" Lehmann - Vittorio "Koda" Giovara - Mario "Smaxx" Liebisch - Carlos "Palewolf" Vives - Richard "Sheepluva" Korlyi - Henning "Prg" Kühn - Henrik "Henek" Rostedt - - - John "Fizzy" Dum - Joshua Frese - Stanko Tadić - Julien Koesten - Joshua O'Sullivan - Nils Luck - Trey Perry - - - Stephen "Armagon" Alexander - John "Fizzy" Dum - Jonatan Nilsson - Daniel Martin - - - Romulo Fernandes Machado - Svetoslav Stefanov - Petr Řezáček - Jie Luo - Andrey Korotaev - Nina Kuisma - Antoine Turmel - Peter Hüwe, Mario Liebisch - Luca Bonora - Adam Etienne - Maciej Mroziński, Wojciech Latkowski, Maciej Górny - Fábio Canário - Andrey Korotaev - Jose Riha - Carlos Vives - Niklas Grahn - Eugene V. Lyubimkin - - - Aleksey Andreev - Aleksander Rudalev - Natasha Korotaeva - Adam Higerd - - - Engine, frontend, net server author - Desktop frontend improvements - Many engine and frontend improvements - Drillrocket, Ballgun, RC Plane weapons - Mine number and time game settings - Desktop frontend improvements - Desktop frontend improvements - Mac OS X and iPhone version - Gamepad support - Many engine improvements and graphics - Many engine and server improvements - Maze maps - Engine and frontend improvements - - - Main graphics - - - - - - Some hats - - - Hedgehogs voice - - - - - - Brazilian Portuguese - Bulgarian - Czech - Chinese - English - Finnish - French - German - Italian - Japanese - Polish - Portuguese - Russian - Slovak - Spanish - Swedish - Ukrainian - - - - - - - - - diff -r bf7bba60ed93 -r 7607a64e1853 project_files/HedgewarsMobile/Resources/Settings/iFrontend/gameFlags_en.plist --- a/project_files/HedgewarsMobile/Resources/Settings/iFrontend/gameFlags_en.plist Wed Apr 27 11:11:45 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,198 +0,0 @@ - - - - - - description - Land can not be destroyed - image - Solid - title - Solid Land - - - description - Add an indestructable border around the terrain - image - Border - title - Add Border - - - description - Teams will start on opposite sides of the terrain - image - TeamsDivide - title - Divide Team (max 2 teams) - - - description - Lower gravity - image - LowGravity - title - Low Gravity - - - description - Assisted aiming with laser sight - image - LaserSight - title - Laser Sight - - - description - All hogs have a personal forcefield - image - Invulnerable - title - Invulnerable - - - description - All (living) hedgehogs are fully restored at the end of turn - image - ResetHealth - title - Reset Health - - - description - Gain 80% of the damage you do back in health - image - Vampiric - title - Vampirism Mode - - - description - Share your opponents pain, share their damage - image - Karma - title - Karma Mode - - - description - Your hogs are unable to move, test your aim - image - Artillery - title - Artillery Mode - - - description - Defend your fort and destroy the opponents - image - Forts - title - Fort Mode - - - description - Order of play is random instead of in room order - image - RandomOrder - title - Random Order - - - description - Play with a King; when he dies, your side loses - image - King - title - King Mode - - - description - Take turns placing your hedgehogs pre-game - image - PlaceHog - title - Place Hedgehogs - - - description - Ammo is shared between all clan teams - image - SharedAmmo - title - Clan Shares Ammo - - - description - Disable girders when generating random maps - image - DisableGirders - title - Disable Girders - - - description - Disable land objects when generating maps - image - DisableLandObjects - title - Disable Land Objects - - - description - AI-controlled hogs respawn on death - image - AISurvival - title - AI Survival Mode - - - description - Attacking does not end your turn - image - InfAttack - title - Unlimited Attacks - - - description - Weapons are reset to starting values each turn - image - ResetWeps - title - Reset Weapons - - - description - Each hedgehog has its own ammo - image - PerHogAmmo - title - Per Hedgehog Ammo - - - description - You will not have to worry about wind any more - image - NoWind - title - Disable Wind - - - description - Wind will affect almost everything - image - MoreWind - title - More Wind - - - description - Clan teams take turns sharing their time - image - TagTeam - title - Tag Team - - -