i'm living a lie

This commit is contained in:
Downforce Agent 2024-04-19 17:00:20 -05:00
parent 10b4a91515
commit cc2c143ff2
2 changed files with 13 additions and 5 deletions

View File

@ -32,7 +32,10 @@
<children>
<component id="d80ff" class="javax.swing.JList" binding="modList">
<constraints/>
<properties/>
<properties>
<foreground color="-16777216"/>
<valueIsAdjusting value="false"/>
</properties>
<clientProperties>
<html.disable class="java.lang.Boolean" value="true"/>
</clientProperties>

View File

@ -37,7 +37,7 @@ public class MissPiggy implements ActionListener {
//JMenuItem menuItem;
JScrollPane modListScrollContainer;
public JList<String/*Main.Mod*/> modList;
public JList<String/*JLabel*/> modList;
private JButton toggleButton;
private JButton moveUpButton;
private JButton deleteButton1;
@ -117,16 +117,20 @@ public class MissPiggy implements ActionListener {
// cleanup
modList.clearSelection();
modList.removeAll();
modList.setVisibleRowCount(Main.Mods.size());
modList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
// todo this needs fixing before we can map it to Main.Mods and finish the other functionality around it
// add text entry for each
int i = 0;
/*JLabel[]*/String[] contents = new String[Main.Mods.size()];
System.out.println("Initializing modList to GUI with length of" + Main.Mods.size() + "units"); //debug
while (i < Main.Mods.size()) {
JLabel label = new JLabel(Main.Mods.get(i).friendlyName);
label.setVisible(true);
modList.add(label);
//JLabel label = new JLabel(Main.Mods.get(i).friendlyName);
//label.setVisible(true);
//contents[i] = label; //modList.add(label);
contents[i] = Main.Mods.get(i).friendlyName;
//debug
if (Main.Mods.get(i).author == null) {Main.Mods.get(i).author = "Anonymous";}
@ -134,6 +138,7 @@ public class MissPiggy implements ActionListener {
i++;
}
modList.setListData(contents);
}
@Override