diff --git a/.idea/material_theme_project_new.xml b/.idea/material_theme_project_new.xml new file mode 100644 index 0000000..27a7651 --- /dev/null +++ b/.idea/material_theme_project_new.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml new file mode 100644 index 0000000..2b63946 --- /dev/null +++ b/.idea/uiDesigner.xml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Kermit.java b/src/Kermit.java index 5b6a4a0..efe2b18 100644 --- a/src/Kermit.java +++ b/src/Kermit.java @@ -138,7 +138,7 @@ public class Kermit implements ActionListener { changePage(Pages.DONE); break; case DONE: - new MissPiggy(); + new MissPiggy().Action(); page = Pages.AGREEMENT; //set it here since we're disposing of the entire thing frame.dispose(); diff --git a/src/Main.java b/src/Main.java index 2973284..852f245 100644 --- a/src/Main.java +++ b/src/Main.java @@ -23,7 +23,7 @@ import java.awt.event.ActionListener; import java.io.*; import java.nio.file.Files; import java.nio.file.Paths; -import java.util.List; +import java.util.*; import javax.swing.*; public class Main { @@ -45,10 +45,13 @@ public class Main { //public int gameversion; //TODO detect a game version and compatibility? // no public int priority = 0; public String friendlyName; + public String game; //TODO for multi game support + public int loaderversion = 0; //minimum required vint or feature level from Firestar + public String author; // if null, "Author is unknown." } // Mods - public static List Mods; + public static List Mods = new ArrayList(); public static void main(String[] args) { // license string @@ -74,7 +77,7 @@ public class Main { new Kermit().setup(fConf); // this is a fresh install, run the OOBE. } else { // todo load modlist - new MissPiggy(); + new MissPiggy().Action(); // Quick! Start singing Firework by Katy Perry! (or open the main window i guess...) } } diff --git a/src/MasterWindowLayout.form b/src/MasterWindowLayout.form new file mode 100644 index 0000000..1e6cd37 --- /dev/null +++ b/src/MasterWindowLayout.form @@ -0,0 +1,135 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/MissPiggy.java b/src/MissPiggy.java index c9e4d9d..9807660 100644 --- a/src/MissPiggy.java +++ b/src/MissPiggy.java @@ -17,13 +17,76 @@ */ import javax.swing.*; +import java.awt.*; +import static javax.swing.WindowConstants.EXIT_ON_CLOSE; public class MissPiggy { - JDialog frame = new JDialog(); - public void MissPiggy() { + JFrame frame = new JFrame(); + JPanel frameContainer; + JPanel actionsContainer; + JPanel descriptionContainer; + + JMenuBar menuBar; + JMenu menu; + JMenuItem menuItem; + JScrollPane modListScrollContainer; + JList modList; + private JButton toggleButton; + private JButton moveUpButton; + private JButton deleteButton1; + private JButton moveDownButton; + private JButton optionsButton; + private JButton importButton; + private JButton generateButton; + + private int selectedItem; + + // Initialize the main window + public void Action(/*Main entryPoint*/) { // todo construct contents // todo display modlist + /// DEBUG /// + Main.Mod testModEntry = /*entryPoint*/new Main().new Mod(); //this is retarded? we're making a new object of a certain type, why the fuck do you care where it comes from? static or regardless?? + testModEntry.friendlyName = "Example Mod"; + testModEntry.game = "2048"; + testModEntry.path = "unused"; + testModEntry.version = 1; + testModEntry.priority = 0; //might discard this in favor of the list index for simplicity + testModEntry.loaderversion = 0; + Main.Mods.add(testModEntry); + Main.Mods.add(testModEntry); + Main.Mods.add(testModEntry); + ///-/////-/// + InitializeModListInGUI(); + + frame.add(frameContainer); // initialize window contents -- will be handled by IntelliJ IDEA + + frame.setSize(800, 600); // 1280 800 + frame.setTitle("Firestar Mod Manager"); + frame.setResizable(true); + frame.setDefaultCloseOperation(EXIT_ON_CLOSE); + frame.setLayout(new GridLayout()); + frame.setVisible(true); + } + + public void InitializeModListInGUI() { // i really wanted this to be "lights, camera, action" but the code organizing kept getting stupider and stupider so i gave up + // cleanup + modList.clearSelection(); + modList.removeAll(); + + // add text entry for each + int i = 0; + System.out.println("Initializing modList to GUI with length of" + Main.Mods.size() + "units"); //debug + while (i < Main.Mods.size()) { + modList.add(new JLabel(Main.Mods.get(i).friendlyName)); + + //debug + if (Main.Mods.get(i).author == null) {Main.Mods.get(i).author = "Anonymous";} + System.out.println("Added " + Main.Mods.get(i).friendlyName + " by " + Main.Mods.get(i).author); + + i++; + } } }