change requires meta param to be a boolean[][] (shit is getting wild)

This commit is contained in:
Downforce Agent 2024-07-21 14:46:23 -05:00
parent 869566d732
commit 93ec606440
3 changed files with 17 additions and 3 deletions

View File

@ -28,6 +28,7 @@ import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter; import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent; import java.awt.event.WindowEvent;
import java.io.File; import java.io.File;
import java.util.ArrayList;
import static javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE; import static javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE;
@ -220,7 +221,10 @@ public class Clifford implements ActionListener {
if (hasScript) { if (hasScript) {
container.put("loaderversion", 1); container.put("loaderversion", 1);
if (isSoundtrack) { if (isSoundtrack) {
container.put("requires", new boolean[]{false, true, false, false}); // Pull localization files for patching. ArrayList<boolean[]> 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 { } else {
container.put("loaderversion", 0); container.put("loaderversion", 0);

View File

@ -55,6 +55,16 @@ public class Gonzo {
// TODO 1.3: Implement requires boolean[] from Main.Mod // 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[] // 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. // 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) { public void DeployMods(MissPiggy inv) {
invoker = inv; invoker = inv;

View File

@ -85,8 +85,8 @@ public class Main {
public int loaderversion = 0; //minimum required vint or feature level from Firestar public int loaderversion = 0; //minimum required vint or feature level from Firestar
public String author; // if null, "Author is unknown." public String author; // if null, "Author is unknown."
public boolean enabled = true; 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. public List<boolean[]> 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) // TODO: save 'false true false false' in ost gen if necessary (patches change localization)
} }
// Mods // Mods