Use GuiEnvBackend when launching dist with GuiCommand
This commit is contained in:
parent
5cc2b416be
commit
cdf81fcb57
|
@ -2,7 +2,9 @@ package io.gitlab.jfronny.inceptum;
|
|||
|
||||
import io.gitlab.jfronny.inceptum.cli.Command;
|
||||
import io.gitlab.jfronny.inceptum.cli.CommandArgs;
|
||||
import io.gitlab.jfronny.inceptum.imgui.GuiEnvBackend;
|
||||
import io.gitlab.jfronny.inceptum.imgui.GuiMain;
|
||||
import io.gitlab.jfronny.inceptum.launcher.LauncherEnv;
|
||||
|
||||
public class GuiCommand extends Command {
|
||||
public GuiCommand() {
|
||||
|
@ -11,6 +13,7 @@ public class GuiCommand extends Command {
|
|||
|
||||
@Override
|
||||
public void invoke(CommandArgs args) {
|
||||
LauncherEnv.updateBackend(new GuiEnvBackend());
|
||||
GuiMain.main();
|
||||
}
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@ import io.gitlab.jfronny.inceptum.launcher.system.source.ModSource;
|
|||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.util.Objects;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
public class LauncherEnv {
|
||||
|
@ -24,7 +25,7 @@ public class LauncherEnv {
|
|||
throw new IllegalStateException("Mismatching classloader between two classes. Something is wrong here");
|
||||
}
|
||||
|
||||
LauncherEnv.backend = backend;
|
||||
updateBackend(backend);
|
||||
|
||||
GsonHolder.registerTypeAdapter(MinecraftArgument.class, new MinecraftArgumentDeserializer());
|
||||
GsonHolder.registerTypeAdapter(Rules.class, new RulesDeserializer());
|
||||
|
@ -57,6 +58,10 @@ public class LauncherEnv {
|
|||
}
|
||||
}
|
||||
|
||||
public static void updateBackend(EnvBackend backend) {
|
||||
LauncherEnv.backend = Objects.requireNonNull(backend);
|
||||
}
|
||||
|
||||
public static void terminate() {
|
||||
ModsDirScanner.closeAll();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue