From d7f188fa432257d396807edf55d30a2b945ee9f3 Mon Sep 17 00:00:00 2001 From: Michael-Jouanneau Date: Thu, 22 Dec 2016 11:14:24 +0100 Subject: [PATCH] Added things --- src/Launcher/Main.java | 15 ++++++++++++--- src/assets/layout/instance_userinfo.fxml | 2 +- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/Launcher/Main.java b/src/Launcher/Main.java index f0640d4..c228098 100644 --- a/src/Launcher/Main.java +++ b/src/Launcher/Main.java @@ -59,7 +59,6 @@ public class Main extends Application { 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; double xOffset = 0, yOffset = 0; // Offsets for dragging @@ -69,7 +68,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; @@ -100,7 +99,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(); @@ -112,6 +111,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"); @@ -201,7 +201,16 @@ 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 = event.getSceneX(); + yOffset = event.getSceneY(); + }); + dragbar_1.setOnMouseDragged(event4 -> { + login.setX(event.getScreenX() - xOffset); + login.setY(event.getScreenY() - yOffset); + }); minecraftlogin.lookup("#close-minecraft-login-window").setOnMouseClicked(event4 ->{ System.out.println("Closing window"); diff --git a/src/assets/layout/instance_userinfo.fxml b/src/assets/layout/instance_userinfo.fxml index 296e9ed..0513e4e 100644 --- a/src/assets/layout/instance_userinfo.fxml +++ b/src/assets/layout/instance_userinfo.fxml @@ -9,7 +9,7 @@ - +