From 2eba98b240232410675d98453a06c118e1a60e7a Mon Sep 17 00:00:00 2001 From: Yessine Ben El Bey Date: Wed, 6 May 2020 16:19:16 +0200 Subject: [PATCH 1/5] Quitter plateau non fini --- src/ihm/controller/PauseController.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ihm/controller/PauseController.java b/src/ihm/controller/PauseController.java index 80ead1f..83e5299 100644 --- a/src/ihm/controller/PauseController.java +++ b/src/ihm/controller/PauseController.java @@ -99,10 +99,10 @@ 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(); + AnchorPane root = fxmlLoader.load(); */ } 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 2/5] 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 @@ + From a3ae506ee71b4af5c8222273cf78eaabcda6e8cd Mon Sep 17 00:00:00 2001 From: Yessine Ben El Bey Date: Thu, 7 May 2020 11:32:33 +0200 Subject: [PATCH 3/5] Fix pauseController --- src/ihm/controller/PauseController.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/ihm/controller/PauseController.java b/src/ihm/controller/PauseController.java index ad79e4f..c6b2a25 100644 --- a/src/ihm/controller/PauseController.java +++ b/src/ihm/controller/PauseController.java @@ -102,8 +102,7 @@ public class PauseController implements Initializable { System.err.println("Fin de partie"); Stage appStage = (Stage) ((Node) me.getSource()).getScene().getWindow(); appStage.close(); -<<<<<<< HEAD - + /* 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); @@ -111,7 +110,7 @@ public class PauseController implements Initializable { -======= + final URL fxmlURL = getClass().getResource("/ihm/ressources/Menu.fxml"); final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", Locale.FRENCH); @@ -130,6 +129,6 @@ public class PauseController implements Initializable { public void baisserVolume(MouseEvent mouseEvent) throws IOException{ Musique.volumeDown(5.f); System.out.println("on baisse le son"); ->>>>>>> 9fca28f7bb31a2ae6de169307adf781247bc61a4 + } } From 6f6c2af60829e936dfcc65e5e586eaa7eb95b4cf Mon Sep 17 00:00:00 2001 From: Kruss Date: Thu, 7 May 2020 14:05:14 +0200 Subject: [PATCH 4/5] changements pour executable --- src/ihm/controller/PlateauController.java | 2 +- src/ihm/controller/ReglesControlleur.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ihm/controller/PlateauController.java b/src/ihm/controller/PlateauController.java index 764b13d..a850dc6 100644 --- a/src/ihm/controller/PlateauController.java +++ b/src/ihm/controller/PlateauController.java @@ -306,7 +306,7 @@ public class PlateauController implements Initializable { EffetSonore.playSoundEffect(fileSound1); System.out.println("Jeu en pause ..."); - final URL fxmlURL = getClass().getResource("../ressources/Pause.fxml"); + final URL fxmlURL = getClass().getResource("/ihm/ressources/Pause.fxml"); final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", Locale.FRANCE); final FXMLLoader fxmlLoader = new FXMLLoader(fxmlURL, bundle); Pane root = (Pane)fxmlLoader.load(); diff --git a/src/ihm/controller/ReglesControlleur.java b/src/ihm/controller/ReglesControlleur.java index 614bf3e..ff02fa9 100644 --- a/src/ihm/controller/ReglesControlleur.java +++ b/src/ihm/controller/ReglesControlleur.java @@ -31,7 +31,7 @@ public class ReglesControlleur implements Initializable { @Override public void initialize(URL arg0, ResourceBundle arg1) { - InputStream input = getClass().getResourceAsStream("/ihm/ressources/img/Regle1.png"); + InputStream input = getClass().getResourceAsStream("/ihm/ressources/img/Regle1.PNG"); Image image = new Image(input); imageRegles.setImage(image); @@ -51,7 +51,7 @@ public class ReglesControlleur implements Initializable { System.out.println("C'est la dernière page!"); } - InputStream input = getClass().getResourceAsStream("/ihm/ressources/img/Regle" + index + ".png"); + InputStream input = getClass().getResourceAsStream("/ihm/ressources/img/Regle" + index + ".PNG"); Image image = new Image(input); imageRegles.setImage(image); @@ -71,7 +71,7 @@ public class ReglesControlleur implements Initializable { System.out.println("C'est la première page!"); } - InputStream input = getClass().getResourceAsStream("/ihm/ressources/img/Regle" + index + ".png"); + InputStream input = getClass().getResourceAsStream("/ihm/ressources/img/Regle" + index + ".PNG"); Image image = new Image(input); imageRegles.setImage(image); From a2bc3f1dd41abfa03dfe67c67a42f4bde0e48e49 Mon Sep 17 00:00:00 2001 From: Yessine Ben El Bey Date: Thu, 7 May 2020 14:46:01 +0200 Subject: [PATCH 5/5] =?UTF-8?q?Param=C3=A8tre=20mettre=20les=20cases=20coc?= =?UTF-8?q?h=C3=A9s=20et=20controllerPause=20mettre=20les=20cases=20coch?= =?UTF-8?q?=C3=A9s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ihm/controller/ParametreController.java | 8 ++++++++ src/ihm/controller/PauseController.java | 10 +++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/ihm/controller/ParametreController.java b/src/ihm/controller/ParametreController.java index 81eeadd..8f2bf6d 100644 --- a/src/ihm/controller/ParametreController.java +++ b/src/ihm/controller/ParametreController.java @@ -30,6 +30,8 @@ public class ParametreController implements Initializable { private ComboBox langues; public static boolean cbMusiqueCoche = false; // verifi si la checbox musical est coche public static boolean cbSonCoche = false; + public static boolean cbClair = false; + boolean MusiqueLancee = false; //verifi si la musique a déja été lancé une première fois String filepathMusique = "/ihm/ressources/musique/The_Red_Fox_Tavern.wav"; // lien vers la musique : https://www.youtube.com/watch?v=LBpKUIyOHdo @@ -43,6 +45,12 @@ public class ParametreController implements Initializable { @Override public void initialize(URL arg0, ResourceBundle arg1) { + cmusique.setSelected(cbMusiqueCoche); + cbEffetSonore.setSelected(cbSonCoche); + clair.setSelected(cbClair); + + + langues.getItems().add("Anglais"); langues.getItems().add("Allemand"); langues.getItems().add("Espagnol"); diff --git a/src/ihm/controller/PauseController.java b/src/ihm/controller/PauseController.java index c6b2a25..51cb9c4 100644 --- a/src/ihm/controller/PauseController.java +++ b/src/ihm/controller/PauseController.java @@ -36,14 +36,10 @@ public class PauseController implements Initializable { @Override public void initialize(URL arg0, ResourceBundle arg1) { - if (MusiqueLancee == true) { - cbMusique.setSelected(true); - } - - if (SonLance == true) { - cbEffet.setSelected(true); - } + cbMusique.setSelected(ParametreController.cbMusiqueCoche); + cbEffet.setSelected(ParametreController.cbSonCoche); + } @FXML