Merge remote-tracking branch 'origin/master'

This commit is contained in:
Gabriel Tofvesson 2016-12-22 15:59:10 +01:00
commit 480b268b3c
3 changed files with 56 additions and 15 deletions

View File

@ -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();
});

View File

@ -2,6 +2,7 @@
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.CheckBox?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.PasswordField?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.image.Image?>
@ -9,7 +10,7 @@
<?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">
<Pane id="dragbar-1" 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>
<ImageView fitHeight="308.0" fitWidth="306.0" layoutX="-5.0" pickOnBounds="true">
<image>
@ -24,13 +25,23 @@
<font>
<Font name="Century" size="14.0" />
</font></CheckBox>
<PasswordField id="minecraftpass" layoutX="44.0" layoutY="174.0" prefHeight="25.0" prefWidth="214.0" promptText="Password" />
<TextField id="minecraftuser" layoutX="44.0" layoutY="129.0" prefHeight="25.0" prefWidth="214.0" promptText="Username / Email" />
<ImageView fitHeight="94.0" fitWidth="274.0" layoutX="14.0" layoutY="34.0" pickOnBounds="true" preserveRatio="true">
<PasswordField id="minecraftpass" layoutX="108.0" layoutY="174.0" prefHeight="27.0" prefWidth="165.0" promptText="Password" />
<TextField id="minecraftuser" layoutX="108.0" layoutY="130.0" prefHeight="27.0" prefWidth="165.0" promptText="Username / Email" />
<ImageView fitHeight="94.0" fitWidth="274.0" layoutX="14.0" layoutY="56.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@../icons/minecraft.png" />
</image>
</ImageView>
<Button id="close-minecraft-login-window" layoutX="250.0" layoutY="5.0" mnemonicParsing="false" prefHeight="19.0" prefWidth="45.0" text="Close" />
<Button id="close-minecraft-login-window" layoutX="259.0" layoutY="14.0" mnemonicParsing="false" prefHeight="19.0" prefWidth="28.0" text="X" />
<Label layoutX="14.0" layoutY="134.0" text="Username :" textFill="WHITE">
<font>
<Font name="Century" size="15.0" />
</font>
</Label>
<Label layoutX="14.0" layoutY="178.0" prefHeight="19.0" prefWidth="80.0" text="Password :" textFill="WHITE">
<font>
<Font name="Century" size="15.0" />
</font>
</Label>
</children>
</Pane>

View File

@ -147,12 +147,30 @@
-fx-border-width: 0px 0px 2px 0px;
}
#minecraft-login {
-fx-background-color: #252525;
-fx-background-radius: 0em;
-fx-background-color: #251606;
-fx-background-radius: 2px;
-fx-border-width: 1px;
-fx-border-color: white;
-fx-text-fill: white;
}
#minecraft-login:hover {
-fx-background-color: #bcbcbc;
-fx-background-radius: 0em;
-fx-text-fill: black;
#minecraft-login:hover, #close-minecraft-login-window:hover{
-fx-background-color: #46231c;
-fx-background-radius: 2px;
-fx-border-width: 1px;
-fx-border-color: white;
-fx-text-fill: white;
}
#close-minecraft-login-window {
-fx-background-color: #0d250c;
-fx-background-radius: 2px;
-fx-border-width: 1px;
-fx-border-color: white;
-fx-text-fill: white;
}
#close-minecraft-login-window:hover{
-fx-background-color: #0c4422;
-fx-background-radius: 2px;
-fx-border-width: 1px;
-fx-border-color: white;
-fx-text-fill: white;
}