discrimination between ai and humans
authorkoda
Thu, 02 Sep 2010 22:37:24 +0200
changeset 3814 7af568bc0710
parent 3812 ce18fd3ff02d
child 3816 7b74aa003f52
discrimination between ai and humans
project_files/HedgewarsMobile/Classes/HelpPageLobbyViewController.xib
project_files/HedgewarsMobile/Classes/TeamConfigViewController.m
--- a/project_files/HedgewarsMobile/Classes/HelpPageLobbyViewController.xib	Thu Sep 02 21:49:36 2010 +0400
+++ b/project_files/HedgewarsMobile/Classes/HelpPageLobbyViewController.xib	Thu Sep 02 22:37:24 2010 +0200
@@ -197,7 +197,7 @@
 					<object class="IBUIImageView" id="713859408">
 						<reference key="NSNextResponder" ref="766721923"/>
 						<int key="NSvFlags">292</int>
-						<string key="NSFrame">{{393, 399}, {240, 128}}</string>
+						<string key="NSFrame">{{393, 389}, {240, 166}}</string>
 						<reference key="NSSuperview" ref="766721923"/>
 						<bool key="IBUIOpaque">NO</bool>
 						<bool key="IBUIUserInteractionEnabled">NO</bool>
@@ -207,7 +207,7 @@
 					<object class="IBUILabel" id="896727228">
 						<reference key="NSNextResponder" ref="766721923"/>
 						<int key="NSvFlags">292</int>
-						<string key="NSFrame">{{403, 417}, {109, 22}}</string>
+						<string key="NSFrame">{{401, 410}, {109, 22}}</string>
 						<reference key="NSSuperview" ref="766721923"/>
 						<bool key="IBUIOpaque">NO</bool>
 						<bool key="IBUIClipsSubviews">YES</bool>
@@ -224,14 +224,14 @@
 					<object class="IBUILabel" id="704238452">
 						<reference key="NSNextResponder" ref="766721923"/>
 						<int key="NSvFlags">292</int>
-						<string key="NSFrame">{{400, 427}, {232, 100}}</string>
+						<string key="NSFrame">{{400, 429}, {232, 120}}</string>
 						<reference key="NSSuperview" ref="766721923"/>
 						<bool key="IBUIOpaque">NO</bool>
 						<bool key="IBUIClipsSubviews">YES</bool>
 						<int key="IBUIContentMode">7</int>
 						<bool key="IBUIUserInteractionEnabled">NO</bool>
 						<string key="targetRuntimeIdentifier">IBIPadFramework</string>
-						<string key="IBUIText">Select which teams are playing! You can set the number of hogs and have multiple teams play together.</string>
+						<string key="IBUIText">Select which teams are playing! Add hogs by tapping on them and set their color to figure friend and foe teams out. AI teams will appear with a small robot badge next their name.</string>
 						<reference key="IBUIFont" ref="818038162"/>
 						<reference key="IBUITextColor" ref="283637272"/>
 						<nil key="IBUIHighlightedColor"/>
@@ -790,7 +790,7 @@
 					<string>HelpPageViewController</string>
 					<string>UIResponder</string>
 					<string>UIControl</string>
-					<string>{{273, 67}, {1024, 768}}</string>
+					<string>{{273, 106}, {1024, 768}}</string>
 					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
 					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
 					<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
--- a/project_files/HedgewarsMobile/Classes/TeamConfigViewController.m	Thu Sep 02 21:49:36 2010 +0400
+++ b/project_files/HedgewarsMobile/Classes/TeamConfigViewController.m	Thu Sep 02 22:37:24 2010 +0200
@@ -99,13 +99,16 @@
             [cell addSubview:numberButton];
             [numberButton release];
 
-            SquareButtonView *squareButton = [[SquareButtonView alloc] initWithFrame:CGRectMake(12+88+7, 5, 36, 36)];
+            SquareButtonView *squareButton = [[SquareButtonView alloc] initWithFrame:CGRectMake(12+88+6, 5, 36, 36)];
             squareButton.tag = SQUAREBUTTON_TAG;
             [cell addSubview:squareButton];
             [squareButton release];
 
-            UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(12+88+7+36+7, 10, 250, 25)];
+            UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(12+88+6+36, 10, 103, 25)];
             label.textAlignment = UITextAlignmentLeft;
+            label.minimumFontSize = 11;
+            label.adjustsFontSizeToFitWidth = YES;
+            label.baselineAdjustment = UIBaselineAdjustmentAlignCenters;
             label.backgroundColor = [UIColor clearColor];
             label.font = [UIFont boldSystemFontOfSize:[UIFont labelFontSize]];
             label.textColor = UICOLOR_HW_YELLOW_TEXT;
@@ -126,12 +129,26 @@
         SquareButtonView *squareButton = (SquareButtonView *)[cell viewWithTag:SQUAREBUTTON_TAG];
         [squareButton selectColor:[[selectedRow objectForKey:@"color"] intValue]];
         squareButton.ownerDictionary = selectedRow;
+        
+        NSString *teamPath = [NSString stringWithFormat:@"%@/%@",TEAMS_DIRECTORY(),[selectedRow objectForKey:@"team"]];
+        NSDictionary *firstHog = [[[NSDictionary dictionaryWithContentsOfFile:teamPath] objectForKey:@"hedgehogs"] objectAtIndex:0];
+        if ([[firstHog objectForKey:@"level"] intValue]> 0) {
+            NSString *filePath = [NSString stringWithFormat:@"%@/cyborg.png",HATS_DIRECTORY()];
+            UIImage *sprite = [[UIImage alloc] initWithContentsOfFile:filePath andCutAt:CGRectMake(0, 2, 32, 32)];
+            UIImageView *spriteView = [[UIImageView alloc] initWithImage:sprite];
+            [sprite release];
+            
+            cell.accessoryView = spriteView;
+            [spriteView release];
+        } else
+            cell.accessoryView = nil;
     } else {
         cell = [aTableView dequeueReusableCellWithIdentifier:CellIdentifier1];
         if (cell == nil)
             cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier1] autorelease];
 
         cell.textLabel.text = [[[listOfTeams objectAtIndex:[indexPath row]] objectForKey:@"team"] stringByDeletingPathExtension];
+        cell.accessoryView = nil;
     }
 
     if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {