diff options
| author | inyourwalls <inyourwalls@tutanota.com> | 2024-02-19 17:46:42 -0500 |
|---|---|---|
| committer | inyourwalls <inyourwalls@tutanota.com> | 2024-02-19 17:46:42 -0500 |
| commit | 327be47178bebb323f618c6a6d36a12d3b15dbe4 (patch) | |
| tree | 3332675ceb9d438428bdc2b89a3f05e95c057cf2 /src/main/java/net/inyourwalls/customlevelcolour/CustomLevelColourConfig.java | |
| parent | fc6f881f9ca78c9f81e5a40291f9bd292789219a (diff) | |
create config class, start working on config screen
Diffstat (limited to 'src/main/java/net/inyourwalls/customlevelcolour/CustomLevelColourConfig.java')
| -rw-r--r-- | src/main/java/net/inyourwalls/customlevelcolour/CustomLevelColourConfig.java | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/main/java/net/inyourwalls/customlevelcolour/CustomLevelColourConfig.java b/src/main/java/net/inyourwalls/customlevelcolour/CustomLevelColourConfig.java new file mode 100644 index 0000000..b963f02 --- /dev/null +++ b/src/main/java/net/inyourwalls/customlevelcolour/CustomLevelColourConfig.java @@ -0,0 +1,26 @@ +package net.inyourwalls.customlevelcolour; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; + +import java.io.FileReader; +import java.io.FileWriter; +import java.io.IOException; +import java.nio.file.Path; + +public class CustomLevelColourConfig { + private static final Gson GSON = new GsonBuilder().setPrettyPrinting().create(); + public int outlineColour = 0x000000; + public int textColour = 0x80ff20; + + public static CustomLevelColourConfig load(Path path) throws IOException { + FileReader reader = new FileReader(path.toFile()); + return GSON.fromJson(reader, CustomLevelColourConfig.class); + } + + public static void save(Path path) throws IOException { + FileWriter writer = new FileWriter(path.toFile()); + GSON.toJson(writer); + writer.close(); + } +} |
