diff options
Diffstat (limited to '')
| -rw-r--r-- | src/main/SettingsController.java | 15 | 
1 files changed, 13 insertions, 2 deletions
| diff --git a/src/main/SettingsController.java b/src/main/SettingsController.java index 2e2d988..0dcf707 100644 --- a/src/main/SettingsController.java +++ b/src/main/SettingsController.java @@ -24,6 +24,19 @@ public class SettingsController  	public void saveAndWrite(int newEffVol, int newMusVol, boolean isFull)
  	{
 +		settings.put("musicVol", newMusVol);
 +		settings.put("effectsVol", newEffVol);
 +		settings.put("fullscreen", isFull);
 +
 +		try (FileWriter file = new FileWriter("settings.json")) 
 +		{
 +            //write the settings JSONObject instance to the file
 +            file.write(settings.toJSONString()); 
 +            file.flush();
 + 
 +        } catch (IOException e) {
 +            e.printStackTrace();
 +        }
  	}
  	public void readFile() throws ParseException
 @@ -42,12 +55,10 @@ public class SettingsController  		}
  		catch (FileNotFoundException e) 
  		{
 -			// TODO Auto-generated catch block
  			e.printStackTrace();
  		} 
  		catch (IOException e) 
  		{
 -			// TODO Auto-generated catch block
  			e.printStackTrace();
  		}
 | 
