project_files/HedgewarsMobile/Classes/GeneralSettingsViewController.m
changeset 4947 cfac6aab84a0
parent 4540 9b614e420de5
child 4976 088d40d8aba2
--- a/project_files/HedgewarsMobile/Classes/GeneralSettingsViewController.m	Fri Feb 18 00:31:01 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/GeneralSettingsViewController.m	Sat Feb 19 01:01:03 2011 +0100
@@ -49,6 +49,11 @@
 -(void) viewWillDisappear:(BOOL)animated {
     [super viewWillDisappear:animated];
     [self.settingsDictionary writeToFile:SETTINGS_FILE() atomically:YES];
+
+    // we save the sound settings to respect that flag everywhere
+    NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
+    [prefs setObject:[NSNumber numberWithBool:[[self.settingsDictionary objectForKey:@"sound"] boolValue]] forKey:@"audio"];
+    [prefs synchronize];
 }
 
 #pragma mark -