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>
<font name="Exo 2"/>
<foreground color="-1"/>
<text value="Select your game version below."/>
<text value="Select the required asset packs below."/>
</properties>
</component>
<component id="e27cc" class="javax.swing.JLabel">
@ -53,7 +53,7 @@
<properties>
<font name="Exo 2"/>
<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>
</component>
<component id="319fa" class="javax.swing.JLabel">

View File

@ -117,7 +117,6 @@ public class WilkinsCoffee implements ActionListener {
frame.setDefaultCloseOperation(EXIT_ON_CLOSE);
frame.setLayout(new GridLayout());
frame.setLocationRelativeTo(null);
refreshChecklist();
frame.setVisible(true);
}
@ -199,6 +198,7 @@ public class WilkinsCoffee implements ActionListener {
contBtn.setEnabled(false);
contBtn.setBackground(new Color(102, 74, 58)); //brown
refreshChecklist();
inputContainer.setVisible(true);
checklistContainer.setVisible(true);
if (!sdkInstalled) {
@ -293,20 +293,33 @@ public class WilkinsCoffee implements ActionListener {
ImageIcon positive = new ImageIcon(Main.class.getResource("/lightPositive.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()) {
checklistBase.setIcon(positive);
contBtn.setEnabled(true);
contBtn.setBackground(new Color(221, 88, 11)); //orange
} else {checklistBase.setIcon(negative);}
if(new File(Main.inpath + "data1.psarc").exists()) {
checklistPatch1.setIcon(positive);
contBtn.setEnabled(true);
contBtn.setBackground(new Color(221, 88, 11)); //orange
} else {checklistPatch1.setIcon(negative);}
if(new File(Main.inpath + "data2.psarc").exists()) {
checklistPatch2.setIcon(positive);
contBtn.setEnabled(true);
contBtn.setBackground(new Color(221, 88, 11)); //orange
} else {checklistPatch2.setIcon(negative);}
if(new File(Main.inpath + "dlc1.psarc").exists()) {
checklistHD.setIcon(positive);
contBtn.setEnabled(true);
contBtn.setBackground(new Color(221, 88, 11)); //orange
} else {checklistHD.setIcon(negative);}
if(new File(Main.inpath + "dlc2.psarc").exists()) {
checklistFury.setIcon(positive);
contBtn.setEnabled(true);
contBtn.setBackground(new Color(221, 88, 11)); //orange
} else {checklistFury.setIcon(negative);}
}
}