Allow downloading data1 from Bert

This commit is contained in:
Downforce Agent 2024-09-20 21:33:26 -05:00
parent 168e536068
commit 12f01000dd
2 changed files with 128 additions and 32 deletions

View File

@ -108,7 +108,7 @@
</component> </component>
</children> </children>
</grid> </grid>
<grid id="1000f" 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="3" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/> <margin top="0" left="0" bottom="0" right="0"/>
<constraints> <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"/> <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,53 +120,109 @@
</properties> </properties>
<border type="none"/> <border type="none"/>
<children> <children>
<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"/>
<font name="Exo 2"/>
<foreground color="-1"/>
<horizontalTextPosition value="11"/>
<text value="Updates"/>
</properties>
</component>
<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"> <component id="f3723" class="javax.swing.JCheckBox" binding="hdCheck">
<constraints> <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"/> <grid row="2" 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> </constraints>
<properties> <properties>
<background color="-15128227"/> <background color="-15128227"/>
<font name="Exo 2"/> <font name="Exo 2"/>
<foreground color="-1"/> <foreground color="-1"/>
<horizontalTextPosition value="10"/> <horizontalTextPosition value="10"/>
<opaque value="false"/>
<text value="HD Add-On Pack"/> <text value="HD Add-On Pack"/>
<verticalTextPosition value="0"/>
</properties> </properties>
</component> </component>
<component id="5ed0c" class="javax.swing.JCheckBox" binding="furyCheck"> <component id="5ed0c" class="javax.swing.JCheckBox" binding="furyCheck">
<constraints> <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"/> <grid row="2" 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> </constraints>
<properties> <properties>
<background color="-15128227"/> <background color="-15128227"/>
<font name="Exo 2"/> <font name="Exo 2"/>
<foreground color="-1"/> <foreground color="-1"/>
<horizontalTextPosition value="11"/> <horizontalTextPosition value="11"/>
<opaque value="false"/>
<selected value="false"/> <selected value="false"/>
<text value="Fury Add-On Pack"/> <text value="Fury Add-On Pack"/>
<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">
<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"/>
</constraints>
<properties>
<background color="-15128227"/>
<opaque value="false"/>
</properties>
<border type="none"/>
<children>
<component id="6337e" class="javax.swing.JRadioButton" binding="baseCheck">
<constraints>
<grid row="1" column="0" 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"/>
<font name="Exo 2"/>
<foreground color="-1"/>
<horizontalAlignment value="0"/>
<horizontalTextPosition value="11"/>
<opaque value="false"/>
<text value="Base Game"/>
</properties>
</component>
<component id="5c733" class="javax.swing.JRadioButton" binding="patchCheck2">
<constraints>
<grid row="1" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="2" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<background color="-15128227"/>
<font name="Exo 2"/>
<foreground color="-1"/>
<label value="v1.04 (Latest)"/>
<opaque value="false"/>
<text value="v1.04 (Latest)"/>
</properties>
</component>
<component id="f9b10" class="javax.swing.JRadioButton" binding="patchCheck1">
<constraints>
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="2" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<background color="-15128227"/>
<font name="Exo 2"/>
<foreground color="-1"/>
<opaque value="false"/>
<text value="v1.01+"/>
</properties>
</component>
<component id="826d4" class="javax.swing.JLabel">
<constraints>
<grid row="0" column="0" row-span="1" col-span="3" vsize-policy="0" hsize-policy="0" anchor="0" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<background color="-15128227"/>
<font name="Exo 2"/>
<foreground color="-1"/>
<opaque value="false"/>
<text value="Select Game Version:"/>
</properties>
</component>
</children>
</grid>
<component id="45b94" class="javax.swing.JLabel">
<constraints>
<grid row="1" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="0" anchor="2" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<background color="-15128227"/>
<font name="Exo 2"/>
<foreground color="-1"/>
<opaque value="false"/>
<text value="Select DLC Packs:"/>
</properties> </properties>
</component> </component>
</children> </children>

View File

