merge
authorunc0rr
Wed, 27 Apr 2011 16:01:27 +0400
changeset 5182 7eb5e1268330
parent 5179 8d64dcb566ea (current diff)
parent 5181 102fef5ca5fc (diff)
child 5183 0b71d382b73b
merge
--- a/QTfrontend/ammoSchemeModel.cpp	Wed Apr 27 15:57:23 2011 +0400
+++ b/QTfrontend/ammoSchemeModel.cpp	Wed Apr 27 16:01:27 2011 +0400
@@ -86,46 +86,46 @@
     numberOfDefaultSchemes = predefSchemesNames.size();
 
     spNames = QStringList()
-        << "name"             //  0
-        << "fortsmode"        //  1
-        << "divteams"         //  2
-        << "solidland"        //  3
-        << "border"           //  4
-        << "lowgrav"          //  5
-        << "laser"            //  6
-        << "invulnerability"  //  7
-        << "resethealth"      //  8
-        << "vampiric"         //  9
-        << "karma"            // 10
-        << "artillery"        // 11
-        << "randomorder"      // 12
-        << "king"             // 13
-        << "placehog"         // 14
-        << "sharedammo"       // 15
-        << "disablegirders"   // 16
-        << "disablelandobjects" // 17
-        << "aisurvival"       // 18
-        << "infattack"        // 19
-        << "resetweps"        // 20
-        << "perhogammo"       // 21
-        << "disablewind"      // 22
-        << "morewind"         // 23
-        << "tagteam"          // 24
-        << "damagefactor"     // 25
-        << "turntime"         // 26
-        << "health"           // 27
-        << "suddendeath"      // 28
-        << "caseprobability"  // 29
-        << "minestime"        // 30
-        << "minesnum"         // 31
-        << "minedudpct"       // 32
-        << "explosives"       // 33
-        << "healthprobability" // 34
-        << "healthcaseamount" // 35
-        << "waterrise"        // 36
-        << "healthdecrease"   // 37
-        << "ropepct"          // 38 
-        << "getawaytime"      // 39 
+        << "name"                //  0
+        << "fortsmode"           //  1
+        << "divteams"            //  2
+        << "solidland"           //  3
+        << "border"              //  4
+        << "lowgrav"             //  5
+        << "laser"               //  6
+        << "invulnerability"     //  7
+        << "resethealth"         //  8
+        << "vampiric"            //  9
+        << "karma"               // 10
+        << "artillery"           // 11
+        << "randomorder"         // 12
+        << "king"                // 13
+        << "placehog"            // 14
+        << "sharedammo"          // 15
+        << "disablegirders"      // 16
+        << "disablelandobjects"  // 17
+        << "aisurvival"          // 18
+        << "infattack"           // 19
+        << "resetweps"           // 20
+        << "perhogammo"          // 21
+        << "disablewind"         // 22
+        << "morewind"            // 23
+        << "tagteam"             // 24
+        << "damagefactor"        // 25
+        << "turntime"            // 26
+        << "health"              // 27
+        << "suddendeath"         // 28
+        << "caseprobability"     // 29
+        << "minestime"           // 30
+        << "minesnum"            // 31
+        << "minedudpct"          // 32
+        << "explosives"          // 33
+        << "healthprobability"   // 34
+        << "healthcaseamount"    // 35
+        << "waterrise"           // 36
+        << "healthdecrease"      // 37
+        << "ropepct"             // 38
+        << "getawaytime"         // 39
         ;
 
     QList<QVariant> proMode;
@@ -208,7 +208,7 @@
         << QVariant(0)             // mines number   31
         << QVariant(0)             // mine dud pct   32
         << QVariant(0)             // explosives     33
-        << QVariant(0)            // health case pct 34
+        << QVariant(0)             // health case pct 34
         << QVariant(25)            // health case amt 35
         << QVariant(47)            // water rise amt 36
         << QVariant(5)             // health dec amt 37
@@ -289,11 +289,11 @@
         << QVariant(false)         // tag team       24
         << QVariant(100)           // damage modfier 25
         << QVariant(30)            // turn time      26
-        << QVariant(50)           // init health    27
+        << QVariant(50)            // init health    27
         << QVariant(15)            // sudden death   28
         << QVariant(0)             // case prob      29
         << QVariant(0)             // mines time     30
