This commit is contained in:
Downforce Agent 2024-06-29 12:04:21 -05:00
parent 002d995c05
commit 8ebec68caf

View File

@ -383,6 +383,9 @@ public class MissPiggy implements ActionListener {
modList.addListSelectionListener(e -> { modList.addListSelectionListener(e -> {
if (modList.getSelectedIndex() >= 0 && modList.getModel().getSize() >= 1) { // avoid race OOB when reinitializing mod list if (modList.getSelectedIndex() >= 0 && modList.getModel().getSize() >= 1) { // avoid race OOB when reinitializing mod list
String authorDisplay; String authorDisplay;
try { //debug
File pathReference = new File(System.getProperty("user.home") + "/.firestar/mods/" + Main.Mods.get(modList.getSelectedIndex()).path); File pathReference = new File(System.getProperty("user.home") + "/.firestar/mods/" + Main.Mods.get(modList.getSelectedIndex()).path);
DecimalFormat df = new DecimalFormat("##.##"); DecimalFormat df = new DecimalFormat("##.##");
df.setRoundingMode(RoundingMode.UP); df.setRoundingMode(RoundingMode.UP);
@ -413,6 +416,17 @@ public class MissPiggy implements ActionListener {
modFileSizeStr + " " + modFileSizeUnits + " in size" + modFileSizeStr + " " + modFileSizeUnits + " in size" +
"\n\n" + Main.Mods.get(modList.getSelectedIndex()).description "\n\n" + Main.Mods.get(modList.getSelectedIndex()).description
);} );}
catch (IndexOutOfBoundsException ex) {
System.out.println(ex.getMessage());
System.out.println("mods " + Main.Mods.size());
System.out.println("mod display " + modList.getModel().getSize());
System.out.println("selection index " + modList.getSelectedIndex());
//System.exit(1); //user safety
}
}
}); });
} }
@ -434,10 +448,9 @@ public class MissPiggy implements ActionListener {
} }
bw.close(); bw.close();
if(reload) {
Main.Mods.clear(); //cleanup Main.Mods.clear(); //cleanup
priorityList = ""; priorityList = "";
if(reload) {
InitializeModListStructure(); InitializeModListStructure();
InitializeModListInGUI(); InitializeModListInGUI();
} }