impl bouton quitter jeu

This commit is contained in:
Kruss 2020-05-12 09:40:11 +02:00
parent 0f0dc65d3e
commit 7a689e6007
4 changed files with 13 additions and 16 deletions

View File

@ -3,7 +3,6 @@ package ihm.controller;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.Locale;
import java.util.ResourceBundle;
import ihm.EffetSonore;

View File

@ -117,21 +117,10 @@ public class PauseController implements Initializable {
EffetSonore.playSoundEffect(fileSound1);
GestionnaireJeu.endGame();
System.err.println("Fin de partie");
PlateauController platcontr = GestionnaireJeu.pc;
Stage appStage = (Stage) ((Node) me.getSource()).getScene().getWindow();
appStage.close();
/*
* final URL fxmlURL = getClass().getResource("/ihm/ressources/Menu.fxml");
* final ResourceBundle bundle =
* ResourceBundle.getBundle("domaine.properties.langue", Locale.FRENCH); final
* FXMLLoader fxmlLoader = new FXMLLoader(fxmlURL, bundle); AnchorPane root =
* fxmlLoader.load();
*/
final URL fxmlURL = getClass().getResource("/ihm/ressources/Menu.fxml");
final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", Locale.FRENCH);
final FXMLLoader fxmlLoader = new FXMLLoader(fxmlURL, bundle);
AnchorPane root = fxmlLoader.load();
platcontr.close();
}

View File

@ -50,7 +50,6 @@ public class PlateauController implements Initializable {
@FXML private GridPane gridPaneVie;
@FXML public GridPane gridPaneLieux;
private ChoisirBoolean cb;
private ChoisirEquipement ce;
private ChoisirJoueur cj;
@ -464,6 +463,16 @@ public class PlateauController implements Initializable {
jihm.retirerEquipement(e);
}
public void close () throws IOException {
final URL fxmlURL = PlateauController.class.getResource("/ihm/ressources/Menu.fxml");
final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", Locale.FRANCE);
final FXMLLoader fxmlLoader = new FXMLLoader(fxmlURL, bundle);
Pane pane = fxmlLoader.load();
rootPane.getChildren().setAll(pane);
}

View File

@ -24,7 +24,7 @@ public class GestionnaireJeu {
private RessourceLoader ressourceLoader;
private static Plateau plateau;
private static PlateauController pc;
public static PlateauController pc;
private GestionnaireJeu() {}