diff --git a/.gitignore b/.gitignore
index 27221bb..46b1018 100644
--- a/.gitignore
+++ b/.gitignore
@@ -139,3 +139,4 @@ fabric.properties
# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser
+config.yml
\ No newline at end of file
diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml
index fdc392f..f5a0c5d 100644
--- a/.idea/jarRepositories.xml
+++ b/.idea/jarRepositories.xml
@@ -16,5 +16,10 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..94a25f7
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/build.gradle b/build.gradle
index a665050..ba3ff36 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,55 +1,38 @@
plugins {
id 'java'
id 'application'
- id 'org.openjfx.javafxplugin' version '0.0.10'
- id 'org.beryx.jlink' version '2.24.1'
}
group 'tech.nevets.jaml'
-version '1.0-SNAPSHOT'
+version '0.1.0'
repositories {
mavenCentral()
+ maven {
+ url 'https://jitpack.io'
+ }
}
-sourceCompatibility = '17'
-targetCompatibility = '17'
+sourceCompatibility = targetCompatibility = '17'
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
application {
- mainModule = 'tech.nevets.jaml.jaml'
- mainClass = 'tech.nevets.jaml.jaml.JAML'
-}
-
-javafx {
- version = '17.0.1'
- modules = ['javafx.controls', 'javafx.fxml', 'javafx.web']
+ mainModule = 'tech.nevets.jaml'
+ mainClass = 'tech.nevets.jaml.JAML'
}
dependencies {
- implementation('org.controlsfx:controlsfx:11.1.0')
- implementation('com.dlsc.formsfx:formsfx-core:11.3.2') {
- exclude(group: 'org.openjfx')
- }
- implementation('org.kordamp.ikonli:ikonli-javafx:12.2.0')
- implementation('org.kordamp.bootstrapfx:bootstrapfx-core:0.4.0')
- implementation('eu.hansolo:tilesfx:11.48') {
- exclude(group: 'org.openjfx')
- }
-
+ implementation 'me.carleslc.Simple-YAML:Simple-Yaml:1.7.3'
+ implementation 'com.google.code.gson:gson:2.9.0'
}
-jlink {
- imageZip = project.file("${buildDir}/distributions/app-${javafx.platform.classifier}.zip")
- options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages']
- launcher {
- name = 'app'
+jar {
+ manifest {
+ attributes(
+ 'Main-Class': 'tech.nevets.jaml.JAML'
+ )
}
-}
-
-jlinkZip {
- group = 'distribution'
}
\ No newline at end of file
diff --git a/config.yml b/config.yml
new file mode 100644
index 0000000..74e4b9f
--- /dev/null
+++ b/config.yml
@@ -0,0 +1,4 @@
+# If true, will print out all the messages
+verbose: false
+# Jaml version, don't change it!
+version: 0.1.0
diff --git a/src/main/java/module-info.java b/src/main/java/module-info.java
deleted file mode 100644
index 9eb3b24..0000000
--- a/src/main/java/module-info.java
+++ /dev/null
@@ -1,14 +0,0 @@
-module tech.nevets.jaml.jaml {
- requires javafx.controls;
- requires javafx.fxml;
- requires javafx.web;
-
- requires org.controlsfx.controls;
- requires com.dlsc.formsfx;
- requires org.kordamp.ikonli.javafx;
- requires org.kordamp.bootstrapfx.core;
- requires eu.hansolo.tilesfx;
-
- opens tech.nevets.jaml.jaml to javafx.fxml;
- exports tech.nevets.jaml.jaml;
-}
\ No newline at end of file
diff --git a/src/main/java/tech/nevets/jaml/Config.java b/src/main/java/tech/nevets/jaml/Config.java
new file mode 100644
index 0000000..9711aba
--- /dev/null
+++ b/src/main/java/tech/nevets/jaml/Config.java
@@ -0,0 +1,43 @@
+package tech.nevets.jaml;
+
+import org.simpleyaml.configuration.file.YamlFile;
+
+import java.io.IOException;
+
+public class Config {
+ private static final YamlFile ymlFile = new YamlFile(JAML.path + "\\config.yml");
+
+ public static void loadConfig() {
+ try {
+ if (!ymlFile.exists()) {
+ System.out.println("Config file not found, creating new one...");
+ ymlFile.createNewFile(true);
+ System.out.println("Config file created!");
+ } else {
+ System.out.println("Loading Config file...");
+ ymlFile.loadWithComments();
+ System.out.println("Config file loaded!");
+ }
+ } catch (final Exception e) {
+ System.out.println("Error while loading config file!");
+ e.printStackTrace();
+ }
+
+ ymlFile.addDefault("launcher.path","default");
+ ymlFile.setComment("launcher.path","Path to JAML files\n" + "default: %appdata%\\.jaml\\");
+ ymlFile.addDefault("launcher.verbose", false);
+ ymlFile.setComment("launcher.verbose", "If true, will print out all the messages");
+ ymlFile.addDefault("launcher.version", "0.1.0");
+ ymlFile.setComment("launcher.version", "Jaml version, don't change it!");
+
+ try {
+ ymlFile.save();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public static YamlFile getConfig() {
+ return ymlFile;
+ }
+}
diff --git a/src/main/java/tech/nevets/jaml/JAML.java b/src/main/java/tech/nevets/jaml/JAML.java
new file mode 100644
index 0000000..37d4441
--- /dev/null
+++ b/src/main/java/tech/nevets/jaml/JAML.java
@@ -0,0 +1,37 @@
+package tech.nevets.jaml;
+
+import org.simpleyaml.configuration.file.YamlFile;
+
+import java.nio.file.Path;
+
+public class JAML {
+ public static YamlFile config;
+ public static Path path;
+
+ public static void main(String[] args) {
+ makeDir();
+ Config.loadConfig();
+ config = Config.getConfig();
+
+ }
+
+ private static void makeDir() {
+ if (config == null) {
+ path = Path.of(System.getenv("APPDATA") + "\\.jaml\\");
+ } else {
+ if (config.getString("launcher.path") == "default") {
+ path = Path.of(System.getenv("APPDATA") + "\\.jaml\\");
+ } else {
+ path = Path.of(config.getString("launcher.path"));
+ }
+ }
+
+ try {
+ if (!path.toFile().exists()) {
+ path.toFile().mkdirs();
+ }
+ } catch (Exception e) {
+ System.out.println("Invalid path, please check your config.yml and try again");
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/tech/nevets/jaml/Profiles.java b/src/main/java/tech/nevets/jaml/Profiles.java
new file mode 100644
index 0000000..d47ffb5
--- /dev/null
+++ b/src/main/java/tech/nevets/jaml/Profiles.java
@@ -0,0 +1,22 @@
+package tech.nevets.jaml;
+
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+
+import java.nio.file.Path;
+
+public class Profiles {
+
+ public static void createProfile(String email, String hashedPassword, Path javaPath, Path gamePath, String version, Boolean onlineMode, String username) {
+ GsonBuilder builder = new GsonBuilder();
+ builder.setPrettyPrinting();
+ Gson gson = builder.create();
+
+ //TODO Create and save profiles
+
+ }
+
+ public static void loadProfile() {
+ //TODO Load Saved Profiles
+ }
+}
diff --git a/src/main/java/tech/nevets/jaml/jaml/Controller.java b/src/main/java/tech/nevets/jaml/jaml/Controller.java
deleted file mode 100644
index bddf8d2..0000000
--- a/src/main/java/tech/nevets/jaml/jaml/Controller.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package tech.nevets.jaml.jaml;
-
-import javafx.fxml.FXML;
-import javafx.scene.control.Label;
-
-public class Controller {
- @FXML
- private Label welcomeText;
-
- @FXML
- protected void onHelloButtonClick() {
- welcomeText.setText("Welcome to JavaFX Application!");
- }
-}
\ No newline at end of file
diff --git a/src/main/java/tech/nevets/jaml/jaml/JAML.java b/src/main/java/tech/nevets/jaml/jaml/JAML.java
deleted file mode 100644
index f75c9f8..0000000
--- a/src/main/java/tech/nevets/jaml/jaml/JAML.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package tech.nevets.jaml.jaml;
-
-import javafx.application.Application;
-import javafx.fxml.FXMLLoader;
-import javafx.scene.Scene;
-import javafx.stage.Stage;
-
-import java.io.IOException;
-
-public class JAML extends Application {
- @Override
- public void start(Stage stage) throws IOException {
- FXMLLoader fxmlLoader = new FXMLLoader(JAML.class.getResource("hello-view.fxml"));
- Scene scene = new Scene(fxmlLoader.load(), 320, 240);
- stage.setTitle("Hello!");
- stage.setScene(scene);
- stage.show();
- }
-
- public static void main(String[] args) {
- launch();
- }
-}
\ No newline at end of file
diff --git a/src/main/resources/tech/nevets/jaml/jaml/hello-view.fxml b/src/main/resources/tech/nevets/jaml/jaml/hello-view.fxml
deleted file mode 100644
index 8400704..0000000
--- a/src/main/resources/tech/nevets/jaml/jaml/hello-view.fxml
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-