Compare commits
4 Commits
2fcf7612a6
...
2de4167cea
Author | SHA1 | Date | |
---|---|---|---|
2de4167cea | |||
c5be641a20 | |||
317eeedb29 | |||
f209f5f37a |
|
@ -108,7 +108,7 @@
|
|||
</component>
|
||||
</children>
|
||||
</grid>
|
||||
<grid id="c82fd" layout-manager="GridLayoutManager" row-count="2" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<grid id="1000f" layout-manager="GridLayoutManager" row-count="2" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||
|
@ -120,54 +120,53 @@
|
|||
</properties>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<component id="11210" class="javax.swing.JRadioButton" binding="baseRad">
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="6" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<background color="-15128227"/>
|
||||
<focusPainted value="false"/>
|
||||
<foreground color="-1"/>
|
||||
<horizontalTextPosition value="10"/>
|
||||
<text value="Base game only, no updates"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="94d8" class="javax.swing.JRadioButton" binding="hdRad">
|
||||
<constraints>
|
||||
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="5" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<background color="-15128227"/>
|
||||
<focusPainted value="false"/>
|
||||
<foreground color="-1"/>
|
||||
<horizontalTextPosition value="10"/>
|
||||
<text value="HD DLC, without Fury"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="69445" class="javax.swing.JRadioButton" binding="patchRad">
|
||||
<component id="ec9c0" class="javax.swing.JCheckBox" binding="patchCheck">
|
||||
<constraints>
|
||||
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="10" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<background color="-15128227"/>
|
||||
<focusPainted value="false"/>
|
||||
<font name="Exo 2"/>
|
||||
<foreground color="-1"/>
|
||||
<text value="Base game only, 1.04"/>
|
||||
<horizontalTextPosition value="11"/>
|
||||
<text value="Updates"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="35def" class="javax.swing.JRadioButton" binding="furyRad">
|
||||
<component id="a6e9" class="javax.swing.JCheckBox" binding="baseCheck">
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="6" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<background color="-15128227"/>
|
||||
<font name="Exo 2"/>
|
||||
<foreground color="-1"/>
|
||||
<horizontalTextPosition value="10"/>
|
||||
<text value="Base game"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="f3723" class="javax.swing.JCheckBox" binding="hdCheck">
|
||||
<constraints>
|
||||
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="5" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<background color="-15128227"/>
|
||||
<font name="Exo 2"/>
|
||||
<foreground color="-1"/>
|
||||
<horizontalTextPosition value="10"/>
|
||||
<text value="HD Add-On Pack"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="5ed0c" class="javax.swing.JCheckBox" binding="furyCheck">
|
||||
<constraints>
|
||||
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="9" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<background color="-15128227"/>
|
||||
<focusPainted value="false"/>
|
||||
<font name="Exo 2"/>
|
||||
<foreground color="-1"/>
|
||||
<horizontalAlignment value="10"/>
|
||||
<horizontalTextPosition value="11"/>
|
||||
<selected value="true"/>
|
||||
<text value="HD Fury DLC"/>
|
||||
<verticalTextPosition value="0"/>
|
||||
<selected value="false"/>
|
||||
<text value="Fury Add-On Pack"/>
|
||||
</properties>
|
||||
</component>
|
||||
</children>
|
||||
|
|
|
@ -25,6 +25,7 @@ import java.awt.event.WindowAdapter;
|
|||
import java.awt.event.WindowEvent;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.*;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class Bert implements ActionListener {
|
||||
BufferedImage windowIcon;
|
||||
|
@ -32,10 +33,10 @@ public class Bert implements ActionListener {
|
|||
private JPanel frameContainer;
|
||||
private JButton cancelbtn;
|
||||
private JButton downloadbtn;
|
||||
private JRadioButton baseRad;
|
||||
private JRadioButton patchRad;
|
||||
private JRadioButton hdRad;
|
||||
private JRadioButton furyRad;
|
||||
private JCheckBox patchCheck;
|
||||
private JCheckBox baseCheck;
|
||||
private JCheckBox hdCheck;
|
||||
private JCheckBox furyCheck;
|
||||
private ButtonGroup radios = new ButtonGroup();
|
||||
|
||||
private JFrame invoker;
|
||||
|
@ -56,11 +57,6 @@ public class Bert implements ActionListener {
|
|||
frame.setLocationRelativeTo(parent);
|
||||
frame.setAlwaysOnTop(true);
|
||||
|
||||
radios.add(baseRad);
|
||||
radios.add(patchRad);
|
||||
radios.add(hdRad);
|
||||
radios.add(furyRad);
|
||||
|
||||
cancelbtn.addActionListener(this);
|
||||
downloadbtn.addActionListener(this);
|
||||
|
||||
|
@ -112,29 +108,31 @@ public class Bert implements ActionListener {
|
|||
new File(Main.inpath + "dlc1.psarc").delete();
|
||||
new File(Main.inpath + "dlc2.psarc").delete();
|
||||
|
||||
Main.ArcTarget type;
|
||||
Main.ArcKey key;
|
||||
if (baseRad.isSelected()) {
|
||||
type = Main.ArcTarget.BASE;
|
||||
key = Main.ArcKey.BASE;
|
||||
ArrayList<Main.ArcTarget> arcs = new ArrayList<Main.ArcTarget>();
|
||||
ArrayList<Main.ArcKey> keys = new ArrayList<Main.ArcKey>();
|
||||
if (baseCheck.isSelected()) {
|
||||
arcs.add(Main.ArcTarget.BASE);
|
||||
keys.add(Main.ArcKey.BASE);
|
||||
System.out.println("Begin download of data (Game version 1.0)");
|
||||
} else
|
||||
if (patchRad.isSelected()) {
|
||||
type = Main.ArcTarget.LATEST;
|
||||
key = Main.ArcKey.LATEST;
|
||||
}
|
||||
if (patchCheck.isSelected()) {
|
||||
arcs.add(Main.ArcTarget.LATEST);
|
||||
keys.add(Main.ArcKey.LATEST);
|
||||
System.out.println("Begin download of data2 (Game version 1.04)");
|
||||
} else
|
||||
if (hdRad.isSelected()) {
|
||||
type = Main.ArcTarget.ADDON_HD;
|
||||
key = Main.ArcKey.ADDON_HD;
|
||||
}
|
||||
if (hdCheck.isSelected()) {
|
||||
arcs.add(Main.ArcTarget.ADDON_HD);
|
||||
keys.add(Main.ArcKey.ADDON_HD);
|
||||
System.out.println("Begin download of dlc1 (HD DLC)");
|
||||
} else
|
||||
if (furyRad.isSelected()) {
|
||||
type = Main.ArcTarget.ADDON_HD_FURY;
|
||||
key = Main.ArcKey.ADDON_HD_FURY;
|
||||
}
|
||||
if (furyCheck.isSelected()) {
|
||||
arcs.add(Main.ArcTarget.ADDON_HD_FURY);
|
||||
keys.add(Main.ArcKey.ADDON_HD_FURY);
|
||||
System.out.println("Begin download of dlc2 (Fury DLC)");
|
||||
} else {
|
||||
return; // fire hydrant
|
||||
}
|
||||
if (arcs.isEmpty()) {
|
||||
JOptionPane.showMessageDialog(invoker, "Select one or more asset packs.", "Error", JOptionPane.ERROR_MESSAGE);
|
||||
return;
|
||||
}
|
||||
|
||||
frame.dispose();
|
||||
|
@ -143,119 +141,155 @@ public class Bert implements ActionListener {
|
|||
Thread downloaderPopupThread = new Thread(new Runnable() { // run on separate thread to prevent GUI freezing
|
||||
@Override
|
||||
public void run() {
|
||||
// download file
|
||||
boolean downloader = new Fozzie().DownloadFile(type.toString(), Main.inpath, "asset.pkg");
|
||||
if (!downloader) {
|
||||
// cleanup
|
||||
new File(Main.inpath + "asset.pkg").delete();
|
||||
|
||||
// restore controls
|
||||
invoker.setEnabled(true);
|
||||
invoker.setVisible(true);
|
||||
invoker.toFront();
|
||||
invoker.repaint();
|
||||
return;
|
||||
}
|
||||
|
||||
// dump contents
|
||||
System.out.println("Extracting asset.pkg");
|
||||
Fozzie popup = new Fozzie();
|
||||
popup.displayTextOnly("Extracting PKG...", "Extracting");
|
||||
Process p;
|
||||
try {
|
||||
if (!Main.windows) {p = Runtime.getRuntime().exec(new String[]{"bash","-c","cd " + Main.inpath + ";wine pkg2zip.exe -x asset.pkg " + key.toString()});}
|
||||
else {p = Runtime.getRuntime().exec(new String[]{Main.inpath + "pkg2zip.exe", "-x", "asset.pkg", key.toString()}, null, new File(Main.inpath));} //inpath cannot change here
|
||||
InputStream debugin = new BufferedInputStream(p.getInputStream());
|
||||
OutputStream debugout = new BufferedOutputStream(System.out);
|
||||
int c;
|
||||
while ((c = debugin.read()) != -1) {
|
||||
debugout.write(c);
|
||||
for (Main.ArcTarget type : arcs) {
|
||||
String key = "";
|
||||
String arcname = "";
|
||||
switch (type) {
|
||||
case BASE :
|
||||
key = Main.ArcKey.BASE.toString();
|
||||
arcname = "Base game";
|
||||
break;
|
||||
case LATEST :
|
||||
key = Main.ArcKey.LATEST.toString();
|
||||
arcname = "Updates";
|
||||
break;
|
||||
case ADDON_HD :
|
||||
key = Main.ArcKey.ADDON_HD.toString();
|
||||
arcname = "HD Add-On Pack";
|
||||
break;
|
||||
case ADDON_HD_FURY :
|
||||
key = Main.ArcKey.ADDON_HD_FURY.toString();
|
||||
arcname = "Fury Add-On Pack";
|
||||
break;
|
||||
}
|
||||
if (key.isEmpty()) {
|
||||
System.out.println("Internal Error: Bert got dementia. Get a programmer!");
|
||||
JOptionPane.showMessageDialog(invoker, "Internal Error: Bert got dementia. Get a programmer!", "Fatal Error", JOptionPane.ERROR_MESSAGE);
|
||||
return;
|
||||
}
|
||||
debugin.close();
|
||||
debugout.close();
|
||||
p.waitFor();
|
||||
} catch (Exception e) {
|
||||
System.out.println(e.getMessage());
|
||||
JOptionPane.showMessageDialog(invoker, "CRITICAL FAILURE: " + e.getMessage(), "Fatal Error", JOptionPane.ERROR_MESSAGE);
|
||||
new File(Main.inpath + "asset.pkg").delete();
|
||||
invoker.setEnabled(true);
|
||||
invoker.setVisible(true);
|
||||
invoker.toFront();
|
||||
invoker.repaint();
|
||||
return;
|
||||
}
|
||||
|
||||
// decrypt
|
||||
System.out.println("Decrypting asset.pkg");
|
||||
String extracted;
|
||||
String name;
|
||||
if (type == Main.ArcTarget.BASE) {
|
||||
extracted = "app/PCSA00015";
|
||||
name = "data.psarc";
|
||||
} else if (type == Main.ArcTarget.LATEST) {
|
||||
extracted = "patch/PCSA00015";
|
||||
name = "data2.psarc";
|
||||
} else if (type == Main.ArcTarget.ADDON_HD) {
|
||||
extracted = "addcont/PCSA00015/DLC1W2048PACKAGE";
|
||||
name = "dlc1.psarc";
|
||||
} else if (type == Main.ArcTarget.ADDON_HD_FURY) { // this is not "always true" - intellij is actually very dumj
|
||||
extracted = "addcont/PCSA00015/DLC2W2048PACKAGE";
|
||||
name = "dlc2.psarc";
|
||||
} else {
|
||||
System.out.println("Internal Error: Bert got dementia. Get a programmer!");
|
||||
JOptionPane.showMessageDialog(invoker, "Internal Error: Bert got dementia. Get a programmer!", "Fatal Error", JOptionPane.ERROR_MESSAGE);
|
||||
// download file
|
||||
Fozzie downloaderHandler = new Fozzie();
|
||||
boolean downloader = downloaderHandler.DownloadFile(type.toString(), Main.inpath, "asset.pkg", arcname);
|
||||
|
||||
if (!downloader) {
|
||||
// cleanup
|
||||
new File(Main.inpath + "asset.pkg").delete();
|
||||
|
||||
// restore controls
|
||||
invoker.setEnabled(true);
|
||||
invoker.setVisible(true);
|
||||
invoker.toFront();
|
||||
invoker.repaint();
|
||||
return;
|
||||
}
|
||||
|
||||
// dump contents
|
||||
System.out.println("Extracting " + arcname);
|
||||
Fozzie popup = new Fozzie();
|
||||
popup.displayTextOnly("Extracting" + arcname + "...", "Extracting");
|
||||
Process p;
|
||||
try {
|
||||
if (!Main.windows) {
|
||||
p = Runtime.getRuntime().exec(new String[]{"bash", "-c", "cd " + Main.inpath + ";wine pkg2zip.exe -x asset.pkg " + key.toString()});
|
||||
} else {
|
||||
p = Runtime.getRuntime().exec(new String[]{Main.inpath + "pkg2zip.exe", "-x", "asset.pkg", key.toString()}, null, new File(Main.inpath));
|
||||
} //inpath cannot change here
|
||||
InputStream debugin = new BufferedInputStream(p.getInputStream());
|
||||
OutputStream debugout = new BufferedOutputStream(System.out);
|
||||
int c;
|
||||
while ((c = debugin.read()) != -1) {
|
||||
debugout.write(c);
|
||||
}
|
||||
debugin.close();
|
||||
debugout.close();
|
||||
p.waitFor();
|
||||
} catch (Exception e) {
|
||||
System.out.println(e.getMessage());
|
||||
JOptionPane.showMessageDialog(invoker, "CRITICAL FAILURE: " + e.getMessage(), "Fatal Error", JOptionPane.ERROR_MESSAGE);
|
||||
new File(Main.inpath + "asset.pkg").delete();
|
||||
invoker.setEnabled(true);
|
||||
invoker.setVisible(true);
|
||||
invoker.toFront();
|
||||
invoker.repaint();
|
||||
return;
|
||||
}
|
||||
|
||||
// decrypt
|
||||
System.out.println("Decrypting asset.pkg");
|
||||
String extracted;
|
||||
String name;
|
||||
if (type == Main.ArcTarget.BASE) {
|
||||
extracted = "app/PCSA00015";
|
||||
name = "data.psarc";
|
||||
} else if (type == Main.ArcTarget.LATEST) {
|
||||
extracted = "patch/PCSA00015";
|
||||
name = "data2.psarc";
|
||||
} else if (type == Main.ArcTarget.ADDON_HD) {
|
||||
extracted = "addcont/PCSA00015/DLC1W2048PACKAGE";
|
||||
name = "dlc1.psarc";
|
||||
} else if (type == Main.ArcTarget.ADDON_HD_FURY) { // this is not "always true" - intellij is actually very dumj
|
||||
extracted = "addcont/PCSA00015/DLC2W2048PACKAGE";
|
||||
name = "dlc2.psarc";
|
||||
} else {
|
||||
System.out.println("Internal Error: Bert got dementia. Get a programmer!");
|
||||
JOptionPane.showMessageDialog(invoker, "Internal Error: Bert got dementia. Get a programmer!", "Fatal Error", JOptionPane.ERROR_MESSAGE);
|
||||
new File(Main.inpath + "asset.pkg").delete();
|
||||
Main.deleteDir(new File(Main.inpath + "app/"));
|
||||
Main.deleteDir(new File(Main.inpath + "patch/"));
|
||||
Main.deleteDir(new File(Main.inpath + "addcont/"));
|
||||
invoker.setEnabled(true);
|
||||
invoker.setVisible(true);
|
||||
invoker.toFront();
|
||||
invoker.repaint();
|
||||
return;
|
||||
}
|
||||
|
||||
popup.setText("<html>Decrypting protected PFS:<br/>" + extracted + "</html>", "Decrypting");
|
||||
|
||||
try {
|
||||
if (!Main.windows) {
|
||||
p = Runtime.getRuntime().exec(new String[]{"bash", "-c", "cd " + Main.inpath + ";wine psvpfsparser.exe -i " + extracted + " -o ./temp/ -z " + key.toString() + " -f cma.henkaku.xyz"});
|
||||
} else {
|
||||
p = Runtime.getRuntime().exec(new String[]{Main.inpath + "psvpfsparser.exe", "-i", extracted, "-o", "./temp/", "-z", key.toString(), "-f", "cma.henkaku.xyz"}, null, new File(Main.inpath));
|
||||
}
|
||||
InputStream debugin = new BufferedInputStream(p.getInputStream());
|
||||
OutputStream debugout = new BufferedOutputStream(System.out);
|
||||
int c;
|
||||
while ((c = debugin.read()) != -1) {
|
||||
debugout.write(c);
|
||||
}
|
||||
debugin.close();
|
||||
debugout.close();
|
||||
p.waitFor();
|
||||
} catch (Exception e) {
|
||||
System.out.println(e.getMessage());
|
||||
JOptionPane.showMessageDialog(invoker, "CRITICAL FAILURE: " + e.getMessage(), "Fatal Error", JOptionPane.ERROR_MESSAGE);
|
||||
new File(Main.inpath + "asset.pkg").delete();
|
||||
Main.deleteDir(new File(Main.inpath + "app/"));
|
||||
Main.deleteDir(new File(Main.inpath + "patch/"));
|
||||
Main.deleteDir(new File(Main.inpath + "addcont/"));
|
||||
invoker.setEnabled(true);
|
||||
invoker.setVisible(true);
|
||||
invoker.toFront();
|
||||
invoker.repaint();
|
||||
return;
|
||||
}
|
||||
|
||||
popup.setText("Deleting temporary files...", "Cleaning Up");
|
||||
|
||||
// stage & cleanup
|
||||
System.out.println("Cleaning up");
|
||||
new File(Main.inpath + "asset.pkg").delete();
|
||||
new File(Main.inpath + "temp/PSP2/" + name).renameTo(new File(Main.inpath + name));
|
||||
Main.deleteDir(new File(Main.inpath + "app/"));
|
||||
Main.deleteDir(new File(Main.inpath + "patch/"));
|
||||
Main.deleteDir(new File(Main.inpath + "addcont/"));
|
||||
invoker.setEnabled(true);
|
||||
invoker.setVisible(true);
|
||||
invoker.toFront();
|
||||
invoker.repaint();
|
||||
return;
|
||||
Main.deleteDir(new File(Main.inpath + "temp/"));
|
||||
|
||||
popup.destroyDialog();
|
||||
}
|
||||
|
||||
popup.setText("<html>Decrypting protected PFS:<br/>" + extracted + "</html>", "Decrypting");
|
||||
|
||||
try {
|
||||
if (!Main.windows) {p = Runtime.getRuntime().exec(new String[]{"bash","-c","cd " + Main.inpath + ";wine psvpfsparser.exe -i " + extracted + " -o ./temp/ -z " + key.toString() + " -f cma.henkaku.xyz"});}
|
||||
else {p = Runtime.getRuntime().exec(new String[]{Main.inpath + "psvpfsparser.exe", "-i", extracted, "-o", "./temp/", "-z", key.toString(), "-f", "cma.henkaku.xyz"}, null, new File(Main.inpath));}
|
||||
InputStream debugin = new BufferedInputStream(p.getInputStream());
|
||||
OutputStream debugout = new BufferedOutputStream(System.out);
|
||||
int c;
|
||||
while ((c = debugin.read()) != -1) {
|
||||
debugout.write(c);
|
||||
}
|
||||
debugin.close();
|
||||
debugout.close();
|
||||
p.waitFor();
|
||||
} catch (Exception e) {
|
||||
System.out.println(e.getMessage());
|
||||
JOptionPane.showMessageDialog(invoker, "CRITICAL FAILURE: " + e.getMessage(), "Fatal Error", JOptionPane.ERROR_MESSAGE);
|
||||
new File(Main.inpath + "asset.pkg").delete();
|
||||
Main.deleteDir(new File(Main.inpath + "app/"));
|
||||
Main.deleteDir(new File(Main.inpath + "patch/"));
|
||||
Main.deleteDir(new File(Main.inpath + "addcont/"));
|
||||
invoker.setEnabled(true);
|
||||
invoker.setVisible(true);
|
||||
invoker.toFront();
|
||||
invoker.repaint();
|
||||
return;
|
||||
}
|
||||
|
||||
popup.setText("Deleting temporary files...", "Cleaning Up");
|
||||
|
||||
// stage & cleanup
|
||||
System.out.println("Cleaning up");
|
||||
new File(Main.inpath + "asset.pkg").delete();
|
||||
new File(Main.inpath + "temp/PSP2/" + name).renameTo(new File(Main.inpath + name));
|
||||
Main.deleteDir(new File(Main.inpath + "app/"));
|
||||
Main.deleteDir(new File(Main.inpath + "patch/"));
|
||||
Main.deleteDir(new File(Main.inpath + "addcont/"));
|
||||
Main.deleteDir(new File(Main.inpath + "temp/"));
|
||||
|
||||
popup.destroyDialog();
|
||||
|
||||
// restore controls
|
||||
JOptionPane.showMessageDialog(frame, "Assets downloaded successfully.", "Download Complete", JOptionPane.INFORMATION_MESSAGE);
|
||||
invoker.setEnabled(true);
|
||||
|
|
|
@ -27,6 +27,7 @@ import java.net.*;
|
|||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
import java.nio.file.StandardCopyOption;
|
||||
import java.util.Optional;
|
||||
|
||||
public class Fozzie {
|
||||
BufferedImage windowIcon;
|
||||
|
@ -42,6 +43,10 @@ public class Fozzie {
|
|||
public boolean backgroundDone = false;
|
||||
|
||||
boolean DownloadFile(String url, String odir, String oname) {
|
||||
return DownloadFile(url, odir, oname, oname);
|
||||
}
|
||||
|
||||
boolean DownloadFile(String url, String odir, String oname, String dname) {
|
||||
frame.add(frameContainer);
|
||||
frame.setSize(300, 100);
|
||||
frame.setTitle("Download in Progress");
|
||||
|
@ -58,7 +63,7 @@ public class Fozzie {
|
|||
}
|
||||
frame.setVisible(true);
|
||||
|
||||
label.setText("Downloading \"" + oname + "\"");
|
||||
label.setText("Downloading \"" + dname + "\"");
|
||||
|
||||
try {
|
||||
URL fileURL = new URL(url);
|
||||
|
|
|
@ -35,8 +35,6 @@ public class Main {
|
|||
public static final int vint = 1;
|
||||
|
||||
// User Settings
|
||||
// TODO: replace with user preference when config i/o is done
|
||||
// also please double check that outpath is actually valid
|
||||
public static String outpath = System.getProperty("user.home") + "/.firestar/out/"; //game assets location
|
||||
public final static String inpath = System.getProperty("user.home") + "/.firestar/"; //firestar folder -- do not change this
|
||||
public static boolean repatch; //are we in compat mode?
|
||||
|
@ -78,7 +76,6 @@ public class Main {
|
|||
public class Mod {
|
||||
public String path; // file name
|
||||
public int version = 1;
|
||||
//public int gameversion; //TODO detect a game version and compatibility? // no
|
||||
public int priority = 0; //unused
|
||||
public String friendlyName;
|
||||
public String description = "";
|
||||
|
|
|
@ -193,7 +193,6 @@ public class MissPiggy implements ActionListener {
|
|||
Main.Mods.clear();
|
||||
|
||||
// get current list of mods from file
|
||||
// todo: rewrite when modpacks/playlists are added
|
||||
try {
|
||||
priorityList = new String(Files.readAllBytes(Paths.get(System.getProperty("user.home") + "/.firestar/mods/index")));
|
||||
} catch (IOException e) {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="WilkinsCoffee">
|
||||
<grid id="27dc6" binding="frameContainer" layout-manager="GridLayoutManager" row-count="4" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<grid id="27dc6" binding="frameContainer" layout-manager="GridLayoutManager" row-count="5" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="10" left="10" bottom="10" right="10"/>
|
||||
<constraints>
|
||||
<xy x="20" y="20" width="416" height="479"/>
|
||||
|
@ -25,7 +25,7 @@
|
|||
</component>
|
||||
<component id="29913" class="javax.swing.JEditorPane" binding="instructions">
|
||||
<constraints>
|
||||
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="6" hsize-policy="6" anchor="0" fill="3" indent="1" use-parent-layout="false">
|
||||
<grid row="0" column="1" row-span="2" col-span="1" vsize-policy="6" hsize-policy="6" anchor="0" fill="3" indent="1" use-parent-layout="false">
|
||||
<preferred-size width="150" height="50"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
|
@ -45,7 +45,7 @@
|
|||
</component>
|
||||
<component id="c3ec3" class="javax.swing.JButton" binding="contBtn">
|
||||
<constraints>
|
||||
<grid row="3" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||
<grid row="4" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<background color="-2271221"/>
|
||||
|
@ -58,7 +58,7 @@
|
|||
<grid id="ee2dd" binding="inputContainer" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="3" right="0"/>
|
||||
<constraints>
|
||||
<grid row="2" column="0" row-span="1" col-span="2" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||
<grid row="3" column="0" row-span="1" col-span="2" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<background color="-15128227"/>
|
||||
|
@ -66,21 +66,9 @@
|
|||
</properties>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<component id="1c41b" class="javax.swing.JButton" binding="PSARC_downBtn">
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<background color="-2271221"/>
|
||||
<borderPainted value="false"/>
|
||||
<focusPainted value="false"/>
|
||||
<foreground color="-1"/>
|
||||
<text value="Auto-Download"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="30c84" class="javax.swing.JButton" binding="PSARC_impBtn">
|
||||
<constraints>
|
||||
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="2" fill="1" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<background color="-2271221"/>
|
||||
|
@ -90,12 +78,24 @@
|
|||
<text value="Import My Own"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="1c41b" class="javax.swing.JButton" binding="PSARC_downBtn">
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="2" fill="1" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<background color="-2271221"/>
|
||||
<borderPainted value="false"/>
|
||||
<focusPainted value="false"/>
|
||||
<foreground color="-1"/>
|
||||
<text value="Auto-Download"/>
|
||||
</properties>
|
||||
</component>
|
||||
</children>
|
||||
</grid>
|
||||
<grid id="8468" binding="inputContainer2" layout-manager="GridLayoutManager" row-count="2" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="3" right="0"/>
|
||||
<constraints>
|
||||
<grid row="1" column="0" row-span="1" col-span="2" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||
<grid row="2" column="0" row-span="1" col-span="2" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<background color="-15128227"/>
|
||||
|
@ -126,6 +126,81 @@
|
|||
</component>
|
||||
</children>
|
||||
</grid>
|
||||
<grid id="71c64" binding="checklistContainer" layout-manager="GridLayoutManager" row-count="5" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="2" fill="1" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<background color="-15128227"/>
|
||||
<font name="Exo 2"/>
|
||||
<foreground color="-1"/>
|
||||
<opaque value="false"/>
|
||||
</properties>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<component id="eae72" class="javax.swing.JLabel" binding="checklistFury">
|
||||
<constraints>
|
||||
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<background color="-15128227"/>
|
||||
<font name="Exo 2"/>
|
||||
<foreground color="-1"/>
|
||||
<icon value="lightNegative.png"/>
|
||||
<text value="Fury DLC"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="ae838" class="javax.swing.JLabel" binding="checklistHD">
|
||||
<constraints>
|
||||
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<background color="-15128227"/>
|
||||
<font name="Exo 2"/>
|
||||
<foreground color="-1"/>
|
||||
<icon value="lightNegative.png"/>
|
||||
<text value="HD DLC"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="35a85" class="javax.swing.JLabel" binding="checklistPatch2">
|
||||
<constraints>
|
||||
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<background color="-15128227"/>
|
||||
<font name="Exo 2"/>
|
||||
<foreground color="-1"/>
|
||||
<icon value="lightNegative.png"/>
|
||||
<text value="Patch 2"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="4ca0c" class="javax.swing.JLabel" binding="checklistPatch1">
|
||||
<constraints>
|
||||
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<background color="-15128227"/>
|
||||
<font name="Exo 2"/>
|
||||
<foreground color="-1"/>
|
||||
<icon value="lightNegative.png"/>
|
||||
<text value="Patch 1"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="94f98" class="javax.swing.JLabel" binding="checklistBase">
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<background color="-15128227"/>
|
||||
<font name="Exo 2"/>
|
||||
<foreground color="-1"/>
|
||||
<icon value="lightNegative.png"/>
|
||||
<text value="Base"/>
|
||||
</properties>
|
||||
</component>
|
||||
</children>
|
||||
</grid>
|
||||
</children>
|
||||
</grid>
|
||||
</form>
|
||||
|
|
|
@ -46,6 +46,12 @@ public class WilkinsCoffee implements ActionListener {
|
|||
private JPanel inputContainer2;
|
||||
private JButton EXPORT_openFolderBtn;
|
||||
private JLabel pathDisplay;
|
||||
private JPanel checklistContainer;
|
||||
private JLabel checklistFury;
|
||||
private JLabel checklistHD;
|
||||
private JLabel checklistPatch2;
|
||||
private JLabel checklistPatch1;
|
||||
private JLabel checklistBase;
|
||||
|
||||
public enum Pages {
|
||||
INTRO(0),
|
||||
|
@ -66,6 +72,7 @@ public class WilkinsCoffee implements ActionListener {
|
|||
public void setup() {
|
||||
page = Pages.INTRO;
|
||||
inputContainer.setVisible(false);
|
||||
checklistContainer.setVisible(false);
|
||||
inputContainer2.setVisible(false);
|
||||
|
||||
// check if this is windows or not
|
||||
|
@ -110,6 +117,7 @@ public class WilkinsCoffee implements ActionListener {
|
|||
frame.setDefaultCloseOperation(EXIT_ON_CLOSE);
|
||||
frame.setLayout(new GridLayout());
|
||||
frame.setLocationRelativeTo(null);
|
||||
refreshChecklist();
|
||||
frame.setVisible(true);
|
||||
}
|
||||
|
||||
|
@ -122,6 +130,8 @@ public class WilkinsCoffee implements ActionListener {
|
|||
if (new Bert(frame).reportWhenDownloaded(threadParent)) {
|
||||
contBtn.setEnabled(true);
|
||||
contBtn.setBackground(new Color(221, 88, 11)); //orange
|
||||
|
||||
refreshChecklist();
|
||||
}
|
||||
}});
|
||||
waiterThread.start();
|
||||
|
@ -135,6 +145,7 @@ public class WilkinsCoffee implements ActionListener {
|
|||
if (result == JFileChooser.APPROVE_OPTION) {
|
||||
try {
|
||||
Files.copy(fileChooser.getSelectedFile().toPath(), new File(Main.inpath + fileChooser.getSelectedFile().getName()).toPath());
|
||||
refreshChecklist();
|
||||
contBtn.setEnabled(true);
|
||||
contBtn.setBackground(new Color(221, 88, 11)); //orange
|
||||
} catch (IOException e) {
|
||||
|
@ -189,6 +200,7 @@ public class WilkinsCoffee implements ActionListener {
|
|||
contBtn.setEnabled(false);
|
||||
contBtn.setBackground(new Color(102, 74, 58)); //brown
|
||||
inputContainer.setVisible(true);
|
||||
checklistContainer.setVisible(true);
|
||||
if (!sdkInstalled) {
|
||||
PSARC_downBtn.setEnabled(false);
|
||||
PSARC_downBtn.setBackground(new Color(102, 74, 58)); //brown
|
||||
|
@ -221,6 +233,7 @@ public class WilkinsCoffee implements ActionListener {
|
|||
contBtn.setEnabled(true);
|
||||
contBtn.setBackground(new Color(221, 88, 11)); //orange
|
||||
inputContainer.setVisible(false);
|
||||
checklistContainer.setVisible(false);
|
||||
inputContainer2.setVisible(true);
|
||||
|
||||
instructions.setText("<html>\n" +
|
||||
|
@ -275,4 +288,25 @@ public class WilkinsCoffee implements ActionListener {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void refreshChecklist() {
|
||||
ImageIcon positive = new ImageIcon(Main.class.getResource("/lightPositive.png"));
|
||||
ImageIcon negative = new ImageIcon(Main.class.getResource("/lightNegative.png"));
|
||||
|
||||
if(new File(Main.inpath + "data.psarc").exists()) {
|
||||
checklistBase.setIcon(positive);
|
||||
} else {checklistBase.setIcon(negative);}
|
||||
if(new File(Main.inpath + "data1.psarc").exists()) {
|
||||
checklistPatch1.setIcon(positive);
|
||||
} else {checklistPatch1.setIcon(negative);}
|
||||
if(new File(Main.inpath + "data2.psarc").exists()) {
|
||||
checklistPatch2.setIcon(positive);
|
||||
} else {checklistPatch2.setIcon(negative);}
|
||||
if(new File(Main.inpath + "dlc1.psarc").exists()) {
|
||||
checklistHD.setIcon(positive);
|
||||
} else {checklistHD.setIcon(negative);}
|
||||
if(new File(Main.inpath + "dlc2.psarc").exists()) {
|
||||
checklistFury.setIcon(positive);
|
||||
} else {checklistFury.setIcon(negative);}
|
||||
}
|
||||
}
|
||||
|
|
BIN
firestar/src/main/resources/lightNegative.png
Normal file
BIN
firestar/src/main/resources/lightNegative.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 823 B |
BIN
firestar/src/main/resources/lightPositive.png
Normal file
BIN
firestar/src/main/resources/lightPositive.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 851 B |
Loading…
Reference in New Issue
Block a user