Move to talos legacy
This commit is contained in:
+2
-1
@@ -17,6 +17,7 @@ group 'games.rednblack'
|
||||
version '0.1.4'
|
||||
|
||||
repositories {
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
|
||||
maven { url 'https://jitpack.io' }
|
||||
@@ -126,7 +127,7 @@ dependencies {
|
||||
implementation project(":h2d-libgdx-typinglabel-extension")
|
||||
implementation project(":h2d-libgdx-tinyvg-extension")
|
||||
|
||||
implementation "com.talosvfx:talos-libgdx:$talosVersion"
|
||||
implementation "games.rednblack.talos:runtime-libgdx:$talosVersion"
|
||||
implementation "space.earlygrey:shapedrawer:$shapedrawerVersion"
|
||||
implementation "com.rafaskoberg.gdx:typing-label:$typingLabelVersion"
|
||||
implementation "com.kotcrab.vis:vis-ui:$visuiVersion"
|
||||
|
||||
+1
-1
@@ -5,6 +5,6 @@ spineVersion = 4.1.0
|
||||
visuiVersion = 1.5.3
|
||||
typingLabelVersion = 1.3.0
|
||||
shapedrawerVersion = 2.5.0
|
||||
talosVersion = 1.4.0
|
||||
talosVersion = 1.5.0-SNAPSHOT
|
||||
gdxTinyVGVersion=7a8927633e
|
||||
pureMvcVersion=1.0.2
|
||||
Submodule h2d-libgdx-talos-extension updated: 17f24b7c13...b564f27018
@@ -14,9 +14,9 @@ import com.badlogic.gdx.scenes.scene2d.ui.Skin;
|
||||
import com.badlogic.gdx.utils.*;
|
||||
import com.esotericsoftware.spine.SkeletonJson;
|
||||
import com.kotcrab.vis.ui.VisUI;
|
||||
import com.talosvfx.talos.runtime.ParticleEffectDescriptor;
|
||||
import com.talosvfx.talos.runtime.utils.ShaderDescriptor;
|
||||
import com.talosvfx.talos.runtime.utils.VectorField;
|
||||
import games.rednblack.talos.runtime.ParticleEffectDescriptor;
|
||||
import games.rednblack.talos.runtime.utils.ShaderDescriptor;
|
||||
import games.rednblack.talos.runtime.utils.VectorField;
|
||||
import dev.lyze.gdxtinyvg.TinyVG;
|
||||
import games.rednblack.editor.renderer.data.*;
|
||||
import games.rednblack.editor.renderer.resources.FontSizePair;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package games.rednblack.editor.system;
|
||||
|
||||
import com.artemis.annotations.All;
|
||||
import com.talosvfx.talos.runtime.ParticleEffectInstance;
|
||||
import games.rednblack.talos.runtime.ParticleEffectInstance;
|
||||
import games.rednblack.h2d.extension.talos.TalosComponent;
|
||||
import games.rednblack.h2d.extension.talos.TalosSystem;
|
||||
|
||||
|
||||
@@ -4,9 +4,10 @@ import com.badlogic.gdx.files.FileHandle;
|
||||
import com.badlogic.gdx.utils.Array;
|
||||
import com.badlogic.gdx.utils.Json;
|
||||
import com.kotcrab.vis.ui.util.dialog.Dialogs;
|
||||
import com.talosvfx.talos.runtime.ParticleEffectDescriptor;
|
||||
import com.talosvfx.talos.runtime.ParticleEmitterDescriptor;
|
||||
import com.talosvfx.talos.runtime.modules.*;
|
||||
import games.rednblack.talos.runtime.ParticleEffectDescriptor;
|
||||
import games.rednblack.talos.runtime.ParticleEmitterDescriptor;
|
||||
import games.rednblack.talos.runtime.modules.*;
|
||||
import games.rednblack.talos.runtime.serialization.ExportData;
|
||||
import games.rednblack.editor.proxy.ProjectManager;
|
||||
import games.rednblack.editor.proxy.ResolutionManager;
|
||||
import games.rednblack.editor.proxy.SceneDataManager;
|
||||
@@ -20,7 +21,6 @@ import games.rednblack.editor.utils.AssetsUtils;
|
||||
import games.rednblack.editor.utils.asset.Asset;
|
||||
import games.rednblack.editor.utils.runtime.EntityUtils;
|
||||
import games.rednblack.editor.utils.runtime.SandboxComponentRetriever;
|
||||
import games.rednblack.editor.utils.runtime.TalosResources;
|
||||
import games.rednblack.editor.view.stage.Sandbox;
|
||||
import games.rednblack.h2d.common.ProgressHandler;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
@@ -64,7 +64,7 @@ public class TalosVFXAsset extends Asset {
|
||||
json.setIgnoreUnknownFields(true);
|
||||
ParticleEmitterDescriptor.registerModules();
|
||||
for (Class clazz: ParticleEmitterDescriptor.registeredModules) {
|
||||
json.addClassTag(clazz.getSimpleName(), TalosResources.Module.class);
|
||||
json.addClassTag(clazz.getSimpleName(), clazz);
|
||||
}
|
||||
|
||||
final String targetPath = projectManager.getCurrentProjectPath() + File.separator + ProjectManager.TALOS_VFX_DIR_PATH;
|
||||
@@ -73,7 +73,7 @@ public class TalosVFXAsset extends Asset {
|
||||
for (FileHandle fileHandle : new Array.ArrayIterator<>(files)) {
|
||||
if (!fileHandle.isDirectory() && fileHandle.exists()) {
|
||||
try {
|
||||
TalosResources talosResources = json.fromJson(TalosResources.class, fileHandle);
|
||||
ExportData talosResources = json.fromJson(ExportData.class, fileHandle);
|
||||
//copy images
|
||||
boolean allImagesFound = addTalosImages(talosResources, fileHandle, images);
|
||||
if (allImagesFound) {
|
||||
@@ -131,11 +131,11 @@ public class TalosVFXAsset extends Asset {
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean addTalosImages(TalosResources talosResources, FileHandle fileHandle, Array<FileHandle> imgs) {
|
||||
private boolean addTalosImages(ExportData talosResources, FileHandle fileHandle, Array<FileHandle> imgs) {
|
||||
try {
|
||||
Array<String> resources = talosResources.metadata.resources;
|
||||
for (String res : resources) {
|
||||
if (res.endsWith(".fga"))
|
||||
if (res.endsWith(".fga") || res.endsWith(".shdr"))
|
||||
continue;
|
||||
|
||||
res += ".png";
|
||||
@@ -157,11 +157,11 @@ public class TalosVFXAsset extends Asset {
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean addTalosRes(TalosResources talosResources, FileHandle fileHandle, Array<FileHandle> imgs) {
|
||||
private boolean addTalosRes(ExportData talosResources, FileHandle fileHandle, Array<FileHandle> imgs) {
|
||||
try {
|
||||
Array<String> resources = talosResources.metadata.resources;
|
||||
for (String res : resources) {
|
||||
if (res.endsWith(".fga")) {
|
||||
if (res.endsWith(".fga") || res.endsWith(".shdr")) {
|
||||
File file = new File(FilenameUtils.getFullPath(fileHandle.path()) + res);
|
||||
if (file.exists()) {
|
||||
imgs.add(new FileHandle(file));
|
||||
@@ -173,23 +173,6 @@ public class TalosVFXAsset extends Asset {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (TalosResources.Emitter emitter : talosResources.emitters) {
|
||||
for (TalosResources.Module module : emitter.modules) {
|
||||
if (module.get("shdrAssetName") != null) {
|
||||
String assetName = module.get("shdrAssetName").toString();
|
||||
File file = new File(FilenameUtils.getFullPath(fileHandle.path()) + assetName);
|
||||
if (file.exists()) {
|
||||
imgs.add(new FileHandle(file));
|
||||
} else {
|
||||
Dialogs.showErrorDialog(Sandbox.getInstance().getUIStage(),
|
||||
"\nCould not find " + file.getName() + ".\nCheck if the file exists in the same directory.").padBottom(20).pack();
|
||||
imgs.clear();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -275,6 +258,12 @@ public class TalosVFXAsset extends Asset {
|
||||
File f = new File(currentProjectPath + ProjectManager.TALOS_VFX_DIR_PATH + File.separator + path);
|
||||
FileUtils.copyFileToDirectory(f, tmpDir);
|
||||
}
|
||||
|
||||
if (module instanceof VectorFieldModule) {
|
||||
String path = ((VectorFieldModule) module).fgaFileName + ".fga";
|
||||
File f = new File(currentProjectPath + ProjectManager.TALOS_VFX_DIR_PATH + File.separator + path);
|
||||
FileUtils.copyFileToDirectory(f, tmpDir);
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
package games.rednblack.editor.utils.runtime;
|
||||
|
||||
import com.badlogic.gdx.utils.Array;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
public class TalosResources {
|
||||
|
||||
public Metadata metadata = new Metadata();
|
||||
|
||||
public Array<Emitter> emitters = new Array<>();
|
||||
|
||||
public static class Metadata {
|
||||
public Array<String> resources = new Array<>();
|
||||
}
|
||||
|
||||
public static class Emitter {
|
||||
public Array<Module> modules = new Array<>();
|
||||
}
|
||||
|
||||
public static class Module extends HashMap<String, Object> {
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user