-        << QVariant(80)             // mines number   31
+        << QVariant(80)            // mines number   31
         << QVariant(0)             // mine dud pct   32
         << QVariant(0)             // explosives     33
         << QVariant(35)            // health case pct 34
@@ -339,7 +339,7 @@
         << QVariant(0)             // mines time     30
         << QVariant(0)             // mines number   31
         << QVariant(0)             // mine dud pct   32
-        << QVariant(80)             // explosives     33
+        << QVariant(80)            // explosives     33
         << QVariant(35)            // health case pct 34
         << QVariant(25)            // health case amt 35
         << QVariant(47)            // water rise amt 36
@@ -381,9 +381,9 @@
         << QVariant(15)            // sudden death   28
         << QVariant(5)             // case prob      29
         << QVariant(3)             // mines time     30
-        << QVariant(10)             // mines number   31
-        << QVariant(10)             // mine dud pct   32
-        << QVariant(10)             // explosives     33
+        << QVariant(10)            // mines number   31
+        << QVariant(10)            // mine dud pct   32
+        << QVariant(10)            // explosives     33
         << QVariant(35)            // health case pct 34
         << QVariant(25)            // health case amt 35
         << QVariant(47)            // water rise amt 36
@@ -470,11 +470,11 @@
         << QVariant(5)             // case prob      29
         << QVariant(3)             // mines time     30
         << QVariant(5)             // mines number   31
-        << QVariant(10)             // mine dud pct   32
+        << QVariant(10)            // mine dud pct   32
         << QVariant(2)             // explosives     33
         << QVariant(35)            // health case pct 34
         << QVariant(30)            // health case amt 35
-        << QVariant(0)            // water rise amt 36
+        << QVariant(0)             // water rise amt 36
         << QVariant(0)             // health dec amt 37
         << QVariant(100)           // rope modfier   38 
         << QVariant(100)           // get away time  39 
--- a/QTfrontend/pagescheme.cpp	Wed Apr 27 15:57:23 2011 +0400
+++ b/QTfrontend/pagescheme.cpp	Wed Apr 27 16:01:27 2011 +0400
@@ -158,7 +158,7 @@
     glGMLayout->addWidget(TBW_morewind,4,2,1,1);
 
     TBW_tagteam = new ToggleButtonWidget(gbGameModes, ":/res/btnTagTeam.png");
-    TBW_tagteam->setToolTip("<b>" + ToggleButtonWidget::tr("Tag Team") + "</b>:<br />" + tr("Teams in each clan takes successive turns but have to share turn time."));
+    TBW_tagteam->setToolTip("<b>" + ToggleButtonWidget::tr("Tag Team") + "</b>:<br />" + tr("Teams in each clan take successive turns sharing their turn time."));
     glGMLayout->addWidget(TBW_tagteam,4,3,1,1);
 
     // Right
--- a/hedgewars/uMobile.pas	Wed Apr 27 15:57:23 2011 +0400
+++ b/hedgewars/uMobile.pas	Wed Apr 27 16:01:27 2011 +0400
@@ -26,8 +26,8 @@
 procedure clearView; cdecl; external;
 procedure startSpinningProgress; cdecl; external;
 procedure stopSpinningProgress; cdecl; external;
-procedure saveBegan; cdecl; external;
-procedure saveFinished; cdecl; external;
+procedure saveBeganSynching; cdecl; external;
+procedure saveFinishedSynching; cdecl; external;
 procedure setGameRunning(arg: boolean); cdecl; external;
 procedure updateVisualsNewTurn; cdecl; external;
 function  isApplePhone: Boolean; cdecl; external;
