diff --git a/src/Launcher/Main.java b/src/Launcher/Main.java index dd6ce73..fe0277e 100644 --- a/src/Launcher/Main.java +++ b/src/Launcher/Main.java @@ -54,8 +54,7 @@ public class Main extends Application { public static final String semVerDevState = "PreDev"; // Development stage public static final int semVerMajor = 0; // Major version public static final int semVerMinor = 2; // Minor version - public static final int semVerPatch = 5; // Patch version - public static final int semVerSubPatch = 1; + public static final int semVerPatch = 6; // Patch version double xOffset = 0, yOffset = 0; // Offsets for dragging @@ -65,7 +64,7 @@ public class Main extends Application { private TextField Search_modpacks, Username_minecraft; private Image appIcon; private Rectangle dragBar; // Draggable top bar - Pane root, tab; + Pane root, tab, dragbar_1; private PasswordField Password_minecraft; Node activeTab, settings_activeTab; private Label dialog_changer; @@ -96,7 +95,7 @@ public class Main extends Application { root = (Pane) Tabs.load("main"); // Load via layout loader ((Label)root.lookup("#version")).setText(((Label) root.lookup("#version")) // Dynamically set version label - .getText().replace("$v", semVerDevState+" "+semVerMajor+"."+semVerMinor+"."+semVerPatch+"-"+semVerSubPatch)); // Use variables to define version + .getText().replace("$v", semVerDevState+" "+semVerMajor+"."+semVerMinor+"."+semVerPatch)); // Use variables to define version primaryStage.setTitle("Team-Avion Launcher"); primaryStage.setScene(new Scene(root, 900, 500)); primaryStage.getIcons().clear(); @@ -108,6 +107,7 @@ public class Main extends Application { dragBar = (Rectangle) root.lookup("#rectangle"); + Home_btn = (Button) root.lookup("#Home-btn"); Modpack_btn = (Button) root.lookup("#Modpacks-btn"); Settings_btn = (Button) root.lookup("#Settings-btn"); @@ -197,7 +197,19 @@ public class Main extends Application { login.setResizable(false); login.setTitle("Minecraft Login"); + dragbar_1 = (Pane) Tabs.load("instance_userinfo").lookup("#dragbar-1"); + + dragbar_1.setOnMousePressed(event4 -> { + xOffset = event4.getSceneX(); + yOffset = event4.getSceneY(); + }); + dragbar_1.setOnMouseDragged(event4 -> { + login.setX(event4.getScreenX() - xOffset); + login.setY(event4.getScreenY() - yOffset); + }); + minecraftlogin.lookup("#close-minecraft-login-window").setOnMouseClicked(event4 ->{ + System.out.println("Closing window"); login.close(); }); diff --git a/src/assets/layout/instance_userinfo.fxml b/src/assets/layout/instance_userinfo.fxml index 296e9ed..fced882 100644 --- a/src/assets/layout/instance_userinfo.fxml +++ b/src/assets/layout/instance_userinfo.fxml @@ -2,6 +2,7 @@ + @@ -9,7 +10,7 @@ - + @@ -24,13 +25,23 @@ - - - + + + -