2024-04-09 23:06:05 -04:00
|
|
|
/*
|
|
|
|
* Firestar Mod Manager
|
|
|
|
* Copyright (C) 2024 bonkmaykr
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see https://www.gnu.org/licenses/.
|
|
|
|
*/
|
|
|
|
|
|
|
|
import org.json.*;
|
|
|
|
|
|
|
|
import java.awt.event.ActionEvent;
|
|
|
|
import java.awt.event.ActionListener;
|
|
|
|
import java.io.*;
|
2024-04-10 04:49:21 -04:00
|
|
|
import java.nio.file.Files;
|
|
|
|
import java.nio.file.Paths;
|
2024-04-12 00:26:26 -04:00
|
|
|
import java.util.*;
|
2024-04-09 23:06:05 -04:00
|
|
|
import javax.swing.*;
|
|
|
|
|
|
|
|
public class Main {
|
2024-04-10 04:49:21 -04:00
|
|
|
// Build Information
|
2024-04-13 11:04:35 -04:00
|
|
|
public static final String vstr = "PREALPHA";
|
2024-04-10 04:49:21 -04:00
|
|
|
public static final String vcode = "Natasha";
|
|
|
|
public static final int vint = 0;
|
2024-04-09 23:06:05 -04:00
|
|
|
|
2024-04-10 04:49:21 -04:00
|
|
|
// User Settings
|
2024-04-10 03:15:36 -04:00
|
|
|
public static String outpath; //game assets location
|
|
|
|
public static String inpath = System.getProperty("user.home") + "/.firestar/"; //game assets location
|
2024-04-09 23:06:05 -04:00
|
|
|
public static boolean repatch; //are we in compat mode?
|
2024-04-10 02:29:24 -04:00
|
|
|
public static boolean wine; //are we on Linux, MINIX, BSD?
|
2024-04-09 23:06:05 -04:00
|
|
|
//public static String psarc; //sdk location
|
|
|
|
|
2024-04-10 04:49:21 -04:00
|
|
|
public class Mod {
|
2024-04-19 19:06:52 -04:00
|
|
|
public String path; // file name
|
2024-04-10 04:49:21 -04:00
|
|
|
public int version = 1;
|
|
|
|
//public int gameversion; //TODO detect a game version and compatibility? // no
|
2024-04-19 19:06:52 -04:00
|
|
|
public int priority = 0; //unused
|
2024-04-10 04:49:21 -04:00
|
|
|
public String friendlyName;
|
2024-05-07 00:36:41 -04:00
|
|
|
public String description;
|
2024-04-12 00:26:26 -04:00
|
|
|
public String game; //TODO for multi game support
|
|
|
|
public int loaderversion = 0; //minimum required vint or feature level from Firestar
|
|
|
|
public String author; // if null, "Author is unknown."
|
2024-04-10 04:49:21 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
// Mods
|
2024-04-12 00:26:26 -04:00
|
|
|
public static List<Mod> Mods = new ArrayList<Mod>();
|
2024-04-10 04:49:21 -04:00
|
|
|
|
2024-04-09 23:06:05 -04:00
|
|
|
public static void main(String[] args) {
|
|
|
|
// license string
|
2024-04-10 02:29:24 -04:00
|
|
|
System.out.printf("FIRESTAR MOD MANAGER for WipEout 2048\nversion " + vstr + " (codename " + vcode + ")\n" +
|
|
|
|
"JVM host appears to be " + System.getProperty("os.name") +
|
2024-04-13 11:04:35 -04:00
|
|
|
"\nRunning from " + System.getProperty("user.dir") +
|
2024-04-10 02:29:24 -04:00
|
|
|
"\nCopyright (C) 2024 bonkmaykr\n\nThis program is free software: you can redistribute it and/or modify\n" +
|
2024-04-09 23:06:05 -04:00
|
|
|
"it under the terms of the GNU General Public License as published by\n" +
|
|
|
|
"the Free Software Foundation, either version 3 of the License, or\n" +
|
|
|
|
"(at your option) any later version.\n" +
|
|
|
|
"\n" +
|
|
|
|
"This program is distributed in the hope that it will be useful,\n" +
|
|
|
|
"but WITHOUT ANY WARRANTY; without even the implied warranty of\n" +
|
|
|
|
"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" +
|
|
|
|
"GNU General Public License for more details.\n" +
|
|
|
|
"\n" +
|
|
|
|
"You should have received a copy of the GNU General Public License\n" +
|
|
|
|
"along with this program. If not, see https://www.gnu.org/licenses/.\n\n\n\n");
|
|
|
|
|
|
|
|
//begin
|
|
|
|
// check and load configs
|
|
|
|
File fConf = new File(System.getProperty("user.home") + "/.firestar/firestar.conf");
|
|
|
|
if (!fConf.isFile()) {
|
|
|
|
new Kermit().setup(fConf); // this is a fresh install, run the OOBE.
|
2024-04-10 03:35:27 -04:00
|
|
|
} else {
|
|
|
|
// todo load modlist
|
2024-04-12 00:26:26 -04:00
|
|
|
new MissPiggy().Action(); // Quick! Start singing Firework by Katy Perry! (or open the main window i guess...)
|
2024-04-09 23:06:05 -04:00
|
|
|
}
|
2024-04-10 03:35:27 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
public static void writeConf(){
|
2024-04-10 04:49:21 -04:00
|
|
|
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?
|
2024-04-10 03:35:27 -04:00
|
|
|
|
2024-04-10 04:49:21 -04:00
|
|
|
try {
|
|
|
|
Files.write(Paths.get(System.getProperty("user.home") + "/.firestar/firestar.conf"), container.toString().getBytes());
|
|
|
|
} catch (IOException e) {
|
|
|
|
throw new RuntimeException(e);
|
|
|
|
}
|
2024-04-10 03:35:27 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
public static void loadConf(){
|
2024-04-09 23:06:05 -04:00
|
|
|
|
|
|
|
}
|
|
|
|
}
|