Skip to content

Commit

Permalink
Minor updates
Browse files Browse the repository at this point in the history
  • Loading branch information
9vult committed Feb 2, 2022
1 parent 0324aba commit d3f2745
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 14 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ libs/*
.settings/*
./.settings/*
/target/
dependency-reduced-pom.xml
8 changes: 8 additions & 0 deletions plugins/text.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name = "Text"
author = "9volt"
description = "Add text directly to the line"
transform = false
params = [
"Text"
]
format = "}${Text}{"
50 changes: 40 additions & 10 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,41 @@
<modelVersion>4.0.0</modelVersion>
<groupId>kfxgui</groupId>
<artifactId>kfxgui</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>0.0.5-Alpha</version>
<name>KFX-GUI</name>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>

<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<release>11</release>
</configuration>
</plugin>


<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>moe.ninevolt.kfxgui.KfxGui</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>

</plugins>
</build>

Expand Down Expand Up @@ -44,30 +67,37 @@
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-graphics</artifactId>
<version>18-ea+10</version>
<version>11</version>
<classifier>win</classifier>
</dependency>


<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>18-ea+10</version>
<artifactId>javafx-graphics</artifactId>
<version>11</version>
<classifier>linux</classifier>
</dependency>


<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-base</artifactId>
<version>18-ea+10</version>
<artifactId>javafx-graphics</artifactId>
<version>11</version>
<classifier>mac</classifier>
</dependency>



<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx</artifactId>
<version>18-ea+10</version>
<type>pom</type>
<artifactId>javafx-controls</artifactId>
<version>11</version>
</dependency>

<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-base</artifactId>
<version>11</version>
</dependency>

</dependencies>
Expand Down
30 changes: 28 additions & 2 deletions src/moe/ninevolt/kfxgui/KfxGui.java
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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<Path> 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);
Expand Down
5 changes: 3 additions & 2 deletions src/moe/ninevolt/kfxgui/gui/windows/MainWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ public class MainWindow extends Application {
Menu fileMenu;
MenuItem atarashiiMI;
MenuItem saveMI;
// MenuItem saveAsMI;
MenuItem openMI;
MenuItem exportsMI;
MenuItem exportfMI;
Expand All @@ -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");
Expand All @@ -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());
Expand Down

0 comments on commit d3f2745

Please sign in to comment.