From d3f2745c6dd2adefb049397359796e17ecc32551 Mon Sep 17 00:00:00 2001 From: 9vult Date: Tue, 1 Feb 2022 23:28:40 -0500 Subject: [PATCH] Minor updates --- .gitignore | 1 + plugins/text.toml | 8 +++ pom.xml | 50 +++++++++++++++---- src/moe/ninevolt/kfxgui/KfxGui.java | 30 ++++++++++- .../kfxgui/gui/windows/MainWindow.java | 5 +- 5 files changed, 80 insertions(+), 14 deletions(-) create mode 100644 plugins/text.toml diff --git a/.gitignore b/.gitignore index 03c5a3b..2e98f20 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ libs/* .settings/* ./.settings/* /target/ +dependency-reduced-pom.xml \ No newline at end of file diff --git a/plugins/text.toml b/plugins/text.toml new file mode 100644 index 0000000..0f9088d --- /dev/null +++ b/plugins/text.toml @@ -0,0 +1,8 @@ +name = "Text" +author = "9volt" +description = "Add text directly to the line" +transform = false +params = [ + "Text" +] +format = "}${Text}{" \ No newline at end of file diff --git a/pom.xml b/pom.xml index 48598f3..9359b45 100644 --- a/pom.xml +++ b/pom.xml @@ -2,11 +2,12 @@ 4.0.0 kfxgui kfxgui - 0.0.1-SNAPSHOT + 0.0.5-Alpha KFX-GUI src + maven-compiler-plugin 3.8.0 @@ -14,6 +15,28 @@ 11 + + + + maven-shade-plugin + 3.2.1 + + + package + + shade + + + + + moe.ninevolt.kfxgui.KfxGui + + + + + + + @@ -44,30 +67,37 @@ org.openjfx javafx-graphics - 18-ea+10 + 11 + win org.openjfx - javafx-controls - 18-ea+10 + javafx-graphics + 11 + linux org.openjfx - javafx-base - 18-ea+10 + javafx-graphics + 11 + mac - org.openjfx - javafx - 18-ea+10 - pom + javafx-controls + 11 + + + + org.openjfx + javafx-base + 11 diff --git a/src/moe/ninevolt/kfxgui/KfxGui.java b/src/moe/ninevolt/kfxgui/KfxGui.java index 27eae30..8700b08 100644 --- a/src/moe/ninevolt/kfxgui/KfxGui.java +++ b/src/moe/ninevolt/kfxgui/KfxGui.java @@ -1,5 +1,13 @@ package moe.ninevolt.kfxgui; +import java.io.IOException; +import java.nio.file.DirectoryStream; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; + +import javax.swing.JOptionPane; + import javafx.application.Application; import moe.ninevolt.kfxgui.gui.windows.MainWindow; import moe.ninevolt.kfxgui.plugins.PluginLoader; @@ -15,13 +23,31 @@ public class KfxGui { public static String APPLICATION_NAME = "KFX-GUI"; public static String APPLICATION_DESC = "9volt GUI Karaoke Template Builder"; - public static String APPLICATION_VERS = "0.1 Alpha"; + public static String APPLICATION_VERS = "0.0.5 Alpha"; private static PluginLoader pl; private static Project project; private KfxGui(String[] args) { - pl = new PluginLoader("./plugins"); + // Check if the plugins directory exists and is populated before starting + try { + Path pluginsDirectory = Paths.get("plugins"); + if (Files.exists(pluginsDirectory)) { + try (DirectoryStream directoryStream = Files.newDirectoryStream(pluginsDirectory)) { + if (!directoryStream.iterator().hasNext()) { + JOptionPane.showMessageDialog(null, "Failed to load: Plugins directory is empty."); + System.exit(-1); + } + } + } else { + JOptionPane.showMessageDialog(null, "Failed to load: Plugins directory does not exist."); + System.exit(-1); + } + } catch (IOException ioe) { + JOptionPane.showMessageDialog(null, "Failed to load: IO Error: " + ioe.getMessage()); + System.exit(-1); + } + pl = new PluginLoader("plugins"); project = new Project("New Project", "Stock"); Application.launch(MainWindow.class, args); diff --git a/src/moe/ninevolt/kfxgui/gui/windows/MainWindow.java b/src/moe/ninevolt/kfxgui/gui/windows/MainWindow.java index c4e0ddf..98e9c87 100644 --- a/src/moe/ninevolt/kfxgui/gui/windows/MainWindow.java +++ b/src/moe/ninevolt/kfxgui/gui/windows/MainWindow.java @@ -46,7 +46,6 @@ public class MainWindow extends Application { Menu fileMenu; MenuItem atarashiiMI; MenuItem saveMI; - // MenuItem saveAsMI; MenuItem openMI; MenuItem exportsMI; MenuItem exportfMI; @@ -73,7 +72,6 @@ public void start(Stage window) throws Exception { atarashiiMI = new MenuItem("New"); openMI = new MenuItem("Open Project"); saveMI = new MenuItem("Save Project"); - // saveAsMI = new MenuItem("Save As..."); exportsMI = new MenuItem("Export Text"); exportfMI = new MenuItem("Export ASS File..."); projectMenu = new Menu("Project"); @@ -82,6 +80,9 @@ public void start(Stage window) throws Exception { viewMenu = new Menu("View"); swatchMI = new MenuItem("Swatches"); targetMenuItems = new HashMap<>(); + + atarashiiMI.setDisable(true); + exportfMI.setDisable(true); projectTree = new ProjectTree(); toolbox = new Toolbox(projectTree.getTree());