From 93ec6064407d6201714cc0507837a1a44d1f31aa Mon Sep 17 00:00:00 2001 From: Downforce Agent Date: Sun, 21 Jul 2024 14:46:23 -0500 Subject: [PATCH] change requires meta param to be a boolean[][] (shit is getting wild) --- firestar/src/main/java/Clifford.java | 6 +++++- firestar/src/main/java/Gonzo.java | 10 ++++++++++ firestar/src/main/java/Main.java | 4 ++-- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/firestar/src/main/java/Clifford.java b/firestar/src/main/java/Clifford.java index 9e41033..c73a217 100644 --- a/firestar/src/main/java/Clifford.java +++ b/firestar/src/main/java/Clifford.java @@ -28,6 +28,7 @@ import java.awt.event.ActionListener; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.io.File; +import java.util.ArrayList; import static javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE; @@ -220,7 +221,10 @@ public class Clifford implements ActionListener { if (hasScript) { container.put("loaderversion", 1); if (isSoundtrack) { - container.put("requires", new boolean[]{false, true, false, false}); // Pull localization files for patching. + ArrayList requiresTemp = new ArrayList<>(); + requiresTemp.add(new boolean[]{true, false, false, false}); + requiresTemp.add(new boolean[]{false, true, false, false}); + container.put("requires", requiresTemp); // Pull localization files for patching. } } else { container.put("loaderversion", 0); diff --git a/firestar/src/main/java/Gonzo.java b/firestar/src/main/java/Gonzo.java index 21cebb7..88af28a 100644 --- a/firestar/src/main/java/Gonzo.java +++ b/firestar/src/main/java/Gonzo.java @@ -55,6 +55,16 @@ public class Gonzo { // TODO 1.3: Implement requires boolean[] from Main.Mod // Rework system to choose the last PSARC and then add more before it when called by requires[] // Instead of the current system where it simply grabs them all and bloats the file. + // + // EDIT: requires[] is now an arraylist of booleans[], each a supported minimum combination of PSARCs. + // if any one of them is met, gonzo may continue + // for example: + // [false, true, false, false], [true, false, false, false] // user only needs either base psarc or patches PSARC, one or the other (having both is OK) + // [true, true, false, false] // user needs both base and patches + // [false, false, true, true] // user needs the HD DLC and the Fury DLC + // + // if none is found, assume "new boolean[]{false, false, false, false}" (no PSARCs required) + // (at least one of any 4 psarcs will already be checked for by MissPiggy so this is an okay way to implement it.) public void DeployMods(MissPiggy inv) { invoker = inv; diff --git a/firestar/src/main/java/Main.java b/firestar/src/main/java/Main.java index af2a2e1..32c2de3 100644 --- a/firestar/src/main/java/Main.java +++ b/firestar/src/main/java/Main.java @@ -85,8 +85,8 @@ public class Main { public int loaderversion = 0; //minimum required vint or feature level from Firestar public String author; // if null, "Author is unknown." public boolean enabled = true; - public boolean[] requires = new boolean[]{false, false, false, false}; // TODO: load optional "requires" array from mod meta if it exists. it will be base, patches, hd dlc, and fury dlc in that order. - // TODO: save 'false true false false' in ost gen if necessary (patches change localization) + public List requires = new ArrayList<>(); // TODO: load optional "requires" array from mod meta if it exists. it will be base, patches, hd dlc, and fury dlc in that order. + // TODO: save 'false true false false' in ost gen if necessary (patches change localization) } // Mods