<?xml version="1.0" encoding="UTF-8"?>

<!--
  ~ Minosoft
  ~ Copyright (C) 2020-2022 Moritz Zwerger
  ~
  ~ This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
  ~
  ~ This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  ~
  ~ You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
  ~
  ~ This software is not affiliated with Mojang AB, the original developer of Minecraft.
  -->

<?import javafx.geometry.*?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.PasswordField?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.text.*?>
<HBox xmlns:fx="http://javafx.com/fxml/1" fx:id="root" prefHeight="240.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/16"> <!--fx:controller="de.bixilon.minosoft.gui.eros.main.account.add.OfflineAddController" -->
    <GridPane HBox.hgrow="ALWAYS">
        <columnConstraints>
            <ColumnConstraints hgrow="ALWAYS"/>
        </columnConstraints>
        <rowConstraints>
            <RowConstraints vgrow="NEVER"/>
            <RowConstraints vgrow="NEVER"/>
            <RowConstraints vgrow="NEVER"/>
            <RowConstraints vgrow="NEVER"/>
            <RowConstraints vgrow="ALWAYS"/>
            <RowConstraints vgrow="NEVER"/>
        </rowConstraints>
        <TextFlow style="-fx-font-size: 30;" fx:id="headerFX">
            <GridPane.margin>
                <Insets bottom="10.0" left="5.0" right="5.0" top="10.0"/>
            </GridPane.margin>
            <Text text="Add mojang account"/>
        </TextFlow>
        <TextFlow fx:id="descriptionFX" GridPane.rowIndex="1">
            <padding>
                <Insets bottom="5.0" left="5.0" right="5.0" top="5.0"/>
            </padding>
            <GridPane.margin>
                <Insets bottom="15.0" right="5.0" top="5.0"/>
            </GridPane.margin>
            <Text text="Please enter your mojang email (or for legacy accounts their username) and your password to continue"/>
        </TextFlow>
        <GridPane GridPane.rowIndex="2">
            <columnConstraints>
                <ColumnConstraints hgrow="NEVER"/>
                <ColumnConstraints hgrow="ALWAYS"/>
            </columnConstraints>
            <rowConstraints>
                <RowConstraints valignment="CENTER" vgrow="NEVER"/>
                <RowConstraints minHeight="10.0" prefHeight="30.0" valignment="CENTER" vgrow="NEVER"/>
            </rowConstraints>
            <TextFlow fx:id="emailLabelFX">
                <GridPane.margin>
                    <Insets bottom="5.0" left="5.0" right="30.0" top="5.0"/>
                </GridPane.margin>
                <Text text="Email"/>
            </TextFlow>
            <TextField fx:id="emailFX" promptText="user@example.org" GridPane.columnIndex="1">
                <GridPane.margin>
                    <Insets bottom="5.0" left="5.0" right="5.0" top="5.0"/>
                </GridPane.margin>
            </TextField>
            <TextFlow fx:id="passwordLabelFX" GridPane.rowIndex="1">
                <GridPane.margin>
                    <Insets bottom="5.0" left="5.0" right="30.0" top="5.0"/>
                </GridPane.margin>
                <Text text="Password"/>
            </TextFlow>
            <PasswordField fx:id="passwordFX" promptText="********" GridPane.columnIndex="1" GridPane.rowIndex="1">
                <GridPane.margin>
                    <Insets bottom="5.0" left="5.0" right="5.0" top="5.0"/>
                </GridPane.margin>
            </PasswordField>
        </GridPane>
        <GridPane GridPane.rowIndex="5">
            <columnConstraints>
                <ColumnConstraints hgrow="ALWAYS"/>
                <ColumnConstraints hgrow="NEVER"/>
                <ColumnConstraints hgrow="NEVER"/>
            </columnConstraints>
            <rowConstraints>
                <RowConstraints vgrow="NEVER"/>
            </rowConstraints>
            <Button fx:id="cancelButtonFX" onAction="#cancel" text="Cancel" GridPane.columnIndex="1">
                <GridPane.margin>
                    <Insets bottom="5.0" left="5.0" right="5.0" top="5.0"/>
                </GridPane.margin>
            </Button>
            <Button fx:id="loginButtonFX" disable="true" onAction="#login" text="Login" defaultButton="true" GridPane.columnIndex="2">
                <GridPane.margin>
                    <Insets bottom="5.0" left="5.0" right="5.0" top="5.0"/>
                </GridPane.margin>
            </Button>
        </GridPane>
        <TextFlow fx:id="errorFX" GridPane.rowIndex="3">
            <GridPane.margin>
                <Insets bottom="5.0" left="5.0" right="5.0" top="5.0"/>
            </GridPane.margin>
            <Text text="Unknown exception: This is just a dummy"/>
        </TextFlow>
    </GridPane>
</HBox>
