aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAidan Ross <aross02@fairport.org>2023-05-23 08:54:08 -0400
committerAidan Ross <aross02@fairport.org>2023-05-23 08:54:08 -0400
commit4b6caad7d12ef23c9cc6299221ad7bb88f357404 (patch)
treeeeeb8fc3e6ca8c68c5b7066a2945417d5a4ac1f8
parent57eed1a3ec2b16535c6d4365115c09366ec03240 (diff)
parenta3c83b1bcddb002e61f691ccade3545c7d7e5693 (diff)
downloadNPEhero-4b6caad7d12ef23c9cc6299221ad7bb88f357404.tar.gz
NPEhero-4b6caad7d12ef23c9cc6299221ad7bb88f357404.tar.bz2
NPEhero-4b6caad7d12ef23c9cc6299221ad7bb88f357404.zip
Merge branch 'main' of https://gitlab.sowgro.net/guitarheros/guitarhero
-rw-r--r--src/main/SettingsController.java15
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();
}