Skip to content

Commit 96fc526

Browse files
committed
Particle editor as independent app
1 parent b16be79 commit 96fc526

File tree

3 files changed

+28
-3
lines changed

3 files changed

+28
-3
lines changed

adventure-editor/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ dependencies {
6767

6868
implementation project(":blade-engine")
6969
implementation project(":blade-engine-spine-plugin")
70-
implementation files('libs/gdx-particle-editor.jar')
7170
}
7271

7372
task setVersion(type: WriteProperties) {
@@ -123,6 +122,7 @@ task pack {
123122
distZip {
124123
into(project.name + '-' + project.version) {
125124
from '.'
126-
include 'desktop/*'
125+
// include desktop and thirdparty folders
126+
include('desktop/*', 'thirdparty/*')
127127
}
128128
}

adventure-editor/src/main/java/com/bladecoder/engineeditor/scneditor/ToolsWindow.java

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,32 @@ public void run() {
563563
private void particleEditor() {
564564
// Open the particle editor
565565
List<String> cp = new ArrayList<>();
566-
cp.add(System.getProperty("java.class.path"));
566+
// check that particle editor exists
567+
String[] particleEditorPaths = {
568+
"../thirdparty/gdx-particle-editor.jar",
569+
"./adventure-editor/thirdparty/gdx-particle-editor.jar",
570+
"./thirdparty/gdx-particle-editor.jar"
571+
};
572+
573+
String particleEditorPath = null;
574+
575+
boolean found = false;
576+
577+
for (String path : particleEditorPaths) {
578+
File f = new File(path);
579+
if (f.exists()) {
580+
particleEditorPath = path;
581+
found = true;
582+
break;
583+
}
584+
}
585+
586+
if (!found) {
587+
Message.showMsgDialog(getStage(), "Error", "Particle Editor not found.");
588+
return;
589+
}
590+
591+
cp.add(particleEditorPath);
567592
try {
568593
RunProccess.runJavaProccess("com.ray3k.gdxparticleeditor.lwjgl3.Lwjgl3Launcher", cp, null);
569594
} catch (IOException e) {

0 commit comments

Comments
 (0)