diff --git a/pom.xml b/pom.xml
index 08c0c2848..9fc71e48f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -20,20 +20,14 @@
de.bixilonMinosoft0.1
-
-
- jitpack.io
- http://www.jitpack.io
-
- org.apache.maven.pluginsmaven-compiler-plugin
- 11
- 11
+ 14
+ 14
@@ -56,6 +50,19 @@
snakeyaml1.25
+
+ org.openjfx
+ javafx-controls
+ 14.0.1
+ pom
+
+
+ org.openjfx
+ javafx-fxml
+ 14.0.1
+ pom
+
+
\ No newline at end of file
diff --git a/src/main/java/de/bixilon/minosoft/config/GameConfiguration.java b/src/main/java/de/bixilon/minosoft/config/GameConfiguration.java
index 264410225..91a95405d 100644
--- a/src/main/java/de/bixilon/minosoft/config/GameConfiguration.java
+++ b/src/main/java/de/bixilon/minosoft/config/GameConfiguration.java
@@ -18,7 +18,8 @@ public enum GameConfiguration implements ConfigEnum {
GAME_RENDER_DISTANCE("game.render-distance"),
NETWORK_FAKE_CLIENT_BRAND("network.fake-client-brand"),
GENERAL_LOG_LEVEL("general.log-level"),
- CLIENT_TOKEN("account.clientToken");
+ CLIENT_TOKEN("account.clientToken"),
+ DEBUG_UI("debug.debugUi");
final String path;
diff --git a/src/main/java/de/bixilon/minosoft/debug/DebugWindow.java b/src/main/java/de/bixilon/minosoft/debug/DebugWindow.java
new file mode 100644
index 000000000..4e0ba9d1f
--- /dev/null
+++ b/src/main/java/de/bixilon/minosoft/debug/DebugWindow.java
@@ -0,0 +1,48 @@
+/*
+ * 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.debug;
+
+import de.bixilon.minosoft.debug.gui.DebugMainWindow;
+import de.bixilon.minosoft.debug.handling.DebugUIHandler;
+import de.bixilon.minosoft.debug.handling.DebugUIPacketHandler;
+import de.bixilon.minosoft.protocol.network.Connection;
+
+public class DebugWindow {
+ final Connection connection;
+ Thread uiThread;
+ DebugUIHandler handler;
+
+ public DebugWindow(Connection connection) {
+ this.connection = connection;
+ handler = new DebugUIHandler();
+ connection.addHandler(new DebugUIPacketHandler(this));
+ }
+
+ public Connection getConnection() {
+ return connection;
+ }
+
+ public void run() {
+ // start gui
+ uiThread = new Thread(() -> {
+ DebugMainWindow.setHandler(handler);
+ DebugMainWindow.initAndShow();
+ });
+ uiThread.start();
+ }
+
+ public DebugUIHandler getUIHandler() {
+ return handler;
+ }
+}
diff --git a/src/main/java/de/bixilon/minosoft/debug/gui/DebugMainWindow.java b/src/main/java/de/bixilon/minosoft/debug/gui/DebugMainWindow.java
new file mode 100644
index 000000000..b342bfb49
--- /dev/null
+++ b/src/main/java/de/bixilon/minosoft/debug/gui/DebugMainWindow.java
@@ -0,0 +1,76 @@
+/*
+ * 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.debug.gui;
+
+import de.bixilon.minosoft.debug.handling.DebugUIHandler;
+import javafx.application.Application;
+import javafx.beans.value.ChangeListener;
+import javafx.beans.value.ObservableValue;
+import javafx.fxml.FXMLLoader;
+import javafx.scene.Scene;
+import javafx.scene.control.TextArea;
+import javafx.scene.layout.VBox;
+import javafx.stage.Stage;
+
+import java.io.IOException;
+
+public class DebugMainWindow extends Application {
+ static DebugUIHandler handler;
+ static Stage stage;
+ static boolean initialized = false;
+
+ public static void initAndShow() {
+ launch();
+ }
+
+ public static void setHandler(DebugUIHandler handler) {
+ DebugMainWindow.handler = handler;
+ }
+
+ public static Stage getStage() {
+ return stage;
+ }
+
+ public static boolean isInitialized() {
+ return initialized;
+ }
+
+ @Override
+ public void start(Stage stage) throws IOException {
+
+ VBox root = FXMLLoader.load(getClass().getResource("/layout/debug/main.fxml"));
+ Scene scene = new Scene(root);
+ stage.setScene(scene);
+ stage.setTitle("Minosoft DebugUI");
+ stage.show();
+
+ // autoscroll for chat
+ ((TextArea) scene.lookup("#chat")).textProperty().addListener(new ChangeListener