Inceptum/launcher/src/main/java/io/gitlab/jfronny/inceptum/frontend/gui/window/NewInstanceWindow.java
JFronny 35ffea6feb
Get rid of JGit, please use a normal git install.
.gitignore is now parsed manually during export
2022-08-02 16:55:16 +02:00

48 lines
1.8 KiB
Java

package io.gitlab.jfronny.inceptum.frontend.gui.window;
import imgui.ImGui;
import io.gitlab.jfronny.inceptum.frontend.gui.control.InstanceManageControls;
import io.gitlab.jfronny.inceptum.util.Utils;
import io.gitlab.jfronny.inceptum.util.install.SetupStepInfo;
import io.gitlab.jfronny.inceptum.util.install.Steps;
import java.io.IOException;
public class NewInstanceWindow extends Window {
private final InstanceManageControls imc = new InstanceManageControls(null, null);
public NewInstanceWindow() {
super("New Instance");
}
@Override
public void draw() {
if (ImGui.beginTabBar("NewInstanceBar")) {
if (ImGui.beginTabItem("New")) {
imc.snapshotsBox();
imc.versionBox(ver -> {});
imc.nameBox("OK", name -> {
try {
GuiUtil.createInstance(new SetupStepInfo(imc.getVersionInfo(),
imc.getLoaderInfo(),
name,
Steps.createProcessState()));
} catch (IOException e) {
Utils.LOGGER.error("Could not initialize instance creation", e);
}
close();
});
ImGui.endTabItem();
}
if (ImGui.beginTabItem("Import")) {
ImGui.text("You can also just add an instance directory and it'll be loaded automatically");
ImGui.text("Using git to manage it is recommended if you do so");
ImGui.spacing();
ImGui.text("Importing CurseForge or Modrinth packs is not yet implemented");
//TODO generic importer based on zip contents and file name ("mrpack")
ImGui.endTabItem();
}
ImGui.endTabBar();
}
}
}