From 7e184afa59e3ec3542eb7e725dbdead4bcff16a4 Mon Sep 17 00:00:00 2001 From: Michael-Jouanneau Date: Mon, 19 Dec 2016 19:50:08 +0100 Subject: [PATCH] Added things --- .idea/misc.xml | 5 +---- src/Launcher/Main.java | 32 +++++++++++++++++++++----------- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index 59225cf..e005d92 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,12 +1,9 @@ - - - - + diff --git a/src/Launcher/Main.java b/src/Launcher/Main.java index a61fe0f..bba025b 100644 --- a/src/Launcher/Main.java +++ b/src/Launcher/Main.java @@ -32,8 +32,10 @@ import javafx.scene.control.PasswordField; import javafx.scene.control.TextField; import javafx.scene.image.Image; import javafx.scene.image.ImageView; +import javafx.scene.input.MouseEvent; import javafx.scene.layout.Pane; import javafx.scene.shape.Rectangle; +import javafx.stage.Modality; import javafx.stage.Stage; import javafx.stage.StageStyle; import javafx.util.Duration; @@ -171,7 +173,7 @@ public class Main extends Application { } }); - Settings_btn.setOnMouseClicked(event ->{ + Settings_btn.setOnMouseClicked((MouseEvent event) ->{ if(!activeTab.equals(Settings_btn)){ updateTabSelection(Settings_btn, TabType.MAIN); Node n = Tabs.switchTab("settings", tab), tmp; // Sets the active tab to the settings tab unless it's already active @@ -195,17 +197,25 @@ public class Main extends Application { Tabs.load("settings_minecraft").lookup("#minecraft-login-btn").setOnMouseClicked(event3 ->{ System.out.println("Logging into minecraft"); - Stage login = new Stage(); - login.initStyle(StageStyle.UTILITY); - Pane minecraftlogin = (Pane) Tabs.load("instance_userinfo"); - login.setScene(new Scene(minecraftlogin, 300, 308)); - login.show(); - login.setResizable(false); - login.setTitle("Minecraft Login"); + try { + Stage login = new Stage(); + login.initModality(Modality.APPLICATION_MODAL); + login.initStyle(StageStyle.UTILITY); + Pane minecraftlogin = (Pane) Tabs.load("instance_userinfo"); + login.setScene(new Scene(minecraftlogin, 300, 308)); + login.show(); + login.setResizable(false); + login.setTitle("Minecraft Login"); + + minecraftlogin.lookup("#minecraft-login").setOnMouseClicked(event4 ->{ + System.out.println("Logging in ...."); + }); + + }catch (Exception e) { + e.printStackTrace(); + } + - minecraftlogin.lookup("#minecraft-login").setOnMouseClicked(event4 ->{ - System.out.println("Logging in ...."); - }); }); }