# HG changeset patch # User koda # Date 1358912538 -3600 # Node ID 4b66e60c9967ea47f4865a16675e7c30148ced5b # Parent 4f226963faef55552ee564825cf366e13d30b097 update sound preferences in ios settings ('sound' means 'sound effects' instead of 'sound enabled') diff -r 4f226963faef -r 4b66e60c9967 project_files/HedgewarsMobile/Classes/GeneralSettingsViewController.m --- a/project_files/HedgewarsMobile/Classes/GeneralSettingsViewController.m Wed Jan 23 03:37:27 2013 +0100 +++ b/project_files/HedgewarsMobile/Classes/GeneralSettingsViewController.m Wed Jan 23 04:42:18 2013 +0100 @@ -51,30 +51,14 @@ #pragma mark - -(void) switchValueChanged:(id) sender { UISwitch *theSwitch = (UISwitch *)sender; - UISwitch *theOtherSwitch = nil; NSUserDefaults *settings = [NSUserDefaults standardUserDefaults]; switch (theSwitch.tag) { case 10: //soundSwitch - // setting this off will turn off also the switch below (music) [settings setObject:[NSNumber numberWithBool:theSwitch.on] forKey:@"sound"]; - [settings setObject:[NSNumber numberWithBool:NO] forKey:@"music"]; - theOtherSwitch = (UISwitch *)[self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:1 inSection:1]].accessoryView; - [theOtherSwitch setOn:NO animated:YES]; - - // since switching sound on won't turn music on anyways, we can always turn off music - [[AudioManagerController mainManager]pauseBackgroundMusic]; - [settings setObject:[NSNumber numberWithBool:NO] forKey:@"music"]; break; case 20: //musicSwitch - // if switch above (sound) is off, never turn on - if (NO == [[settings objectForKey:@"sound"] boolValue]) { - [settings setObject:[NSNumber numberWithBool:NO] forKey:@"music"]; - theOtherSwitch = (UISwitch *)[self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:1 inSection:1]].accessoryView; - [theOtherSwitch setOn:NO animated:YES]; - } else - [settings setObject:[NSNumber numberWithBool:theSwitch.on] forKey:@"music"]; - + [settings setObject:[NSNumber numberWithBool:theSwitch.on] forKey:@"music"]; if (theSwitch.on) [[AudioManagerController mainManager] playBackgroundMusic]; else @@ -195,7 +179,7 @@ switchContent = (UISwitch *)cell.accessoryView; if (row == 0) { - cell.textLabel.text = NSLocalizedString(@"Sound", @"from the settings table"); + cell.textLabel.text = NSLocalizedString(@"Sound Effects", @"from the settings table"); switchContent.on = [[settings objectForKey:@"sound"] boolValue]; switchContent.tag = 10; } else {