--- a/project_files/HedgewarsMobile/Classes/CreationChamber.m	Wed Apr 27 15:57:23 2011 +0400
+++ b/project_files/HedgewarsMobile/Classes/CreationChamber.m	Wed Apr 27 16:01:27 2011 +0400
@@ -183,6 +183,7 @@
 
 void createSchemeNamed (NSString *nameWithoutExt) {
     NSString *schemesDirectory = SCHEMES_DIRECTORY();
+    NSString *path = nil;
 
     if (![[NSFileManager defaultManager] fileExistsAtPath: schemesDirectory]) {
         [[NSFileManager defaultManager] createDirectoryAtPath:schemesDirectory
@@ -191,53 +192,24 @@
                                                         error:NULL];
     }
 
-    int basicFlags[] = {100, 100, 45, 15, 47, 5, 100, 5, 35, 25, 3, 4, 0, 2};
-    BOOL gameFlags[] = {NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, YES, NO, NO, NO, NO,
-        NO, NO, NO, NO, NO, NO, NO};
-
-    NSMutableArray *basicArray  = [[NSMutableArray alloc] initWithObjects:
-                                   [NSNumber numberWithInt:basicFlags[0]],          //initialhealth
-                                   [NSNumber numberWithInt:basicFlags[1]],          //damagemodifier
-                                   [NSNumber numberWithInt:basicFlags[2]],          //turntime
-                                   [NSNumber numberWithInt:basicFlags[3]],          //suddendeathtimeout
-                                   [NSNumber numberWithInt:basicFlags[4]],          //waterrise
-                                   [NSNumber numberWithInt:basicFlags[5]],          //healthdecrease
-                                   [NSNumber numberWithInt:basicFlags[6]],          //ropelength
-                                   [NSNumber numberWithInt:basicFlags[7]],          //cratedrops
-                                   [NSNumber numberWithInt:basicFlags[8]],          //healthprob
-                                   [NSNumber numberWithInt:basicFlags[9]],          //healthamount
-                                   [NSNumber numberWithInt:basicFlags[10]],         //minestime
-                                   [NSNumber numberWithInt:basicFlags[11]],         //minesnumber
-                                   [NSNumber numberWithInt:basicFlags[12]],         //dudmines
-                                   [NSNumber numberWithInt:basicFlags[13]],         //explosives
-                                   nil];
+    // 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];
+    NSMutableArray *basicArray  = [[NSMutableArray alloc] initWithCapacity:[basicSettings count]];
+    for (NSDictionary *basicDict in basicSettings)
+        [basicArray addObject:[basicDict objectForKey:@"default"]];
+    [basicSettings release];
 
-    NSMutableArray *gamemodArray= [[NSMutableArray alloc] initWithObjects:
-                                   [NSNumber numberWithBool:gameFlags[0]],          //fortmode
-                                   [NSNumber numberWithBool:gameFlags[1]],          //divideteam
-                                   [NSNumber numberWithBool:gameFlags[2]],          //solidland
-                                   [NSNumber numberWithBool:gameFlags[3]],          //addborder
-                                   [NSNumber numberWithBool:gameFlags[4]],          //lowgravity
-                                   [NSNumber numberWithBool:gameFlags[5]],          //lasersight
-                                   [NSNumber numberWithBool:gameFlags[6]],          //invulnerable
-                                   [NSNumber numberWithBool:gameFlags[7]],          //resethealth
-                                   [NSNumber numberWithBool:gameFlags[8]],          //vampirism
-                                   [NSNumber numberWithBool:gameFlags[9]],          //karma
-                                   [NSNumber numberWithBool:gameFlags[10]],         //artillery
-                                   [NSNumber numberWithBool:gameFlags[11]],         //randomorder
-                                   [NSNumber numberWithBool:gameFlags[12]],         //king
-                                   [NSNumber numberWithBool:gameFlags[13]],         //placehedgehogs
-                                   [NSNumber numberWithBool:gameFlags[14]],         //clansharesammo
-                                   [NSNumber numberWithBool:gameFlags[15]],         //disablegirders
-                                   [NSNumber numberWithBool:gameFlags[16]],         //disablelandobjects
-                                   [NSNumber numberWithBool:gameFlags[17]],         //aisurvival
-                                   [NSNumber numberWithBool:gameFlags[18]],         //infattack
-                                   [NSNumber numberWithBool:gameFlags[19]],         //resetweaps
-                                   [NSNumber numberWithBool:gameFlags[20]],         //perhogammo
-                                   [NSNumber numberWithBool:gameFlags[21]],         //nowind
-                                   [NSNumber numberWithBool:gameFlags[22]],         //morewind
-                                   nil];
-    
+    path = [NSString stringWithFormat:@"%@/gameFlags_en.plist",IFRONTEND_DIRECTORY()];
+    NSArray *mods = [[NSArray alloc] initWithContentsOfFile:path];
+    NSMutableArray *gamemodArray= [[NSMutableArray alloc] initWithCapacity:[mods count]];
+    for (int i = 0; i < [mods count]; i++)
+        [gamemodArray addObject:[NSNumber numberWithBool:NO]];
+    [mods release];
+
+    // workaround for randomorder that has to be set to YES
+    [gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]];
+
     NSMutableDictionary *theScheme = [[NSMutableDictionary alloc] initWithObjectsAndKeys:
                                       basicArray,@"basic",
                                       gamemodArray,@"gamemod",
--- a/project_files/HedgewarsMobile/Classes/EngineProtocolNetwork.m	Wed Apr 27 15:57:23 2011 +0400
+++ b/project_files/HedgewarsMobile/Classes/EngineProtocolNetwork.m	Wed Apr 27 16:01:27 2011 +0400
@@ -183,7 +183,7 @@
     [self sendToEngine:flags];
     [flags release];
 
-    /* basic game flags */
+    // game modifiers
     NSString *path = [[NSString alloc] initWithFormat:@"%@/basicFlags_en.plist",IFRONTEND_DIRECTORY()];
     NSArray *mods = [[NSArray alloc] initWithContentsOfFile:path];
     [path release];
--- a/project_files/HedgewarsMobile/Classes/SingleSchemeViewController.m	Wed Apr 27 15:57:23 2011 +0400
+++ b/project_files/HedgewarsMobile/Classes/SingleSchemeViewController.m	Wed Apr 27 16:01:27 2011 +0400
@@ -193,6 +193,7 @@
 
             UILabel *cellLabel = (UILabel *)[cell.contentView viewWithTag:LABEL_TAG];
             cellLabel.text = [[self.basicSettingList objectAtIndex:row] objectForKey:@"title"];
+            cellLabel.adjustsFontSizeToFitWidth = YES;
 
             // can't use the viewWithTag method because row is dynamic
             UISlider *cellSlider = nil;
--- a/project_files/HedgewarsMobile/Resources/Settings/iFrontend/basicFlags_en.plist	Wed Apr 27 15:57:23 2011 +0400
+++ b/project_files/HedgewarsMobile/Resources/Settings/iFrontend/basicFlags_en.plist	Wed Apr 27 16:01:27 2011 +0400
@@ -120,7 +120,7 @@
 		<key>min</key>
 		<integer>25</integer>
 		<key>title</key>
-		<string>Rope Length</string>
+		<string>Rope Length (%)</string>
 	</dict>
 	<dict>
 		<key>checkOverMax</key>
@@ -156,7 +156,7 @@
 		<key>min</key>
 		<integer>0</integer>
 		<key>title</key>
-		<string>Health Kit Probability</string>
+		<string>Health Kit Probability (%)</string>
 	</dict>
 	<dict>
 		<key>checkOverMax</key>
@@ -228,7 +228,7 @@
 		<key>min</key>
 		<integer>0</integer>
 		<key>title</key>
-		<string>Dud Mines Probability</string>
+		<string>Dud Mines Probability (%)</string>
 	</dict>
 	<dict>
 		<key>checkOverMax</key>
@@ -248,5 +248,23 @@
 		<key>title</key>
 		<string>Explosives</string>
 	</dict>
+	<dict>
+		<key>checkOverMax</key>
+		<false/>
+		<key>times1000</key>
+		<false/>
+		<key>command</key>
+		<string>e$getawaytime</string>
+		<key>default</key>
+		<integer>100</integer>
+		<key>image</key>
+		<string>Time</string>
+		<key>max</key>
+		<integer>999</integer>
+		<key>min</key>
+		<integer>0</integer>
+		<key>title</key>
+		<string>Get Away Time (%)</string>
+	</dict>
 </array>
 </plist>
--- a/project_files/HedgewarsMobile/Resources/Settings/iFrontend/gameFlags_en.plist	Wed Apr 27 15:57:23 2011 +0400
+++ b/project_files/HedgewarsMobile/Resources/Settings/iFrontend/gameFlags_en.plist	Wed Apr 27 16:01:27 2011 +0400
@@ -186,5 +186,13 @@
 		<key>title</key>
 		<string>More Wind</string>
 	</dict>
+	<dict>
+		<key>description</key>
+		<string>Clan teams take turns sharing their time</string>
+		<key>image</key>
+		<string>TagTeam</string>
+		<key>title</key>
+		<string>Tag Team</string>
+	</dict>
 </array>
 </plist>