diff --git a/src/ihm/controller/PlayersController.java b/src/ihm/controller/PlayersController.java index 3019c84..cd0385e 100644 --- a/src/ihm/controller/PlayersController.java +++ b/src/ihm/controller/PlayersController.java @@ -216,6 +216,9 @@ public class PlayersController implements Initializable{ } @FXML public void retour(MouseEvent me) throws IOException { + InputStream fileSound1 = getClass().getResourceAsStream("/ihm/ressources/musique/BEEP1.wav"); + EffetSonore.playSoundEffect(fileSound1); + final URL fxmlURL = getClass().getResource("/ihm/ressources/Menu.fxml"); final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", Locale.FRANCE); diff --git a/src/ihm/controller/ReglesControlleur.java b/src/ihm/controller/ReglesControlleur.java index ff02fa9..8220e7a 100644 --- a/src/ihm/controller/ReglesControlleur.java +++ b/src/ihm/controller/ReglesControlleur.java @@ -12,11 +12,11 @@ import javafx.fxml.FXMLLoader; import javafx.fxml.Initializable; import javafx.scene.Node; import javafx.scene.Scene; +import javafx.scene.control.Button; import javafx.scene.image.Image; import javafx.scene.image.ImageView; import javafx.scene.input.MouseEvent; import javafx.scene.layout.AnchorPane; -import javafx.scene.layout.Pane; import javafx.stage.Stage; public class ReglesControlleur implements Initializable { @@ -25,6 +25,10 @@ public class ReglesControlleur implements Initializable { private AnchorPane rootPane; @FXML private ImageView imageRegles; + @FXML + private Button precedent; + @FXML + private Button suivant; private int index = 1; @@ -34,6 +38,8 @@ public class ReglesControlleur implements Initializable { InputStream input = getClass().getResourceAsStream("/ihm/ressources/img/Regle1.PNG"); Image image = new Image(input); imageRegles.setImage(image); + suivant.setVisible(true); + precedent.setVisible(false); } @@ -41,14 +47,18 @@ public class ReglesControlleur implements Initializable { public void pageSuivante(MouseEvent mouseEvent) throws IOException { if (index < 4) { + + if (index == 3) { + suivant.setVisible(false); + } else { + suivant.setVisible(true); + } + + precedent.setVisible(true); index++; InputStream fileSound1 = getClass().getResourceAsStream("/ihm/ressources/musique/BEEP1.wav"); EffetSonore.playSoundEffect(fileSound1); System.out.println("Page suivante"); - } else { - InputStream fileSound2 = getClass().getResourceAsStream("/ihm/ressources/musique/BeepError.wav"); - EffetSonore.playSoundEffect(fileSound2); - System.out.println("C'est la dernière page!"); } InputStream input = getClass().getResourceAsStream("/ihm/ressources/img/Regle" + index + ".PNG"); @@ -61,14 +71,19 @@ public class ReglesControlleur implements Initializable { public void pagePrecedente(MouseEvent mouseEvent) throws IOException { if (index > 1) { + + if (index == 2) { + precedent.setVisible(false); + } else { + precedent.setVisible(true); + } + index--; + suivant.setVisible(true); InputStream fileSound1 = getClass().getResourceAsStream("/ihm/ressources/musique/BEEP1.wav"); EffetSonore.playSoundEffect(fileSound1); + System.out.println("Page précédente"); - } else { - InputStream fileSound2 = getClass().getResourceAsStream("/ihm/ressources/musique/BeepError.wav"); - EffetSonore.playSoundEffect(fileSound2); - System.out.println("C'est la première page!"); } InputStream input = getClass().getResourceAsStream("/ihm/ressources/img/Regle" + index + ".PNG"); diff --git a/src/ihm/ressources/Regles.fxml b/src/ihm/ressources/Regles.fxml index 9990be8..7c852e6 100644 --- a/src/ihm/ressources/Regles.fxml +++ b/src/ihm/ressources/Regles.fxml @@ -19,7 +19,7 @@ - -