possibilité d'accéder aux regles depuis le menu pause
This commit is contained in:
parent
57376feddb
commit
0cb58a15aa
@ -91,15 +91,15 @@ public class ParametreController implements Initializable {
|
|||||||
LaLangue = Locale.FRANCE;
|
LaLangue = Locale.FRANCE;
|
||||||
langueChoisi = tabLangues[3];
|
langueChoisi = tabLangues[3];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pour la musique
|
// Pour la musique
|
||||||
if (fileMusique != null) {
|
if (fileMusique != null) {
|
||||||
|
|
||||||
if (cmusique.isSelected() == true) {
|
if (cmusique.isSelected() == true) {
|
||||||
cbMusiqueCoche = true;
|
cbMusiqueCoche = true;
|
||||||
|
|
||||||
//si lamusique n'a jamais été lancé:
|
// si la musique n'a jamais été lancé:
|
||||||
if (Musique.clipTimePosition == 0 && MusiqueLancee == false && Musique.musiqueEnCours != true) {
|
if (Musique.clipTimePosition == 0 && MusiqueLancee == false && Musique.musiqueEnCours != true) {
|
||||||
Musique.playMusique(fileMusique);
|
Musique.playMusique(fileMusique);
|
||||||
Musique.musiqueEnCours = true;
|
Musique.musiqueEnCours = true;
|
||||||
MusiqueLancee = true;
|
MusiqueLancee = true;
|
||||||
@ -164,11 +164,11 @@ public class ParametreController implements Initializable {
|
|||||||
* }
|
* }
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// Quitter les paramètres
|
||||||
EffetSonore.playSoundEffect(fileSound1); // emet un bruit sur le bouton si les effets sonores sont activés
|
EffetSonore.playSoundEffect(fileSound1); // emet un bruit sur le bouton si les effets sonores sont activés
|
||||||
|
|
||||||
System.out.println("slidevalueeffet enregistre = " + slideValueEffets);
|
System.out.println("slidevalueeffet enregistre = " + slideValueEffets);
|
||||||
|
|
||||||
// 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",
|
final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue",
|
||||||
ParametreController.LaLangue);
|
ParametreController.LaLangue);
|
||||||
|
@ -12,6 +12,8 @@ import javafx.fxml.FXML;
|
|||||||
import javafx.fxml.FXMLLoader;
|
import javafx.fxml.FXMLLoader;
|
||||||
import javafx.fxml.Initializable;
|
import javafx.fxml.Initializable;
|
||||||
import javafx.scene.Node;
|
import javafx.scene.Node;
|
||||||
|
import javafx.scene.Scene;
|
||||||
|
import javafx.scene.control.Button;
|
||||||
import javafx.scene.control.CheckBox;
|
import javafx.scene.control.CheckBox;
|
||||||
import javafx.scene.control.Slider;
|
import javafx.scene.control.Slider;
|
||||||
import javafx.scene.input.MouseEvent;
|
import javafx.scene.input.MouseEvent;
|
||||||
@ -28,6 +30,9 @@ public class PauseController implements Initializable {
|
|||||||
private Slider sliderMusiquePause;
|
private Slider sliderMusiquePause;
|
||||||
@FXML
|
@FXML
|
||||||
private Slider sliderEffetsPause;
|
private Slider sliderEffetsPause;
|
||||||
|
@FXML
|
||||||
|
private Button reglesPause;
|
||||||
|
|
||||||
|
|
||||||
String filepathMusique = "src//ihm//ressources//musique//The_Red_Fox_Tavern.wav";
|
String filepathMusique = "src//ihm//ressources//musique//The_Red_Fox_Tavern.wav";
|
||||||
InputStream fileMusique = getClass().getResourceAsStream("/ihm/ressources/musique/The_Red_Fox_Tavern.wav");
|
InputStream fileMusique = getClass().getResourceAsStream("/ihm/ressources/musique/The_Red_Fox_Tavern.wav");
|
||||||
@ -142,6 +147,24 @@ public class PauseController implements Initializable {
|
|||||||
slideValueEffetPause = sliderEffetsPause.getValue();
|
slideValueEffetPause = sliderEffetsPause.getValue();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
public void afficherReglePause(MouseEvent mouseEvent) throws IOException {
|
||||||
|
|
||||||
|
InputStream fileSound1 = getClass().getResourceAsStream("/ihm/ressources/musique/BEEP1.wav");
|
||||||
|
|
||||||
|
EffetSonore.playSoundEffect(fileSound1);
|
||||||
|
System.out.println("Passage à l'écran des règles");
|
||||||
|
final URL fxmlURL = getClass().getResource("/ihm/ressources/ReglesPause.fxml");
|
||||||
|
final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", ParametreController.LaLangue);
|
||||||
|
final FXMLLoader fxmlLoader = new FXMLLoader(fxmlURL, bundle);
|
||||||
|
AnchorPane pane = fxmlLoader.load();
|
||||||
|
Scene scene = new Scene(pane);
|
||||||
|
Stage appStage = (Stage) ((Node) mouseEvent.getSource()).getScene().getWindow();
|
||||||
|
appStage.setScene(scene);
|
||||||
|
appStage.show();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@FXML
|
@FXML
|
||||||
|
@ -110,4 +110,17 @@ public class ReglesControlleur implements Initializable {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
public void retourEnJeu(MouseEvent me) throws IOException {
|
||||||
|
|
||||||
|
InputStream fileSound1 = getClass().getResourceAsStream("/ihm/ressources/musique/BEEP1.wav");
|
||||||
|
|
||||||
|
EffetSonore.playSoundEffect(fileSound1);
|
||||||
|
System.out.println("Retour au jeu");
|
||||||
|
|
||||||
|
Stage appStage = (Stage) ((Node) me.getSource()).getScene().getWindow();
|
||||||
|
appStage.close();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -69,6 +69,14 @@
|
|||||||
<Slider fx:id="sliderEffetsPause" blockIncrement="1.0" majorTickUnit="1.0" max="0.0" min="-20.0" minorTickCount="10" onMouseClicked="#slideVolumeEffets" prefHeight="14.0" prefWidth="194.0" />
|
<Slider fx:id="sliderEffetsPause" blockIncrement="1.0" majorTickUnit="1.0" max="0.0" min="-20.0" minorTickCount="10" onMouseClicked="#slideVolumeEffets" prefHeight="14.0" prefWidth="194.0" />
|
||||||
</children>
|
</children>
|
||||||
</HBox>
|
</HBox>
|
||||||
|
<Button fx:id="règlesPause" mnemonicParsing="false" onMouseClicked="#afficherReglePause" text="Règles">
|
||||||
|
<font>
|
||||||
|
<Font size="14.0" />
|
||||||
|
</font>
|
||||||
|
<VBox.margin>
|
||||||
|
<Insets top="30.0" />
|
||||||
|
</VBox.margin>
|
||||||
|
</Button>
|
||||||
<Label style="-fx-border-width: 0 0 0.5 0; -fx-border-color: #e2e2e2;" text="Jeux">
|
<Label style="-fx-border-width: 0 0 0.5 0; -fx-border-color: #e2e2e2;" text="Jeux">
|
||||||
<VBox.margin>
|
<VBox.margin>
|
||||||
<Insets top="50.0" />
|
<Insets top="50.0" />
|
||||||
|
51
src/ihm/ressources/ReglesPause.fxml
Normal file
51
src/ihm/ressources/ReglesPause.fxml
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<?import javafx.geometry.Insets?>
|
||||||
|
<?import javafx.scene.control.Button?>
|
||||||
|
<?import javafx.scene.image.ImageView?>
|
||||||
|
<?import javafx.scene.layout.AnchorPane?>
|
||||||
|
<?import javafx.scene.layout.HBox?>
|
||||||
|
<?import javafx.scene.layout.VBox?>
|
||||||
|
<?import javafx.scene.text.Font?>
|
||||||
|
|
||||||
|
<AnchorPane fx:id="rootPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="800.0" prefWidth="1280.0" styleClass="background" stylesheets="@style/plateau.css" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ihm.controller.ReglesControlleur">
|
||||||
|
<children>
|
||||||
|
<VBox alignment="CENTER" layoutX="-3.0" layoutY="-7.0" prefHeight="802.0" prefWidth="1290.0">
|
||||||
|
<children>
|
||||||
|
<ImageView fx:id="imageRegles" fitHeight="654.0" fitWidth="528.0" pickOnBounds="true" preserveRatio="true">
|
||||||
|
<VBox.margin>
|
||||||
|
<Insets />
|
||||||
|
</VBox.margin>
|
||||||
|
</ImageView>
|
||||||
|
<HBox alignment="CENTER" prefHeight="100.0" prefWidth="200.0">
|
||||||
|
<children>
|
||||||
|
<Button fx:id="precedent" layoutX="519.0" layoutY="31.0" mnemonicParsing="false" onMouseClicked="#pagePrecedente" prefHeight="59.0" prefWidth="225.0" styleClass="bouton" text="Page précédente">
|
||||||
|
<font>
|
||||||
|
<Font size="24.0" />
|
||||||
|
</font>
|
||||||
|
<HBox.margin>
|
||||||
|
<Insets right="20.0" />
|
||||||
|
</HBox.margin>
|
||||||
|
</Button>
|
||||||
|
<Button mnemonicParsing="false" onMouseClicked="#retourEnJeu" prefHeight="59.0" prefWidth="117.0" styleClass="bouton" text="Retour">
|
||||||
|
<font>
|
||||||
|
<Font size="24.0" />
|
||||||
|
</font>
|
||||||
|
<HBox.margin>
|
||||||
|
<Insets left="20.0" right="20.0" />
|
||||||
|
</HBox.margin>
|
||||||
|
</Button>
|
||||||
|
<Button fx:id="suivant" mnemonicParsing="false" onMouseClicked="#pageSuivante" prefHeight="59.0" prefWidth="195.0" styleClass="bouton" text="Page suivante">
|
||||||
|
<font>
|
||||||
|
<Font size="24.0" />
|
||||||
|
</font>
|
||||||
|
<HBox.margin>
|
||||||
|
<Insets left="20.0" />
|
||||||
|
</HBox.margin>
|
||||||
|
</Button>
|
||||||
|
</children>
|
||||||
|
</HBox>
|
||||||
|
</children>
|
||||||
|
</VBox>
|
||||||
|
</children>
|
||||||
|
</AnchorPane>
|
Loading…
x
Reference in New Issue
Block a user