From 2d8027cd28e81c70167905c790d804473b5b08f5 Mon Sep 17 00:00:00 2001 From: coolGi Date: Fri, 17 Mar 2023 19:45:18 +1030 Subject: [PATCH] Removed FlatLaf (which was used for theming) and replaced it with JavaFX --- Readme.md | 4 ++-- build.gradle | 20 +++++++++++--------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/Readme.md b/Readme.md index 5a20074ac..88a7c58e8 100644 --- a/Readme.md +++ b/Readme.md @@ -170,5 +170,5 @@ https://github.com/TheElectronWill/night-config SVG Salamander for SVG support\ https://github.com/blackears/svgSalamander -FlatLaf for theming (for development testing)\ -https://www.formdev.com/flatlaf/ +JavaFX for standalone jar and config ui\ +https://openjfx.io/ diff --git a/build.gradle b/build.gradle index 6ec2cbc65..5efdd2bd0 100644 --- a/build.gradle +++ b/build.gradle @@ -10,6 +10,9 @@ plugins { // Manifold preprocessor id "systems.manifold.manifold-gradle-plugin" version "0.0.2-alpha" + // JavaFX library (useful for ui stuff) + id "org.openjfx.javafxplugin" version "0.0.13" + // Provides mc libraries to core // id "org.spongepowered.gradle.vanilla" version '0.2.1-SNAPSHOT' apply false } @@ -102,6 +105,7 @@ subprojects { p -> // apply plugin: "org.spongepowered.gradle.vanilla" // Provides minecraft libraries if (p == project(":core")) { apply plugin: "application" + apply plugin: "org.openjfx.javafxplugin" } @@ -133,7 +137,12 @@ subprojects { p -> // (This will point to a non-existent class in all sub-projects except "Core") if (p == project(":core")) { application { - mainClass.set('com.seibel.lod.core.jar.JarMain') + mainClass.set("com.seibel.lod.core.jar.JarMain") + } + + javafx { + version = "19" + modules = ["javafx.controls"] } } @@ -166,11 +175,7 @@ subprojects { p -> shadowMe("com.electronwill.night-config:toml:${rootProject.nightconfig_version}") shadowMe("com.electronwill.night-config:json:${rootProject.nightconfig_version}") - // Theming - shadowMe("com.formdev:flatlaf:${rootProject.flatlaf_version}") - // SVG - shadowMe("com.formdev:flatlaf-extras:${rootProject.flatlaf_version}") shadowMe("com.formdev:svgSalamander:${rootProject.svgSalamander_version}") @@ -229,9 +234,6 @@ subprojects { p -> // NightConfig (includes Toml & Json) relocate 'com.electronwill.nightconfig', 'distanthorizons.libraries.electronwill.nightconfig' - // Theming - relocate 'com.formdev.flatlaf', 'distanthorizons.libraries.formdev.flatlaf' - // SVG relocate 'com.kitfox.svg', 'distanthorizons.libraries.kitfox.svg' @@ -448,7 +450,7 @@ allprojects { p -> tasks.withType(JavaCompile) { if (isMinecraftSubProject) { options.release = rootProject.java_version as Integer - options.compilerArgs += ['-Xplugin:Manifold'] + options.compilerArgs += ["-Xplugin:Manifold"] } else { options.release = 8; // Core & Api should use Java 8 no matter what //options.release = rootProject.java_version as Integer // But if you want to test some stuff, then this can be enabled