confirm dialogs, fix index wipe bug

This commit is contained in:
Downforce Agent 2024-06-29 13:30:01 -05:00
parent 8cc7fca35c
commit addd23b760

View File

@ -87,9 +87,9 @@ public class MissPiggy implements ActionListener {
toolsMenu = new JMenu("Tools"); toolsMenu = new JMenu("Tools");
helpMenu = new JMenu("Help"); helpMenu = new JMenu("Help");
fileMenu.add(new JMenuItem("Deploy All Mods")); fileMenu.add(new JMenuItem("Deploy Mods"));
fileMenu.add(new JMenuItem("Import Mod...")); fileMenu.add(new JMenuItem("Import Mod from File"));
fileMenu.add(new JMenuItem("Remove All")); fileMenu.add(new JMenuItem("Delete All"));
fileMenu.add(new JSeparator()); fileMenu.add(new JSeparator());
fileMenu.add(new JMenuItem("Options")); fileMenu.add(new JMenuItem("Options"));
fileMenu.add(new JMenuItem("Quit")); fileMenu.add(new JMenuItem("Quit"));
@ -269,6 +269,8 @@ public class MissPiggy implements ActionListener {
// Will likely split the below functions into separate classes to work with intellij GUI designer. // Will likely split the below functions into separate classes to work with intellij GUI designer.
public void deployModGUI() { public void deployModGUI() {
int result = JOptionPane.showConfirmDialog(frame, "A new PSARC will be generated. This can take several minutes.\nDuring this time, your computer may be very busy or slow.\n\nAre you sure you want to continue?", "Deploy Mods", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
if (result == JOptionPane.YES_OPTION) {
// prevent interruptions // prevent interruptions
frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
frame.setEnabled(false); frame.setEnabled(false);
@ -276,6 +278,7 @@ public class MissPiggy implements ActionListener {
// start // start
new Gonzo().DeployMods(this); new Gonzo().DeployMods(this);
} }
}
public void wrapUpDeployment() { public void wrapUpDeployment() {
// restore functionality to main window // restore functionality to main window
@ -330,13 +333,14 @@ public class MissPiggy implements ActionListener {
for (Main.Mod entry : Main.Mods) { for (Main.Mod entry : Main.Mods) {
new File(System.getProperty("user.home") + "/.firestar/mods/" + entry.path).delete(); new File(System.getProperty("user.home") + "/.firestar/mods/" + entry.path).delete();
} }
}
new File(System.getProperty("user.home") + "/.firestar/mods/index").delete(); new File(System.getProperty("user.home") + "/.firestar/mods/index").delete();
Main.Mods.clear(); Main.Mods.clear();
InitializeModListStructure(); InitializeModListStructure();
InitializeModListInGUI(); InitializeModListInGUI();
} }
}
public void optionsGUI() { public void optionsGUI() {
// todo settings page w/ reset switch // todo settings page w/ reset switch