From a74ce96920534221208e60eba5915cb5f9bcffba Mon Sep 17 00:00:00 2001 From: Downforce Agent Date: Wed, 10 Apr 2024 03:49:21 -0500 Subject: [PATCH] begin basic object structure and configuration i/o --- src/Kermit.java | 2 +- src/Main.java | 34 +++++++++++++++++++++++++++++++--- src/MissPiggy.java | 5 +++++ 3 files changed, 37 insertions(+), 4 deletions(-) diff --git a/src/Kermit.java b/src/Kermit.java index f99fa16..5b6a4a0 100644 --- a/src/Kermit.java +++ b/src/Kermit.java @@ -50,7 +50,7 @@ public class Kermit implements ActionListener { } } - JDialog frame = new JDialog();; + JDialog frame = new JDialog(); JButton button = new JButton("Next"); JButton button2 = new JButton("Quit"); JButton button3 = new JButton("Cancel"); diff --git a/src/Main.java b/src/Main.java index 1154498..2973284 100644 --- a/src/Main.java +++ b/src/Main.java @@ -21,19 +21,35 @@ import org.json.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.*; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.List; import javax.swing.*; public class Main { - public static String vstr = "debug"; - public static String vcode = "Natasha"; - public static int vint = 0; + // Build Information + public static final String vstr = "debug"; + public static final String vcode = "Natasha"; + public static final int vint = 0; + // User Settings public static String outpath; //game assets location public static String inpath = System.getProperty("user.home") + "/.firestar/"; //game assets location public static boolean repatch; //are we in compat mode? public static boolean wine; //are we on Linux, MINIX, BSD? //public static String psarc; //sdk location + public class Mod { + public String path; + public int version = 1; + //public int gameversion; //TODO detect a game version and compatibility? // no + public int priority = 0; + public String friendlyName; + } + + // Mods + public static List Mods; + public static void main(String[] args) { // license string System.out.printf("FIRESTAR MOD MANAGER for WipEout 2048\nversion " + vstr + " (codename " + vcode + ")\n" + @@ -63,7 +79,19 @@ public class Main { } public static void writeConf(){ + JSONObject container = new JSONObject(); + container.put("version", vint); + container.put("2048path", outpath); + container.put("HDpath", "TODO"); // proposed hd/fury support for ps3, will use very simplified Fast Mode due to less difficulty installing + container.put("safemode", repatch); + container.put("isUnix", wine); + container.put("currentPlaylist", "TODO"); // proposed feature: store separate mod lists in lists/ to load/save later? + try { + Files.write(Paths.get(System.getProperty("user.home") + "/.firestar/firestar.conf"), container.toString().getBytes()); + } catch (IOException e) { + throw new RuntimeException(e); + } } public static void loadConf(){ diff --git a/src/MissPiggy.java b/src/MissPiggy.java index 436a84d..c9e4d9d 100644 --- a/src/MissPiggy.java +++ b/src/MissPiggy.java @@ -16,9 +16,14 @@ * along with this program. If not, see https://www.gnu.org/licenses/. */ +import javax.swing.*; + public class MissPiggy { + JDialog frame = new JDialog(); public void MissPiggy() { // todo construct contents // todo display modlist + + } }