|
@@ -3,7 +3,9 @@ package xyz.tbvns.ui.Elements;
|
|
import com.badlogic.gdx.Gdx;
|
|
import com.badlogic.gdx.Gdx;
|
|
import imgui.ImGui;
|
|
import imgui.ImGui;
|
|
import imgui.flag.ImGuiWindowFlags;
|
|
import imgui.flag.ImGuiWindowFlags;
|
|
-import jnafilechooser.api.JnaFileChooser;
|
|
|
|
|
|
+import org.lwjgl.util.tinyfd.TinyFileDialogs;
|
|
|
|
+import tv.wunderbox.nfd.awt.AwtFileDialog;
|
|
|
|
+import tv.wunderbox.nfd.nfd.NfdFileDialog;
|
|
import xyz.tbvns.Editor.ModelsManager;
|
|
import xyz.tbvns.Editor.ModelsManager;
|
|
import xyz.tbvns.Models.Animation;
|
|
import xyz.tbvns.Models.Animation;
|
|
import xyz.tbvns.Models.GDModel;
|
|
import xyz.tbvns.Models.GDModel;
|
|
@@ -11,7 +13,8 @@ import xyz.tbvns.ui.Element;
|
|
import xyz.tbvns.ui.Renderable;
|
|
import xyz.tbvns.ui.Renderable;
|
|
|
|
|
|
import java.awt.*;
|
|
import java.awt.*;
|
|
-import java.io.FileNotFoundException;
|
|
|
|
|
|
+import java.io.File;
|
|
|
|
+import java.nio.ByteBuffer;
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
@@ -39,14 +42,17 @@ public class ModelsList implements Element {
|
|
|
|
|
|
public void loadButton() {
|
|
public void loadButton() {
|
|
if (ImGui.button("Load a model")) {
|
|
if (ImGui.button("Load a model")) {
|
|
- JnaFileChooser fileChooser = new JnaFileChooser();
|
|
|
|
- fileChooser.setMode(JnaFileChooser.Mode.Directories);
|
|
|
|
- if (fileChooser.showOpenDialog((Window) null)) {
|
|
|
|
- try {
|
|
|
|
- ModelsManager.addAnimated(fileChooser.getSelectedFile());
|
|
|
|
- } catch (FileNotFoundException e) {
|
|
|
|
- throw new RuntimeException(e);
|
|
|
|
|
|
+ try {
|
|
|
|
+ String path = TinyFileDialogs.tinyfd_selectFolderDialog("Select animation folder:", System.getProperty("user.home"));
|
|
|
|
+ if (path!=null) {
|
|
|
|
+ ModelsManager.addAnimated(
|
|
|
|
+ new File(
|
|
|
|
+ path
|
|
|
|
+ )
|
|
|
|
+ );
|
|
}
|
|
}
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ throw new RuntimeException(e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|