Minor update

- Minecraft login loading screen
This commit is contained in:
Gabriel Tofvesson 2016-12-22 20:38:35 +01:00
parent f4272851c2
commit 937df563f8
3 changed files with 44 additions and 6 deletions

2
.idea/misc.xml generated
View File

@ -3,7 +3,7 @@
<component name="ProjectKey">
<option name="state" value="project://e79810c8-c5c8-43b1-b19c-90c1f4095425" />
</component>
<component name="ProjectRootManager" languageLevel="JDK_1_8" default="false" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="false" project-jdk-name="1.8 (1)" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
<component name="WebServicesPlugin" addRequiredLibraries="true" />

View File

@ -23,10 +23,7 @@ import javafx.collections.ObservableList;
import javafx.scene.Node;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.PasswordField;
import javafx.scene.control.TextField;
import javafx.scene.control.*;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.input.MouseEvent;
@ -201,7 +198,7 @@ public class Main extends Application {
login.setResizable(false);
login.setTitle("Minecraft Login");
dragbar_1 = (Pane) Tabs.load("instance_userinfo").lookup("#dragbar-1");
dragbar_1 = (Pane) minecraftlogin.lookup("#dragbar-1");
dragbar_1.setOnMousePressed(event4 -> {
xOffset = event4.getSceneX();
@ -219,6 +216,21 @@ public class Main extends Application {
minecraftlogin.lookup("#minecraft-login").setOnMouseClicked(event4 ->{
System.out.println("Logging in ....");
Pane lw;
Scene s = login.getScene();
login.setScene(new Scene(lw=(Pane)Tabs.reloadTab("instance_loginwait"), 300, 308));
login.getScene().getRoot().setOnMousePressed(event5 -> {
xOffset = event5.getSceneX();
yOffset = event5.getSceneY();
});
login.getScene().getRoot().setOnMouseDragged(event5 -> {
login.setX(event5.getScreenX() - xOffset);
login.setY(event5.getScreenY() - yOffset);
});
lw.lookup("#login_cancel").setOnMouseClicked(event2 -> {
System.out.println("Canceled");
login.setScene(s);
});
});
});
}

View File

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.Cursor?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.ProgressIndicator?>
<?import javafx.scene.effect.ColorAdjust?>
<?import javafx.scene.layout.Pane?>
<?import javafx.scene.text.Font?>
<Pane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="308.0" prefWidth="300.0" stylesheets="@../style/default-theme.css" xmlns="http://javafx.com/javafx/8.0.112" xmlns:fx="http://javafx.com/fxml/1">
<children>
<Label alignment="BOTTOM_CENTER" layoutX="104.0" layoutY="229.0" text="Logging in...">
<font>
<Font size="17.0" />
</font></Label>
<ProgressIndicator layoutX="124.0" layoutY="127.0" mouseTransparent="true" nodeOrientation="LEFT_TO_RIGHT" scaleX="2.0" scaleY="2.0">
<cursor>
<Cursor fx:constant="WAIT" />
</cursor>
<effect>
<ColorAdjust brightness="-1.0" contrast="-0.00" hue="-0.5" saturation="-0.98" />
</effect></ProgressIndicator>
<Button id="login_cancel" layoutX="124.0" layoutY="267.0" mnemonicParsing="false" text="Cancel" />
</children>
</Pane>