Allow skipping patch download

This commit is contained in:
2025-02-22 11:20:50 -06:00
parent f7c4603db1
commit 9585f16f11
4 changed files with 1337 additions and 1295 deletions

View File

@@ -151,7 +151,7 @@
<verticalTextPosition value="0"/>
</properties>
</component>
<grid id="afeb1" layout-manager="GridLayoutManager" row-count="2" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<grid id="afeb1" layout-manager="GridLayoutManager" row-count="3" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="0" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="1" anchor="2" fill="0" indent="0" use-parent-layout="false"/>
@@ -217,6 +217,20 @@
<text value="Select Game Version:"/>
</properties>
</component>
<component id="26170" class="javax.swing.JCheckBox" binding="skipBaseCheck">
<constraints>
<grid row="2" column="0" row-span="1" col-span="3" vsize-policy="0" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<background color="-15128227"/>
<enabled value="false"/>
<focusPainted value="false"/>
<font name="Exo 2"/>
<foreground color="-1"/>
<label value="Don't redownload existing core game files"/>
<text value="Don't redownload existing core game files"/>
</properties>
</component>
</children>
</grid>
<component id="45b94" class="javax.swing.JLabel">

View File

@@ -35,6 +35,7 @@ public class Bert implements ActionListener {
private JRadioButton patchCheck2;
private JCheckBox hdCheck;
private JCheckBox furyCheck;
private JCheckBox skipBaseCheck;
private ButtonGroup radios = new ButtonGroup();
private JFrame invoker;
@@ -61,6 +62,9 @@ public class Bert implements ActionListener {
cancelbtn.addActionListener(this);
downloadbtn.addActionListener(this);
baseCheck.addActionListener(this);
patchCheck1.addActionListener(this);
patchCheck2.addActionListener(this);
frame.setIconImage(Main.windowIcon);
@@ -79,6 +83,9 @@ public class Bert implements ActionListener {
invoker.setEnabled(true);
frame.dispose();
}
if (new File(Main.inpath + "data2.psarc").exists())
skipBaseCheck.setEnabled(true);
}
public boolean reportWhenDownloaded(WilkinsCoffee setup) {
@@ -92,6 +99,12 @@ public class Bert implements ActionListener {
@Override
public void actionPerformed(ActionEvent actionEvent) {
if (actionEvent.getSource() == baseCheck)
skipBaseCheck.setEnabled(new File(Main.inpath + "data.psarc").exists()); else
if (actionEvent.getSource() == patchCheck1)
skipBaseCheck.setEnabled(new File(Main.inpath + "data1.psarc").exists()); else
if (actionEvent.getSource() == patchCheck2)
skipBaseCheck.setEnabled(new File(Main.inpath + "data2.psarc").exists()); else
if (actionEvent.getSource() == cancelbtn) {
invoker.setEnabled(true);
frame.dispose();
@@ -108,34 +121,40 @@ public class Bert implements ActionListener {
// selected (the exact radio button). The user can redownload one at a time
// but Firestar will not overwrite existing PSARCs otherwise.
if (baseCheck.isSelected()) { // I have the base game
arcs.add(Main.ArcTarget.BASE);
keys.add(Main.ArcKey.BASE);
System.out.println("Begin download of data (Game version 1.0)");
if (!skipBaseCheck.isSelected() || !new File(Main.inpath + "data.psarc").exists()) {
arcs.add(Main.ArcTarget.BASE);
keys.add(Main.ArcKey.BASE);
System.out.println("Queued download of data (Game version 1.0)");
}
}
if (patchCheck1.isSelected()) { // I updated it once after it came out and then didn't turn my vita on for thousands of years
if (!new File(Main.inpath + "data.psarc").exists()) {
arcs.add(Main.ArcTarget.BASE);
keys.add(Main.ArcKey.BASE);
System.out.println("Begin download of data (Game version 1.0)");
System.out.println("Queued download of data (Game version 1.0)");
}
if (!skipBaseCheck.isSelected() || !new File(Main.inpath + "data1.psarc").exists()) {
arcs.add(Main.ArcTarget.FIRST);
keys.add(Main.ArcKey.FIRST);
System.out.println("Queued download of data1 (Game version 1.01)");
}
arcs.add(Main.ArcTarget.FIRST);
keys.add(Main.ArcKey.FIRST);
System.out.println("Begin download of data1 (Game version 1.01)");
}
if (patchCheck2.isSelected()) { // I'm a normal fucking person
if (!new File(Main.inpath + "data.psarc").exists()) {
arcs.add(Main.ArcTarget.BASE);
keys.add(Main.ArcKey.BASE);
System.out.println("Begin download of data (Game version 1.0)");
System.out.println("Queued download of data (Game version 1.0)");
}
if (!new File(Main.inpath + "data1.psarc").exists()) {
arcs.add(Main.ArcTarget.FIRST);
keys.add(Main.ArcKey.FIRST);
System.out.println("Begin download of data1 (Game version 1.01)");
System.out.println("Queued download of data1 (Game version 1.01)");
}
if (!skipBaseCheck.isSelected() || !new File(Main.inpath + "data2.psarc").exists()) {
arcs.add(Main.ArcTarget.LATEST);
keys.add(Main.ArcKey.LATEST);
System.out.println("Queued download of data2 (Game version 1.04)");
}
arcs.add(Main.ArcTarget.LATEST);
keys.add(Main.ArcKey.LATEST);
System.out.println("Begin download of data2 (Game version 1.04)");
}
// DLC are installed arbitrarily, separate of the game, and can remain as checkboxes with the old logic.
@@ -143,15 +162,17 @@ public class Bert implements ActionListener {
if (hdCheck.isSelected()) {
arcs.add(Main.ArcTarget.ADDON_HD);
keys.add(Main.ArcKey.ADDON_HD);
System.out.println("Begin download of dlc1 (HD DLC)");
System.out.println("Queued download of dlc1 (HD DLC)");
}
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)");
System.out.println("Queued download of dlc2 (Fury DLC)");
}
if (arcs.isEmpty()) {
frame.setVisible(false);
JOptionPane.showMessageDialog(invoker, "Select one or more asset packs.", "Error", JOptionPane.ERROR_MESSAGE);
frame.setVisible(true);
return;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff