Fix game crash caused by psarc not including root "data" folder and only it's contents.

This commit is contained in:
Downforce Agent 2024-05-07 13:08:12 -05:00
parent cd1d9eab3c
commit 21724bc04c

View File

@ -87,17 +87,17 @@ public class Gonzo {
final Thread managerThread = new Thread() { final Thread managerThread = new Thread() {
@Override @Override
public void run() { public void run() {
if (!Main.wine) { if (Main.repatch) {
POSIXRoutine(); CompatibilityRoutine();
} else { } else {
Win32Routine(); FastRoutine();
} }
} }
}; };
managerThread.start(); managerThread.start();
} }
private void POSIXRoutine() { private void CompatibilityRoutine() {
// create temporary working area for asset dump // create temporary working area for asset dump
new File(System.getProperty("user.home") + "/.firestar/temp/").mkdirs(); new File(System.getProperty("user.home") + "/.firestar/temp/").mkdirs();
@ -190,7 +190,7 @@ public class Gonzo {
// We need to clean up the path here on Linux to avoid psp2psarc getting confused about where the hell "/" is. // We need to clean up the path here on Linux to avoid psp2psarc getting confused about where the hell "/" is.
// In WINE it should see it as Z: by default, but if it's somewhere else then I don't have an elegant way of knowing what drive letter it's on, so // In WINE it should see it as Z: by default, but if it's somewhere else then I don't have an elegant way of knowing what drive letter it's on, so
// relative paths are kind of the only choice here. This can be extended to Windows too as it works there, though completely unnecessary. // relative paths are kind of the only choice here. This can be extended to Windows too as it works there, though completely unnecessary.
oFilesList2.add(p.replace("\\", "/").split(System.getProperty("user.home") + "/.firestar/temp/data/")[1]); oFilesList2.add(p.replace("\\", "/").split(System.getProperty("user.home") + "/.firestar/temp/")[1]);
} }
//oFilesList2.forEach(System.out::println); //debug //oFilesList2.forEach(System.out::println); //debug
File oFilesListO = new File(System.getProperty("user.home") + "/.firestar/temp/list.txt"); File oFilesListO = new File(System.getProperty("user.home") + "/.firestar/temp/list.txt");
@ -215,7 +215,7 @@ public class Gonzo {
try { try {
System.out.println("Firestar is compiling the final build"); System.out.println("Firestar is compiling the final build");
consoleDisplay.append("Firestar is compiling the final build" + "\n"); consoleDisplay.append("Firestar is compiling the final build" + "\n");
Process p = Runtime.getRuntime().exec(new String[]{"bash","-c","cd " + System.getProperty("user.home") + "/.firestar/temp/data" + ";wine ../../psp2psarc.exe create --skip-missing-files -j12 -a -i --input-file=../list.txt -o ../" + oArcTarget}); Process p = Runtime.getRuntime().exec(new String[]{"bash","-c","cd " + System.getProperty("user.home") + "/.firestar/temp" + ";wine ../psp2psarc.exe create --skip-missing-files -j12 -a -i --input-file=list.txt -o " + oArcTarget});
final Thread ioThread = new Thread() { final Thread ioThread = new Thread() {
@Override @Override
public void run() { public void run() {
@ -271,14 +271,14 @@ public class Gonzo {
AllowExit(); AllowExit();
} }
private void Win32Routine() { private void FastRoutine() {
} }
public void AllowExit() { public void AllowExit() {
scrollPane.getVerticalScrollBar().setValue(scrollPane.getVerticalScrollBar().getMaximum());
System.out.println("\n\nYou may now close the pop-up window."); System.out.println("\n\nYou may now close the pop-up window.");
consoleDisplay.append("\n\n\nYou may now close the pop-up window."); consoleDisplay.append("\n\n\nYou may now close the pop-up window.");
scrollPane.getVerticalScrollBar().setValue(scrollPane.getVerticalScrollBar().getMaximum());
frame.addWindowListener(new WindowAdapter() { frame.addWindowListener(new WindowAdapter() {
@Override @Override
public void windowClosing(WindowEvent e) public void windowClosing(WindowEvent e)