From ce4a6bfeac4ffff3c6d9335a5a7979dbc7661f51 Mon Sep 17 00:00:00 2001 From: Yessine Ben El Bey Date: Thu, 7 May 2020 11:28:01 +0200 Subject: [PATCH] Bouton retour joueur --- src/ihm/controller/ParametreController.java | 5 ++++- src/ihm/controller/PauseController.java | 3 ++- src/ihm/controller/PlateauController.java | 5 ++++- src/ihm/controller/PlayersController.java | 11 +++++++++++ src/ihm/ressources/Choix_joueur.fxml | 8 ++++++++ 5 files changed, 29 insertions(+), 3 deletions(-) diff --git a/src/ihm/controller/ParametreController.java b/src/ihm/controller/ParametreController.java index 83a9f2b..e151be0 100644 --- a/src/ihm/controller/ParametreController.java +++ b/src/ihm/controller/ParametreController.java @@ -91,6 +91,8 @@ public class ParametreController implements Initializable { System.out.println(EffetSonore.isSoundOK()); } + + // Pour la couleur du theme @@ -124,8 +126,9 @@ public class ParametreController implements Initializable { EffetSonore.playSoundEffect(fileSound1); //emet un bruit sur le bouton si les effets sonores sont activés // Quitter les paramètres - final URL fxmlURL = getClass().getResource("/ihm/ressources/Menu.fxml"); + final URL fxmlURL = getClass().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(); diff --git a/src/ihm/controller/PauseController.java b/src/ihm/controller/PauseController.java index 83e5299..b3e7e30 100644 --- a/src/ihm/controller/PauseController.java +++ b/src/ihm/controller/PauseController.java @@ -99,10 +99,11 @@ public class PauseController implements Initializable { Stage appStage = (Stage) ((Node) me.getSource()).getScene().getWindow(); appStage.close(); - /* final URL fxmlURL = getClass().getResource("/ihm/ressources/Menu.fxml"); +/* 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(); */ + } diff --git a/src/ihm/controller/PlateauController.java b/src/ihm/controller/PlateauController.java index 84e6c05..764b13d 100644 --- a/src/ihm/controller/PlateauController.java +++ b/src/ihm/controller/PlateauController.java @@ -38,6 +38,7 @@ public class PlateauController implements Initializable { @FXML private AnchorPane rootPane; @FXML private GridPane gridPaneVie; @FXML public GridPane gridPaneLieux; + private ChoisirBoolean cb; @@ -51,7 +52,7 @@ public class PlateauController implements Initializable { @Override public void initialize(URL arg0, ResourceBundle arg1) { //System.out.println("Création du plateau ..."); - + this.joueursIHM = new ArrayList(); GestionnaireJeu gj = GestionnaireJeu.getGestionnaireJeu(); Map map = gj.getMapJoueurs(); @@ -61,6 +62,7 @@ public class PlateauController implements Initializable { Pane p = (Pane) gridPaneVie.getChildren().get(i); Label l = (Label) p.getChildren().get(1); l.setText(i+""); + } for(int i : map.keySet()) { @@ -159,6 +161,7 @@ public class PlateauController implements Initializable { } + private Pane getPaneJoueur(int i) { System.out.println("i "+i); diff --git a/src/ihm/controller/PlayersController.java b/src/ihm/controller/PlayersController.java index 09c7a28..3019c84 100644 --- a/src/ihm/controller/PlayersController.java +++ b/src/ihm/controller/PlayersController.java @@ -23,6 +23,7 @@ import javafx.scene.control.TextField; import javafx.scene.input.MouseEvent; import javafx.scene.layout.AnchorPane; import javafx.scene.layout.HBox; +import javafx.scene.layout.Pane; import javafx.stage.Stage; import main.Configuration; import main.GestionnaireJeu; @@ -213,4 +214,14 @@ public class PlayersController implements Initializable{ }else enleverJoueur(indice); } + @FXML + public void retour(MouseEvent me) throws IOException { + final URL fxmlURL = getClass().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); + } } diff --git a/src/ihm/ressources/Choix_joueur.fxml b/src/ihm/ressources/Choix_joueur.fxml index 9b897d3..0a48196 100644 --- a/src/ihm/ressources/Choix_joueur.fxml +++ b/src/ihm/ressources/Choix_joueur.fxml @@ -164,6 +164,14 @@ +