From c2958e403b2e4dd00af7a83cf42a38b05ef787ec Mon Sep 17 00:00:00 2001 From: andrewlalis Date: Fri, 15 Jul 2022 13:00:14 +0200 Subject: [PATCH] Added launcher base javafx code. --- launcher/README.md | 4 ++ launcher/pom.xml | 53 +++++++++++++++++++ launcher/src/main/java/module-info.java | 9 ++++ .../nl/andrewl/aos2_launcher/Launcher.java | 29 ++++++++++ .../aos2_launcher/MainViewController.java | 11 ++++ launcher/src/main/resources/main_view.fxml | 24 +++++++++ launcher/src/main/resources/styles.css | 0 7 files changed, 130 insertions(+) create mode 100644 launcher/README.md create mode 100644 launcher/pom.xml create mode 100644 launcher/src/main/java/module-info.java create mode 100644 launcher/src/main/java/nl/andrewl/aos2_launcher/Launcher.java create mode 100644 launcher/src/main/java/nl/andrewl/aos2_launcher/MainViewController.java create mode 100644 launcher/src/main/resources/main_view.fxml create mode 100644 launcher/src/main/resources/styles.css diff --git a/launcher/README.md b/launcher/README.md new file mode 100644 index 0000000..6289ccc --- /dev/null +++ b/launcher/README.md @@ -0,0 +1,4 @@ +# AoS2 Launcher +The launcher is a standalone application that can be installed on a client's computer, to make starting the client program easier. Since the client boots up and directly connects to a server via command-line arguments, everything before that is managed by the launcher, like finding a server, choosing a nickname, etc. + +This is a JavaFX application. diff --git a/launcher/pom.xml b/launcher/pom.xml new file mode 100644 index 0000000..38b3094 --- /dev/null +++ b/launcher/pom.xml @@ -0,0 +1,53 @@ + + + 4.0.0 + + nl.andrewl + aos2-launcher + 1.0-SNAPSHOT + + + 18 + 18 + 18.0.1 + 0.0.8 + + + + + org.openjfx + javafx-controls + ${javafx.version} + + + org.openjfx + javafx-fxml + ${javafx.version} + + + + + + + org.openjfx + javafx-maven-plugin + ${javafx.maven.plugin.version} + + nl.andrewl.aos2_launcher.Launcher + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.10.1 + + 17 + 17 + + + + + + \ No newline at end of file diff --git a/launcher/src/main/java/module-info.java b/launcher/src/main/java/module-info.java new file mode 100644 index 0000000..5edf66c --- /dev/null +++ b/launcher/src/main/java/module-info.java @@ -0,0 +1,9 @@ +module aos2_launcher { + requires javafx.base; + requires javafx.controls; + requires javafx.graphics; + requires javafx.fxml; + + exports nl.andrewl.aos2_launcher to javafx.graphics; + opens nl.andrewl.aos2_launcher to javafx.fxml; +} \ No newline at end of file diff --git a/launcher/src/main/java/nl/andrewl/aos2_launcher/Launcher.java b/launcher/src/main/java/nl/andrewl/aos2_launcher/Launcher.java new file mode 100644 index 0000000..bce8874 --- /dev/null +++ b/launcher/src/main/java/nl/andrewl/aos2_launcher/Launcher.java @@ -0,0 +1,29 @@ +package nl.andrewl.aos2_launcher; + +import javafx.application.Application; +import javafx.fxml.FXMLLoader; +import javafx.scene.Parent; +import javafx.scene.Scene; +import javafx.stage.Stage; + +import java.io.IOException; + +/** + * The main starting point for the launcher app. + */ +public class Launcher extends Application { + @Override + public void start(Stage stage) throws IOException { + FXMLLoader loader = new FXMLLoader(Launcher.class.getResource("/main_view.fxml")); + Parent rootNode = loader.load(); + Scene scene = new Scene(rootNode); + scene.getStylesheets().add(Launcher.class.getResource("/styles.css").toExternalForm()); + stage.setScene(scene); + stage.setTitle("Ace of Shades 2 - Launcher"); + stage.show(); + } + + public static void main(String[] args) { + launch(args); + } +} diff --git a/launcher/src/main/java/nl/andrewl/aos2_launcher/MainViewController.java b/launcher/src/main/java/nl/andrewl/aos2_launcher/MainViewController.java new file mode 100644 index 0000000..c391b7f --- /dev/null +++ b/launcher/src/main/java/nl/andrewl/aos2_launcher/MainViewController.java @@ -0,0 +1,11 @@ +package nl.andrewl.aos2_launcher; + +import javafx.fxml.FXML; +import javafx.scene.layout.TilePane; + +public class MainViewController { + @FXML + public TilePane profilesTilePane; + + +} diff --git a/launcher/src/main/resources/main_view.fxml b/launcher/src/main/resources/main_view.fxml new file mode 100644 index 0000000..4940176 --- /dev/null +++ b/launcher/src/main/resources/main_view.fxml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/launcher/src/main/resources/styles.css b/launcher/src/main/resources/styles.css new file mode 100644 index 0000000..e69de29