project_files/HedgewarsMobile/Classes/SchemeWeaponConfigViewController.m
branchios-revival
changeset 11147 f9c460720e02
parent 11146 f5e552f97eda
child 11148 064a53861759
equal deleted inserted replaced
11146:f5e552f97eda 11147:f9c460720e02
   320             NSArray *scriptOptions = [configFile componentsSeparatedByString:@"\n"];
   320             NSArray *scriptOptions = [configFile componentsSeparatedByString:@"\n"];
   321             [configFile release];
   321             [configFile release];
   322 
   322 
   323             self.scriptCommand = [NSString stringWithFormat:@"escript Scripts/Multiplayer/%@",self.selectedScript];
   323             self.scriptCommand = [NSString stringWithFormat:@"escript Scripts/Multiplayer/%@",self.selectedScript];
   324             NSString *scheme = [scriptOptions objectAtIndex:0];
   324             NSString *scheme = [scriptOptions objectAtIndex:0];
   325             if ([scheme isEqualToString:@"locked"]) {
   325             if ([scheme isEqualToString:@"locked"])
       
   326             {
   326                 self.selectedScheme = @"Default.plist";
   327                 self.selectedScheme = @"Default.plist";
   327                 [self.topControl setEnabled:NO forSegmentAtIndex:0];
   328                 [self.topControl setEnabled:NO forSegmentAtIndex:0];
   328             } else {
   329             }
   329                 self.selectedScheme = [NSString stringWithFormat:@"%@.plist",scheme];
   330             else
       
   331             {
       
   332                 if (![scheme isEqualToString:@"*"])
       
   333                 {
       
   334                     self.selectedScheme = [NSString stringWithFormat:@"%@.plist",scheme];
       
   335                 }
   330                 [self.topControl setEnabled:YES forSegmentAtIndex:0];
   336                 [self.topControl setEnabled:YES forSegmentAtIndex:0];
   331             }
   337             }
   332 
   338 
   333             NSString *weapon = [scriptOptions objectAtIndex:1];
   339             NSString *weapon = [scriptOptions objectAtIndex:1];
   334             if ([weapon isEqualToString:@"locked"]) {
   340             if ([weapon isEqualToString:@"locked"])
       
   341             {
   335                 self.selectedWeapon = @"Default.plist";
   342                 self.selectedWeapon = @"Default.plist";
   336                 [self.topControl setEnabled:NO forSegmentAtIndex:1];
   343                 [self.topControl setEnabled:NO forSegmentAtIndex:1];
   337             } else {
   344             }
   338                 self.selectedWeapon = [NSString stringWithFormat:@"%@.plist",weapon];
   345             else
       
   346             {
       
   347                 if (![weapon isEqualToString:@"*"])
       
   348                 {
       
   349                     self.selectedWeapon = [NSString stringWithFormat:@"%@.plist",weapon];
       
   350                 }
   339                 [self.topControl setEnabled:YES forSegmentAtIndex:1];
   351                 [self.topControl setEnabled:YES forSegmentAtIndex:1];
   340             }
   352             }
   341         }
   353         }
   342 
   354 
   343         [aTableView selectRowAtIndexPath:indexPath animated:YES scrollPosition:UITableViewScrollPositionNone];
   355         [aTableView selectRowAtIndexPath:indexPath animated:YES scrollPosition:UITableViewScrollPositionNone];