Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package OverFight;
- import java.beans.EventHandler;
- import fr.trxyy.launcherlib.Init;
- import fr.trxyy.launcherlib.LauncherConstants;
- import fr.trxyy.launcherlib.components.LauncherButton;
- import fr.trxyy.launcherlib.components.LauncherPasswordField;
- import fr.trxyy.launcherlib.components.LauncherTextField;
- import fr.trxyy.launcherlib.interfaces.IScreen;
- import fr.trxyy.launcherlib.interfaces.Mover;
- import fr.trxyy.launcherlib.utils.FontLoader;
- import fr.trxyy.launcherlib.utils.PropertiesSaver;
- import fr.trxyy.launcherlib.utils.ResourceLocation;
- import javafx.application.Platform;
- import javafx.event.ActionEvent;
- import javafx.event.Event;
- import javafx.scene.Parent;
- import javafx.scene.image.ImageView;
- import javafx.scene.layout.Pane;
- public class LauncherPanel extends IScreen{
- private static final LauncherConstants LaucherConstants = null;
- private LauncherTextField usernameField;
- private LauncherPasswordField passwordField;
- private LauncherButton loginButton;
- private LauncherButton settingsButton;
- private LauncherButton minimizeButton;
- private LauncherButton closeButton;
- @SuppressWarnings("static-access")
- public Parent createContent() {
- Pane ContentPane = new Pane();
- ContentPane.setPrefSize(LauncherConstants.getWidth(), LauncherConstants.getHeight());
- IScreen.drawAnimatedBackground(ContentPane, "background.mp4");
- IScreen.drawLogo(ResourceLocation.loadImage("logo.png"), 150, 70, 600, 120, ContentPane, Mover.MOVE_ON_CLICK);
- this.usernameField = new LauncherTextField(ContentPane);
- this.usernameField.setText(Init.getUserProps().getUsername());
- this.usernameField.setText(PropertiesSaver.getUsername());
- this.usernameField.setStyle("-fx-background-color: rgba(53,89,119,0.4); -fx-text-fill: white;");
- this.usernameField.setFont(FontLoader.loadFont("Roboto-Light.ttf", "Roboto Lt", 18F));
- this.usernameField.setPosition(LauncherConstants.getWidth() / 2 - 100, LauncherConstants.getHeight() / 2);
- this.usernameField.setPromptText("Pseudonyme/Email");
- this.usernameField.setSize(200, 35);
- this.passwordField = new LauncherPasswordField(ContentPane);
- this.passwordField.setStyle("-fx-background-color: rgba(53,89,119,0.4); -fx-text-fill:white;");
- this.passwordField.setFont(FontLoader.loadFont("Roboto-Light.ttf", "Roboto Lt", 18F));
- this.passwordField.setPosition(LauncherConstants.getWidth() / 2 - 100, LauncherConstants.getHeight() / 2);
- this.passwordField.setPromptText("MDP (vide pour crack)");
- this.passwordField.setSize(200, 35);
- this.loginButton = new LauncherButton(ContentPane);
- this.loginButton.setText("Se connecter");
- this.loginButton.setStyle("-fx-background-color: rgba(53,89,119,0.4); -fx-text-fill: white;");
- this.loginButton.setFont(FontLoader.loadFont("Roboto-Light.ttf", "Roboto Lt", 18F));
- this.loginButton.setPosition(LauncherConstants.getWidth() / 2 - 50, LauncherConstants.getHeight() / 2 + 40);
- this.loginButton.setSize(150, 35);
- this.loginButton.setAction(new EventHandler<ActionEvent>() {
- @Override
- public void handle(ActionEvent k) {
- trylogin(contentpane);
- }
- });
- this.settingsButton = new LauncherButton(ContentPane);
- this.settingsButton.setSize(35, 35);
- this.settingsButton.setPosition(LauncherConstants.getWidth() / 2 - 100, LauncherConstants.getHeight() / 2 + 40);
- this.settingsButton.setInvisible();
- this.settingsButton.setStyle("-fx-padding: 0;");
- ImageView settingsIcon = new ImageView(ResourceLocation.loadImage("settings.png"));
- settingsIcon.setFitWidth(this.settingsButton.getPrefWidth());
- settingsIcon.setFitHeight(this.settingsButton.getPrefHeight());
- this.settingsButton.setGraphic(settingsIcon);
- this.settingsButton.setAction(new EventHandler<ActionEvent>() {
- @Override
- public void handle(ActionEvent k) {
- new OptionsScreenn();
- }
- });
- this.minimizeButton = new LauncherButton(ContentPane);
- this.minimizeButton.setSize(38,22);
- this.minimizeButton.setPosition(LauncherConstants.getWidth() - 76, 0);
- this.minimizeButton.setInvisible();
- this.minimizeButton.setStyle("-fx-padding: 0;");
- ImageView minimizeIcon = new ImageView(ResourceLocation.loadImage("minimize.png"));
- minimizeIcon.setFitWidth(this.minimizeButton.getPrefWidth());
- minimizeIcon.setFitHeight(this.minimizeButton.getPrefHeight());
- this.minimizeButton.setGraphic(minimizeIcon);
- this.minimizeButton.setAction(new EventHandler<ActionEvent>() {
- @Override
- public void handle( ActionEvent k) {
- Stage Stage = (Stage)((LauncherButton)k.getSource()).getScene().getWindow();
- stage.setIconified(true);
- }
- });
- this.closeButton = new LauncherButton(ContentPane);
- this.closeButton.setSize(38, 22);
- this.closeButton.setPosition(LaucherConstants.getWidth() -38, 0);
- this.closeButton.setStyle("-fx-padding: 0;");
- ImageView closeIcon = new ImageView(ResourceLocation.loadImage("close.png"));
- closeIcon.setFitWidth(this.minimizeButton.getPrefWidth());
- closeIcon.setFitHeight(this.minimizeButton.getPrefHeight());
- this.closeButton.setGraphic(closeIcon);
- this.closeButton.setAction(new EventHandler<ActionEvent>() {
- @Override
- public void handle( ActionEvent k ) {
- Platform.exit();
- system.exit(0);
- }
- });
- return ContentPane;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement