avoid redundant downloads when setup restart

This commit is contained in:
Downforce Agent 2024-07-13 18:34:21 -05:00
parent c53f059bac
commit f2786ee08a
2 changed files with 17 additions and 4 deletions

View File

@ -43,7 +43,7 @@
<properties> <properties>
<font name="Exo 2"/> <font name="Exo 2"/>
<foreground color="-1"/> <foreground color="-1"/>
<text value="Select your game version below."/> <text value="Select the required asset packs below."/>
</properties> </properties>
</component> </component>
<component id="e27cc" class="javax.swing.JLabel"> <component id="e27cc" class="javax.swing.JLabel">
@ -53,7 +53,7 @@
<properties> <properties>
<font name="Exo 2"/> <font name="Exo 2"/>
<foreground color="-1"/> <foreground color="-1"/>
<text value="This will determine what file your mods are deployed to."/> <text value="This will depend on what version of the game you have and what DLC you own."/>
</properties> </properties>
</component> </component>
<component id="319fa" class="javax.swing.JLabel"> <component id="319fa" class="javax.swing.JLabel">

View File

@ -117,7 +117,6 @@ public class WilkinsCoffee implements ActionListener {
frame.setDefaultCloseOperation(EXIT_ON_CLOSE); frame.setDefaultCloseOperation(EXIT_ON_CLOSE);
frame.setLayout(new GridLayout()); frame.setLayout(new GridLayout());
frame.setLocationRelativeTo(null); frame.setLocationRelativeTo(null);
refreshChecklist();
frame.setVisible(true); frame.setVisible(true);
} }
@ -199,6 +198,7 @@ public class WilkinsCoffee implements ActionListener {
contBtn.setEnabled(false); contBtn.setEnabled(false);
contBtn.setBackground(new Color(102, 74, 58)); //brown contBtn.setBackground(new Color(102, 74, 58)); //brown
refreshChecklist();
inputContainer.setVisible(true); inputContainer.setVisible(true);
checklistContainer.setVisible(true); checklistContainer.setVisible(true);
if (!sdkInstalled) { if (!sdkInstalled) {
@ -292,21 +292,34 @@ public class WilkinsCoffee implements ActionListener {
private void refreshChecklist() { private void refreshChecklist() {
ImageIcon positive = new ImageIcon(Main.class.getResource("/lightPositive.png")); ImageIcon positive = new ImageIcon(Main.class.getResource("/lightPositive.png"));
ImageIcon negative = new ImageIcon(Main.class.getResource("/lightNegative.png")); ImageIcon negative = new ImageIcon(Main.class.getResource("/lightNegative.png"));
// enabling the continue button here leaves the previous one redundant,
// but it's needed to ensure we don't force a redownload if the setup is interrupted
if(new File(Main.inpath + "data.psarc").exists()) { if(new File(Main.inpath + "data.psarc").exists()) {
checklistBase.setIcon(positive); checklistBase.setIcon(positive);
contBtn.setEnabled(true);
contBtn.setBackground(new Color(221, 88, 11)); //orange
} else {checklistBase.setIcon(negative);} } else {checklistBase.setIcon(negative);}
if(new File(Main.inpath + "data1.psarc").exists()) { if(new File(Main.inpath + "data1.psarc").exists()) {
checklistPatch1.setIcon(positive); checklistPatch1.setIcon(positive);
contBtn.setEnabled(true);
contBtn.setBackground(new Color(221, 88, 11)); //orange
} else {checklistPatch1.setIcon(negative);} } else {checklistPatch1.setIcon(negative);}
if(new File(Main.inpath + "data2.psarc").exists()) { if(new File(Main.inpath + "data2.psarc").exists()) {
checklistPatch2.setIcon(positive); checklistPatch2.setIcon(positive);
contBtn.setEnabled(true);
contBtn.setBackground(new Color(221, 88, 11)); //orange
} else {checklistPatch2.setIcon(negative);} } else {checklistPatch2.setIcon(negative);}
if(new File(Main.inpath + "dlc1.psarc").exists()) { if(new File(Main.inpath + "dlc1.psarc").exists()) {
checklistHD.setIcon(positive); checklistHD.setIcon(positive);
contBtn.setEnabled(true);
contBtn.setBackground(new Color(221, 88, 11)); //orange
} else {checklistHD.setIcon(negative);} } else {checklistHD.setIcon(negative);}
if(new File(Main.inpath + "dlc2.psarc").exists()) { if(new File(Main.inpath + "dlc2.psarc").exists()) {
checklistFury.setIcon(positive); checklistFury.setIcon(positive);
contBtn.setEnabled(true);
contBtn.setBackground(new Color(221, 88, 11)); //orange
} else {checklistFury.setIcon(negative);} } else {checklistFury.setIcon(negative);}
} }
} }