project_files/HedgewarsMobile/Classes/GeneralSettingsViewController.m
changeset 5451 e359a79e3d08
parent 5370 a3f87be7b09a
child 5662 99083392cd4f
equal deleted inserted replaced
5449:a03d0acd7f06 5451:e359a79e3d08
    82 
    82 
    83             break;
    83             break;
    84         case 30:    //alternateSwitch
    84         case 30:    //alternateSwitch
    85             [settings setObject:[NSNumber numberWithBool:theSwitch.on] forKey:@"alternate"];
    85             [settings setObject:[NSNumber numberWithBool:theSwitch.on] forKey:@"alternate"];
    86             break;
    86             break;
       
    87         case 90:    //synched weapons/scheme
       
    88             [settings setObject:[NSNumber numberWithBool:theSwitch.on] forKey:@"sync_ws"];
       
    89             break;
    87         case 70:    //enhanced graphics
    90         case 70:    //enhanced graphics
    88             [settings setObject:[NSNumber numberWithBool:theSwitch.on] forKey:@"enhanced"];
    91             [settings setObject:[NSNumber numberWithBool:theSwitch.on] forKey:@"enhanced"];
    89             break;
    92             break;
    90         case 80:    //nomultitasking
    93         case 80:    //nomultitasking
    91             [settings setObject:[NSNumber numberWithBool:theSwitch.on] forKey:@"multitasking"];
    94             [settings setObject:[NSNumber numberWithBool:theSwitch.on] forKey:@"multitasking"];
   115 }
   118 }
   116 
   119 
   117 -(NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger )section {
   120 -(NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger )section {
   118     switch (section) {
   121     switch (section) {
   119         case 0:     // user and pass
   122         case 0:     // user and pass
   120             return 1;   // set 2 here for the password field
   123             return 1;   // set 2 here to show the password field
   121             break;
   124             break;
   122         case 1:     // audio
   125         case 1:     // audio
   123             return 2;
   126             return 2;
   124             break;
   127             break;
   125         case 2:     // other stuff
   128         case 2:     // other options
   126             if (IS_IPAD() == YES)
   129             return 5;
   127                 return 4;
       
   128             else
       
   129                 return 3;
       
   130             break;
   130             break;
   131         default:
   131         default:
   132             DLog(@"Nope");
   132             DLog(@"Nope");
   133             break;
   133             break;
   134     }
   134     }
   223                 cell.accessoryView = theSwitch;
   223                 cell.accessoryView = theSwitch;
   224                 [theSwitch release];
   224                 [theSwitch release];
   225             }
   225             }
   226             
   226             
   227             switchContent = (UISwitch *)cell.accessoryView;
   227             switchContent = (UISwitch *)cell.accessoryView;
       
   228             cell.detailTextLabel.adjustsFontSizeToFitWidth = YES;
   228             switch (row) {
   229             switch (row) {
   229                 case 0:
   230                 case 0:
   230                     cell.textLabel.text = NSLocalizedString(@"Alternate Damage", @"");
   231                     cell.textLabel.text = NSLocalizedString(@"Alternate Damage", @"");
   231                     cell.detailTextLabel.text = NSLocalizedString(@"Damage popups will notify you on every single hit", @"");
   232                     cell.detailTextLabel.text = NSLocalizedString(@"Damage popups will notify you on every single hit", @"");
   232                     switchContent.on = [[settings objectForKey:@"alternate"] boolValue];
   233                     switchContent.on = [[settings objectForKey:@"alternate"] boolValue];
   233                     switchContent.tag = 30;
   234                     switchContent.tag = 30;
   234                     break;
   235                     break;
   235                 case 1:
   236                 case 1:
   236                     cell.textLabel.text = NSLocalizedString(@"Enanched Graphics Mode", @"");
   237                     cell.textLabel.text = NSLocalizedString(@"Sync Schemes and Weapons", @"");
   237                     cell.detailTextLabel.text = NSLocalizedString(@"The game will use more memory so it could crash!", @"");
   238                     cell.detailTextLabel.text = NSLocalizedString(@"Choosing a Scheme will select its associated Weapon", @"");
   238                     switchContent.on = [[settings objectForKey:@"enhanced"] boolValue];
   239                     switchContent.on = [[settings objectForKey:@"sync_ws"] boolValue];
   239                     switchContent.tag = 70;
   240                     switchContent.tag = 90;
   240                     break;
   241                     break;
   241                 case 2:
   242                 case 2:
   242                     cell.textLabel.text = NSLocalizedString(@"Multitasking Enabled", @"");
   243                     cell.textLabel.text = NSLocalizedString(@"Multitasking", @"");
   243                     cell.detailTextLabel.text = NSLocalizedString(@"Disable it in case of issues when returing in game", @"");
   244                     cell.detailTextLabel.text = NSLocalizedString(@"Disable it in case of issues when returing in game", @"");
   244                     switchContent.on = [[settings objectForKey:@"multitasking"] boolValue];
   245                     switchContent.on = [[settings objectForKey:@"multitasking"] boolValue];
   245                     switchContent.tag = 80;
   246                     switchContent.tag = 80;
   246                     break;
   247                     break;
   247                 case 3:
   248                 case 3:
       
   249                     cell.textLabel.text = NSLocalizedString(@"Enanched Graphics", @"");
       
   250                     cell.detailTextLabel.text = NSLocalizedString(@"Beware that the game will consume more memory", @"");
       
   251                     switchContent.on = [[settings objectForKey:@"enhanced"] boolValue];
       
   252                     switchContent.tag = 70;
       
   253                     // prevent the oldest devices to even think about enabling it
       
   254                     if (IS_NOT_POWERFUL(getModelType()))
       
   255                         switchContent.enabled = NO;
       
   256                     break;
       
   257                 case 4:
   248                     cell.textLabel.text = NSLocalizedString(@"Classic Ammo Menu", @"");
   258                     cell.textLabel.text = NSLocalizedString(@"Classic Ammo Menu", @"");
   249                     cell.detailTextLabel.text = NSLocalizedString(@"Select which style of ammo menu you prefer",@"");
   259                     cell.detailTextLabel.text = NSLocalizedString(@"Select which style of ammo menu you prefer",@"");
   250                     switchContent.on = [[settings objectForKey:@"classic_menu"] boolValue];
   260                     switchContent.on = [[settings objectForKey:@"classic_menu"] boolValue];
   251                     switchContent.tag = 60;
   261                     switchContent.tag = 60;
       
   262                     // remove this when classic ammomenu works on iphone as well
       
   263                     if (IS_IPAD() == NO)
       
   264                         switchContent.enabled = NO;
   252                     break;
   265                     break;
   253                 default:
   266                 default:
   254                     DLog(@"Nope");
   267                     DLog(@"Nope");
   255                     break;
   268                     break;
   256             }
   269             }