From 4a2a992b04203bb313c573f508203980937ed3b3 Mon Sep 17 00:00:00 2001 From: Downforce Agent Date: Fri, 12 Jul 2024 05:38:48 -0500 Subject: [PATCH] fixes to kermit rewrite --- firestar/src/main/java/MissPiggy.java | 18 +------------- firestar/src/main/java/Waldorf.java | 9 ++++++- firestar/src/main/java/WilkinsCoffee.java | 30 +++++++++++++++++++++-- 3 files changed, 37 insertions(+), 20 deletions(-) diff --git a/firestar/src/main/java/MissPiggy.java b/firestar/src/main/java/MissPiggy.java index 70be962..11554b2 100644 --- a/firestar/src/main/java/MissPiggy.java +++ b/firestar/src/main/java/MissPiggy.java @@ -181,23 +181,7 @@ public class MissPiggy implements ActionListener { frame.setLayout(new GridLayout()); frame.setLocationRelativeTo(null); - if (Main.confvint == 0 || forceNag){ // nag - int result = JOptionPane.showConfirmDialog(frame, "Firestar needs to download additional software to function. Setup is automatic and will only take a few minutes.\nIf you select NO, you will have to download additional dependencies later on.\n\nContinue?", "Firestar Setup", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); - if (result == JOptionPane.YES_OPTION) { - Thread downloaderPopupThread = new Thread(new Runnable() { - @Override - public void run() { - Main.downloadDependenciesBeforeSetVisible(frame); - } - }); - downloaderPopupThread.start(); - } else { - Main.writeConf(); // don't warn again - frame.setVisible(true); // no fuck off - } - } else { - frame.setVisible(true); // don't nag - } + frame.setVisible(true); } public void InitializeModListStructure() { diff --git a/firestar/src/main/java/Waldorf.java b/firestar/src/main/java/Waldorf.java index a36a8bd..fc45cd5 100644 --- a/firestar/src/main/java/Waldorf.java +++ b/firestar/src/main/java/Waldorf.java @@ -95,10 +95,17 @@ public class Waldorf implements ActionListener { invoker.frame.setEnabled(true); frame.dispose(); } else - if (actionEvent.getSource() == resetbtn) { // todo: delete firesdk // you sure? + if (actionEvent.getSource() == resetbtn) { int result = JOptionPane.showConfirmDialog(frame,"Are you sure you want to redo the initial setup?", "Restore Default Settings", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE); if (result == JOptionPane.YES_OPTION) { + System.out.println("Restoring default settings"); new File(System.getProperty("user.home") + "/.firestar/firestar.conf").delete(); + System.out.println("Deleting existing PSARCs"); + new File(Main.inpath + "data.psarc").delete(); + new File(Main.inpath + "data1.psarc").delete(); + new File(Main.inpath + "data2.psarc").delete(); + new File(Main.inpath + "dlc1.psarc").delete(); + new File(Main.inpath + "dlc2.psarc").delete(); int result2 = JOptionPane.showConfirmDialog(frame,"Firestar will now close.", "Restore Default Settings", JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE); if (result2 == JOptionPane.OK_OPTION) { System.exit(0); diff --git a/firestar/src/main/java/WilkinsCoffee.java b/firestar/src/main/java/WilkinsCoffee.java index e494cd6..ee66209 100644 --- a/firestar/src/main/java/WilkinsCoffee.java +++ b/firestar/src/main/java/WilkinsCoffee.java @@ -60,7 +60,8 @@ public class WilkinsCoffee implements ActionListener { } } - private String outPathTemp = System.getProperty("user.home") + "/Documents/"; + private String outPathTemp = System.getProperty("user.home") + "/Documents"; + private boolean sdkInstalled = false; public void setup() { page = Pages.INTRO; @@ -157,9 +158,34 @@ public class WilkinsCoffee implements ActionListener { switch (page) { case INTRO: page = Pages.PSARC; - //contBtn.setEnabled(false); + + if (!new File(Main.inpath + "psp2psarc.exe").exists()) { // we may have been here before // nag + frame.setEnabled(false); + int result = JOptionPane.showConfirmDialog(frame, "Firestar needs to download additional software to function. Setup is automatic and will only take a few minutes.\nIf you select NO, you will have to download additional dependencies later on.\n\nContinue?", "Firestar Setup", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); + if (result == JOptionPane.YES_OPTION) { + Thread downloaderPopupThread = new Thread(new Runnable() { + @Override + public void run() { + Main.downloadDependenciesBeforeSetVisible(frame); + frame.setEnabled(true); + sdkInstalled = true; + } + }); + downloaderPopupThread.start(); + } else { + frame.setEnabled(true); + } + } else { + sdkInstalled = true; + } + + contBtn.setEnabled(false); contBtn.setBackground(new Color(102, 74, 58)); //brown inputContainer.setVisible(true); + if (!sdkInstalled) { + PSARC_downBtn.setEnabled(false); + PSARC_downBtn.setBackground(new Color(102, 74, 58)); //brown + } instructions.setText("\n" + " \n" +