@ -30,8 +30,9 @@ public class Bert implements ActionListener {
private JPanel frameContainer; private JPanel frameContainer;
private JButton cancelbtn; private JButton cancelbtn;
private JButton downloadbtn; private JButton downloadbtn;
private JCheckBox patchCheck; private JRadioButton baseCheck;
private JCheckBox baseCheck; private JRadioButton patchCheck1;
private JRadioButton patchCheck2;
private JCheckBox hdCheck; private JCheckBox hdCheck;
private JCheckBox furyCheck; private JCheckBox furyCheck;
private ButtonGroup radios = new ButtonGroup(); private ButtonGroup radios = new ButtonGroup();
@ -93,16 +94,48 @@ public class Bert implements ActionListener {
} else if (actionEvent.getSource() == downloadbtn) { } else if (actionEvent.getSource() == downloadbtn) {
ArrayList<Main.ArcTarget> arcs = new ArrayList<Main.ArcTarget>(); ArrayList<Main.ArcTarget> arcs = new ArrayList<Main.ArcTarget>();
ArrayList<Main.ArcKey> keys = new ArrayList<Main.ArcKey>(); ArrayList<Main.ArcKey> keys = new ArrayList<Main.ArcKey>();
if (baseCheck.isSelected()) {
// Always download predecessors to ensure no missing files
// Probably not necessary since I will be adding selective extraction to Gonzo,
// and throw errors when a lower PSARC doesn't exist, but there's no real reason not to.
//
// Of course, to avoid additional download times, we should probably
// avoid adding to the download list if a file already exists, unless explicitly
// 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); arcs.add(Main.ArcTarget.BASE);
keys.add(Main.ArcKey.BASE); keys.add(Main.ArcKey.BASE);
System.out.println("Begin download of data (Game version 1.0)"); System.out.println("Begin download of data (Game version 1.0)");
} }
if (patchCheck.isSelected()) { 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)");
}
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)");
}
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)");
}
arcs.add(Main.ArcTarget.LATEST); arcs.add(Main.ArcTarget.LATEST);
keys.add(Main.ArcKey.LATEST); keys.add(Main.ArcKey.LATEST);
System.out.println("Begin download of data2 (Game version 1.04)"); 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.
// Likewise, the old overwrite policy applies. If the user selects these, it WILL download with no question.
if (hdCheck.isSelected()) { if (hdCheck.isSelected()) {
arcs.add(Main.ArcTarget.ADDON_HD); arcs.add(Main.ArcTarget.ADDON_HD);
keys.add(Main.ArcKey.ADDON_HD); keys.add(Main.ArcKey.ADDON_HD);
@ -132,9 +165,13 @@ public class Bert implements ActionListener {
key = Main.ArcKey.BASE.toString(); key = Main.ArcKey.BASE.toString();
arcname = "Base game"; arcname = "Base game";
break; break;
case FIRST :
key = Main.ArcKey.FIRST.toString();
arcname = "Update 1.01";
break;
case LATEST : case LATEST :
key = Main.ArcKey.LATEST.toString(); key = Main.ArcKey.LATEST.toString();
arcname = "Updates"; arcname = "Update 1.04";
break; break;
case ADDON_HD : case ADDON_HD :
key = Main.ArcKey.ADDON_HD.toString(); key = Main.ArcKey.ADDON_HD.toString();
@ -200,6 +237,9 @@ public class Bert implements ActionListener {
if (type == Main.ArcTarget.BASE) { if (type == Main.ArcTarget.BASE) {
extracted = "app/PCSA00015"; extracted = "app/PCSA00015";
name = "data.psarc"; name = "data.psarc";
} else if (type == Main.ArcTarget.FIRST) {
extracted = "patch/PCSA00015";
name = "data1.psarc";
} else if (type == Main.ArcTarget.LATEST) { } else if (type == Main.ArcTarget.LATEST) {
extracted = "patch/PCSA00015"; extracted = "patch/PCSA00015";
name = "data2.psarc"; name = "data2.psarc";