From 2aaeae29b67ceedb3cb4df8e0974da20171b1475 Mon Sep 17 00:00:00 2001 From: Lukas Date: Mon, 15 Jun 2020 17:43:08 +0200 Subject: [PATCH] create StartMenu --- .idea/compiler.xml | 1 + pom.xml | 13 +++++++ .../java/de/bixilon/minosoft/Minosoft.java | 7 ++-- .../de/bixilon/minosoft/render/StartMenu.java | 34 +++++++++++++++++++ src/main/resources/StartMenu.fxml | 0 5 files changed, 52 insertions(+), 3 deletions(-) create mode 100644 src/main/java/de/bixilon/minosoft/render/StartMenu.java create mode 100644 src/main/resources/StartMenu.fxml diff --git a/.idea/compiler.xml b/.idea/compiler.xml index 51451bd73..b0fb4c5e6 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -6,6 +6,7 @@ + diff --git a/pom.xml b/pom.xml index 08c0c2848..e12ada0d0 100644 --- a/pom.xml +++ b/pom.xml @@ -36,6 +36,14 @@ 11 + + org.openjfx + javafx-maven-plugin + 0.0.4 + + HelloFX + + @@ -46,6 +54,11 @@ + + org.openjfx + javafx-controls + 14 + org.json json diff --git a/src/main/java/de/bixilon/minosoft/Minosoft.java b/src/main/java/de/bixilon/minosoft/Minosoft.java index 8dba6d7c3..b6c522dd6 100644 --- a/src/main/java/de/bixilon/minosoft/Minosoft.java +++ b/src/main/java/de/bixilon/minosoft/Minosoft.java @@ -51,7 +51,6 @@ public class Minosoft { checkClientToken(); - Connection c = new Connection(config.getString("debug.host"), config.getInteger("debug.port")); accountList = config.getMojangAccounts(); if (accountList.size() == 0) { /* @@ -66,8 +65,10 @@ public class Minosoft { System.exit(1); } account.saveToConfig(); - c.setPlayer(new Player(account)); - c.connect(); + + Connection connection = new Connection(config.getString("debug.host"), config.getInteger("debug.port")); + connection.setPlayer(new Player(account)); + connection.connect(); } /** diff --git a/src/main/java/de/bixilon/minosoft/render/StartMenu.java b/src/main/java/de/bixilon/minosoft/render/StartMenu.java new file mode 100644 index 000000000..174e1e6a7 --- /dev/null +++ b/src/main/java/de/bixilon/minosoft/render/StartMenu.java @@ -0,0 +1,34 @@ +/* + * Codename Minosoft + * Copyright (C) 2020 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 . + * + * This software is not affiliated with Mojang AB, the original developer of Minecraft. + */ + +package de.bixilon.minosoft.render; + +import javafx.application.Application; +import javafx.scene.Parent; +import javafx.scene.Scene; +import javafx.stage.Stage; + +public class StartMenu extends Application { + + public static void main(String[] args) { + launch(args); + } + + @Override + public void start(Stage primaryStage) { + Parent root = FXMLLoader.load(getClass().getResource("StartMenu.fxml")); + primaryStage.setTitle("FXML"); + primaryStage.setScene(new Scene(root, 100, 57)); + primaryStage.show(); + } +} diff --git a/src/main/resources/StartMenu.fxml b/src/main/resources/StartMenu.fxml new file mode 100644 index 000000000..e69de29bb