Massive improvements to launcher

Launcher is now capable of closing itself, launching the engine and  has
a saner launcher.fxml
This commit is contained in:
François Autin
2021-06-03 00:47:49 +02:00
parent a9bbde6c46
commit 85b48c40d4
6 changed files with 125 additions and 79 deletions

View File

@ -1,91 +1,53 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2015, 2019, Gluon and/or its affiliates.
All rights reserved. Use is subject to license terms.
This file is available and licensed under the following license:
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the distribution.
- Neither the name of Oracle Corporation nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
<?import javafx.geometry.Rectangle2D?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.image.Image?>
<?import javafx.scene.control.ChoiceBox?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.layout.Pane?>
<HBox maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" style="-fx-background-color: #151619;" xmlns="http://javafx.com/javafx/16" xmlns:fx="http://javafx.com/fxml/1">
<HBox xmlns:fx="http://javafx.com/fxml" stylesheets="/launcher/ui/style.css" fx:id="window"
prefWidth="640" prefHeight="380"
fx:controller="launcher.FXMLController">
<children>
<VBox prefHeight="400.0" prefWidth="157.0">
<VBox fx:id="sidepanel"
prefWidth="120" prefHeight="380">
<children>
<ImageView accessibleText="Logo" fitHeight="240.0" fitWidth="158.0" pickOnBounds="true" preserveRatio="true">
<image>
</image>
</ImageView>
<VBox alignment="BOTTOM_CENTER" prefHeight="263.0" prefWidth="158.0">
<Pane fx:id="logo"
prefWidth="120" prefHeight="120"></Pane>
<VBox fx:id="btn"
prefWidth="120" prefHeight="260">
<children>
<VBox alignment="CENTER" prefHeight="200.0" prefWidth="100.0">
<children>
<Button mnemonicParsing="false" text="Run" />
</children>
</VBox>
<Button mnemonicParsing="false" prefHeight="25.0" prefWidth="176.0" text="Settings" />
<Button mnemonicParsing="false" prefHeight="25.0" prefWidth="161.0" style="-fx-background-color: #e80000;" text="X Quit" textFill="WHITE" />
<Button text="Play" fx:id="btn_launch" onAction="#launch"/>
<Button text="Settings" fx:id="btn_settings" onAction="#settings"/>
<Button text="Quit" fx:id="btn_quit" onAction="#quit"/>
</children>
</VBox>
</children>
</VBox>
<VBox prefHeight="400.0" prefWidth="455.0">
<HBox fx:id="picker">
<children>
<HBox alignment="CENTER" prefHeight="266.0" prefWidth="475.0">
<VBox fx:id="p1" styleClass="pane_p">
<children>
<VBox alignment="BOTTOM_CENTER" prefHeight="249.0" prefWidth="233.0">
<children>
<ImageView fitHeight="172.0" fitWidth="211.0" pickOnBounds="true" preserveRatio="true">
<image>
</image>
<viewport>
<Rectangle2D />
</viewport>
</ImageView>
</children>
</VBox>
<VBox alignment="BOTTOM_CENTER" prefHeight="249.0" prefWidth="233.0">
<children>
<ImageView fitHeight="200.0" fitWidth="233.0" pickOnBounds="true" preserveRatio="true">
<image>
</image>
</ImageView>
</children>
</VBox>
<ImageView/>
<ChoiceBox styleClass="char_box" />
<ChoiceBox styleClass="contr_box" />
</children>
</HBox>
<HBox prefHeight="168.0" prefWidth="432.0" />
</children></VBox>
</VBox>
<VBox fx:id="p2" styleClass="pane_p">
<children>
<ImageView/>
<ChoiceBox styleClass="char_box" />
<ChoiceBox styleClass="contr_box" />
</children>
</VBox>
</children>
</HBox>
</children>
</HBox>

27
src/launcher/ui/style.css Normal file
View File

@ -0,0 +1,27 @@
#window {
-fx-background-color: #131320;
}
/* Sidepanel */
#sidepanel {
-fx-background-color: #303050;
}
#logo {
-fx-background-image: "logo.png";
}
#btn {
-fx-alignment: center;
}
#btn > Button {
-fx-cursor: hand;
-fx-padding: 5;
-fx-width: 100;
}
#btn_launch {
-fx-text-alignment: center;
}