Небольшой фикс.

This commit is contained in:
Alex Dev Sm 2019-06-23 14:32:17 +03:00
parent 637ab55d5d
commit 768206a3aa
2 changed files with 11 additions and 12 deletions

View file

@ -10,7 +10,6 @@
import pro.gravit.launcher.guard.LauncherGuardManager; import pro.gravit.launcher.guard.LauncherGuardManager;
import pro.gravit.launcher.gui.JSRuntimeProvider; import pro.gravit.launcher.gui.JSRuntimeProvider;
import pro.gravit.launcher.gui.RuntimeProvider; import pro.gravit.launcher.gui.RuntimeProvider;
import pro.gravit.launcher.gui.GuiRuntimeProvider;
import pro.gravit.launcher.managers.ClientGsonManager; import pro.gravit.launcher.managers.ClientGsonManager;
import pro.gravit.launcher.managers.ConsoleManager; import pro.gravit.launcher.managers.ConsoleManager;
import pro.gravit.launcher.request.Request; import pro.gravit.launcher.request.Request;
@ -74,24 +73,23 @@ public void start(String... args) throws Throwable {
Launcher.modulesManager.preInitModules(); Launcher.modulesManager.preInitModules();
// INIT GUI // INIT GUI
try try
{
Class.forName( "com.jfoenixparts.controls.JFXPButton" );
if (runtimeProvider == null) runtimeProvider = new JSRuntimeProvider();
}
catch( ClassNotFoundException e ) {
runtimeProvider = new GuiRuntimeProvider();
}
try
{ {
Class.forName( "javafx.application.Application" ); Class.forName( "javafx.application.Application" );
if (runtimeProvider == null) runtimeProvider = new JSRuntimeProvider(); if (runtimeProvider == null) runtimeProvider = new JSRuntimeProvider();
} }
catch( ClassNotFoundException e ) { catch( ClassNotFoundException e ) {
runtimeProvider = new GuiRuntimeProvider(); if (runtimeProvider == null) runtimeProvider = new GuiRuntimeProvider();
}
try
{
Class.forName( "com.jfoenixparts.controls.JFXPButton" );
if (runtimeProvider == null) runtimeProvider = new JSRuntimeProvider();
}
catch( ClassNotFoundException e ) {
if (runtimeProvider == null) runtimeProvider = new GuiRuntimeProvider();
} }
runtimeProvider.init(false); runtimeProvider.init(false);
runtimeProvider.preLoad(); runtimeProvider.preLoad();
// INIT GUI
if (Request.service == null) { if (Request.service == null) {
String address = Launcher.getConfig().address; String address = Launcher.getConfig().address;
LogHelper.debug("Start async connection to %s", address); LogHelper.debug("Start async connection to %s", address);

View file

@ -11,8 +11,8 @@ public class login {
public static JButton loginbutton = new JButton("Войти"); public static JButton loginbutton = new JButton("Войти");
public static JTextField login = new JTextField("Логин"); public static JTextField login = new JTextField("Логин");
public static JPasswordField password = new JPasswordField("Пароль"); public static JPasswordField password = new JPasswordField("Пароль");
public static JFrame frame = new JFrame("Имя лаунчера не задано(Лаунчер не собран)");
static { static {
JFrame frame = new JFrame("Имя лаунчера не задано(Лаунчер не собран)");
JPanel contents = new JPanel(); JPanel contents = new JPanel();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
contents.add(login); contents.add(login);
@ -23,6 +23,7 @@ public class login {
frame.add(contents); frame.add(contents);
frame.setPreferredSize(new Dimension(400,100)); frame.setPreferredSize(new Dimension(400,100));
frame.pack(); frame.pack();
frame.setVisible(true);
} }
} }