Merge branch 'development' of https://github.com/PTE-SH/ShadowHunterGame into development

This commit is contained in:
Paul Gross 2020-05-07 16:58:36 +02:00
commit 892dd6da73
6 changed files with 52 additions and 13 deletions

View File

@ -30,6 +30,8 @@ public class ParametreController implements Initializable {
private ComboBox<String> 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");
@ -95,6 +103,8 @@ public class ParametreController implements Initializable {
}
// Pour la couleur du theme
/*
@ -127,8 +137,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();

View File

@ -36,13 +36,9 @@ public class PauseController implements Initializable {
@Override
public void initialize(URL arg0, ResourceBundle arg1) {
if (MusiqueLancee == true) {
cbMusique.setSelected(true);
}
cbMusique.setSelected(ParametreController.cbMusiqueCoche);
cbEffet.setSelected(ParametreController.cbSonCoche);
if (SonLance == true) {
cbEffet.setSelected(true);
}
}
@ -103,6 +99,15 @@ 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 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);
@ -120,5 +125,6 @@ public class PauseController implements Initializable {
public void baisserVolume(MouseEvent mouseEvent) throws IOException{
Musique.volumeDown(5.f);
System.out.println("on baisse le son");
}
}

View File

@ -39,6 +39,7 @@ public class PlateauController implements Initializable {
@FXML private GridPane gridPaneVie;
@FXML public GridPane gridPaneLieux;
private ChoisirBoolean cb;
public static int DICE_SIX = 2;
@ -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);
@ -303,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();

View File

@ -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);
}
}

View File

@ -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);

View File

@ -164,6 +164,14 @@
<Insets top="20.0" />
</VBox.margin>
</Button>
<Button layoutX="283.0" layoutY="379.0" mnemonicParsing="false" onMouseClicked="#retour" prefHeight="55.0" prefWidth="247.0" styleClass="bouton" stylesheets="@style/menu.css" text="retour">
<font>
<Font size="24.0" />
</font>
<VBox.margin>
<Insets top="20.0" />
</VBox.margin>
</Button>
</children>
</VBox>
</center>