jeu-de-combat/src/launcher/Launcher.java
François Autin 85b48c40d4
Massive improvements to launcher
Launcher is now capable of closing itself, launching the engine and  has
a saner launcher.fxml
2021-06-03 00:47:49 +02:00

66 lines
1.3 KiB
Java

/**
* CLASS LAUNCHER
*
* Fenêtre de configuration du jeu préalablement au lancement d'une partie
*
* @author François Autin
*
*/
package launcher;
import javafx.application.Application;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
import javafx.fxml.*;
import engine.Engine;
public class Launcher extends Application {
public static Launcher pointer;
private static Settings setter;
public Launcher() {
pointer = this;
try {
setter = new Settings();
} catch (Exception e) {
e.printStackTrace();
System.exit(1);
}
}
/*
* Start method is used by Launcher as an implementation of the Application class to create a JavaFX thread to display the GUI window
*/
public void start(Stage primaryStage) throws Exception {
Parent root = FXMLLoader.load(getClass().getResource("/launcher/ui/launcher.fxml"));
Scene main = new Scene(root);
//primaryStage.initStyle(StageStyle.UNDECORATED);
primaryStage.setTitle("Boulevard Combattant");
primaryStage.setScene(main);
primaryStage.show();
}
public static void runGame() {
try {
setter.setSettings();
} catch (Exception e) {
e.printStackTrace();
System.exit(1);
}
Engine.main(null);
}
public static void openSettings() {
}
}