From c1751ce394bf05888b642146cf571748005e3a2f Mon Sep 17 00:00:00 2001 From: Chiara Date: Thu, 23 Apr 2020 15:36:36 +0200 Subject: [PATCH 1/2] interfaces jouer tour --- src/ihm/Main.java | 3 +- .../controller/JouerSonTour1Controller.java | 11 ++- .../controller/JouerSonTour2Controller.java | 12 +-- .../controller/JouerSonTour3Controller.java | 19 ++-- src/ihm/controller/PlateauController.java | 4 +- src/ihm/controller/PlayersController.java | 1 - .../Jouer_son_tour_donner_vision.fxml | 98 ------------------- .../Jouer_son_tour_piocher_vision.fxml | 46 --------- .../Jouer_son_tour_vision_inefficace.fxml | 20 ---- .../ressources/Jouer_tour(1)lancer_des.fxml | 37 +++++++ .../ressources/Jouer_tour(2)carte_lieux.fxml | 26 +++++ .../Jouer_tour(2a)voler_equipement.fxml | 20 ++++ .../Jouer_tour(2b)piocher_carte.fxml | 15 +++ ...uer_tour(2ba)piocher_lumiere_tenebre.fxml} | 12 +-- .../Jouer_tour(2bb1)piocher_vision.fxml | 34 +++++++ .../Jouer_tour(2bb2)donne_carte_vision.fxml | 49 ++++++++++ .../Jouer_tour(2bb3)recevoir_vision.fxml | 34 +++++++ .../Jouer_tour(2c)attaquer_soigner.fxml | 20 ++++ src/ihm/ressources/Jouer_tour(3)attaquer.fxml | 18 ++++ .../ressources/Jouer_tour(4)des_attaquer.fxml | 42 ++++++++ ...evoir_blessure.fxml => Jouer_tour(5).fxml} | 4 +- src/ihm/ressources/Reveler_son_identite.fxml | 17 ++-- src/ihm/ressources/afficher_carte_perso.fxml | 7 +- src/ihm/ressources/jouerSonTour1.fxml | 34 ------- src/ihm/ressources/jouerSonTour2.fxml | 21 ---- src/ihm/ressources/jouerSonTour3.fxml | 34 ------- src/ihm/ressources/jouerSonTour4.fxml | 39 -------- src/ihm/ressources/jouerSonTour5.fxml | 89 ----------------- src/ihm/ressources/jouerSonTour6.fxml | 29 ------ src/ihm/ressources/jouerSonTour7.fxml | 35 ------- src/ihm/ressources/style/popUp.css | 20 ++++ 31 files changed, 364 insertions(+), 486 deletions(-) delete mode 100644 src/ihm/ressources/Jouer_son_tour_donner_vision.fxml delete mode 100644 src/ihm/ressources/Jouer_son_tour_piocher_vision.fxml delete mode 100644 src/ihm/ressources/Jouer_son_tour_vision_inefficace.fxml create mode 100644 src/ihm/ressources/Jouer_tour(1)lancer_des.fxml create mode 100644 src/ihm/ressources/Jouer_tour(2)carte_lieux.fxml create mode 100644 src/ihm/ressources/Jouer_tour(2a)voler_equipement.fxml create mode 100644 src/ihm/ressources/Jouer_tour(2b)piocher_carte.fxml rename src/ihm/ressources/{Jouer_son_tour_piocher_lum_et_ten.fxml => Jouer_tour(2ba)piocher_lumiere_tenebre.fxml} (71%) create mode 100644 src/ihm/ressources/Jouer_tour(2bb1)piocher_vision.fxml create mode 100644 src/ihm/ressources/Jouer_tour(2bb2)donne_carte_vision.fxml create mode 100644 src/ihm/ressources/Jouer_tour(2bb3)recevoir_vision.fxml create mode 100644 src/ihm/ressources/Jouer_tour(2c)attaquer_soigner.fxml create mode 100644 src/ihm/ressources/Jouer_tour(3)attaquer.fxml create mode 100644 src/ihm/ressources/Jouer_tour(4)des_attaquer.fxml rename src/ihm/ressources/{Jouer_son_tour_recevoir_blessure.fxml => Jouer_tour(5).fxml} (78%) delete mode 100644 src/ihm/ressources/jouerSonTour1.fxml delete mode 100644 src/ihm/ressources/jouerSonTour2.fxml delete mode 100644 src/ihm/ressources/jouerSonTour3.fxml delete mode 100644 src/ihm/ressources/jouerSonTour4.fxml delete mode 100644 src/ihm/ressources/jouerSonTour5.fxml delete mode 100644 src/ihm/ressources/jouerSonTour6.fxml delete mode 100644 src/ihm/ressources/jouerSonTour7.fxml create mode 100644 src/ihm/ressources/style/popUp.css diff --git a/src/ihm/Main.java b/src/ihm/Main.java index 564545f..44d1d51 100644 --- a/src/ihm/Main.java +++ b/src/ihm/Main.java @@ -5,13 +5,14 @@ import javafx.application.Application; import javafx.fxml.FXMLLoader; import javafx.scene.Scene; import javafx.scene.layout.AnchorPane; +import javafx.scene.layout.Pane; import javafx.stage.Stage; public class Main extends Application{ @Override public void start(Stage primaryStage) throws Exception{ System.out.println("Lancement de l'application"); - AnchorPane root = FXMLLoader.load(getClass().getResource("ressources/Menu.fxml")); + Pane root = FXMLLoader.load(getClass().getResource("ressources/Jouer_tour(1)lancer_des.fxml")); primaryStage.setTitle("Shadow Hunters"); primaryStage.setScene(new Scene(root)); primaryStage.centerOnScreen(); diff --git a/src/ihm/controller/JouerSonTour1Controller.java b/src/ihm/controller/JouerSonTour1Controller.java index 57571b9..b121823 100644 --- a/src/ihm/controller/JouerSonTour1Controller.java +++ b/src/ihm/controller/JouerSonTour1Controller.java @@ -2,25 +2,32 @@ package ihm.controller; import java.io.IOException; import java.net.URL; +import java.util.Random; import java.util.ResourceBundle; import javafx.fxml.FXML; import javafx.fxml.FXMLLoader; import javafx.fxml.Initializable; +import javafx.scene.control.Label; import javafx.scene.input.MouseEvent; import javafx.scene.layout.BorderPane; import javafx.scene.layout.Pane; public class JouerSonTour1Controller implements Initializable{ @FXML private Pane rootPane; + @FXML private Label d6; + @FXML private Label d4; + @Override public void initialize(URL arg0, ResourceBundle arg1) { } + @FXML public void lancerDes(MouseEvent mouseEvent) throws IOException{ - - Pane pane = FXMLLoader.load(getClass().getResource("../ressources/jouerSonTour2.fxml")); + Random d6 = new Random(); + int valeurD6 = d6.nextInt(6) + 1; + Pane pane = FXMLLoader.load(getClass().getResource("../ressources/Jouer_tour(2)carte_lieux.fxml")); rootPane.getChildren().setAll(pane); } } diff --git a/src/ihm/controller/JouerSonTour2Controller.java b/src/ihm/controller/JouerSonTour2Controller.java index f0fceec..54f1c7e 100644 --- a/src/ihm/controller/JouerSonTour2Controller.java +++ b/src/ihm/controller/JouerSonTour2Controller.java @@ -19,19 +19,17 @@ public class JouerSonTour2Controller implements Initializable{ // TODO Auto-generated method stub } + @FXML public void ignorerEtape(MouseEvent mouseEvent) throws IOException{ - - Pane pane = FXMLLoader.load(getClass().getResource("../ressources/jouerSonTour3.fxml")); + Pane pane = FXMLLoader.load(getClass().getResource("../ressources/Jouer_tour(3)attaquer.fxml")); rootPane.getChildren().setAll(pane); - } + @FXML public void capaciteLieu(MouseEvent mouseEvent) throws IOException{ - - Pane pane = FXMLLoader.load(getClass().getResource("../ressources/jouerSonTour5.fxml")); - rootPane.getChildren().setAll(pane); - + //Pane pane = FXMLLoader.load(getClass().getResource("../ressources/jouerSonTour5.fxml")); + //rootPane.getChildren().setAll(pane); } } diff --git a/src/ihm/controller/JouerSonTour3Controller.java b/src/ihm/controller/JouerSonTour3Controller.java index 413a964..5b97c3f 100644 --- a/src/ihm/controller/JouerSonTour3Controller.java +++ b/src/ihm/controller/JouerSonTour3Controller.java @@ -7,29 +7,28 @@ import java.util.ResourceBundle; import javafx.fxml.FXML; import javafx.fxml.FXMLLoader; import javafx.fxml.Initializable; +import javafx.scene.Node; import javafx.scene.input.MouseEvent; import javafx.scene.layout.Pane; +import javafx.stage.Stage; public class JouerSonTour3Controller implements Initializable{ @FXML private Pane rootPane; @Override public void initialize(URL arg0, ResourceBundle arg1) { - System.out.println("nulle"); + } - @FXML + /*@FXML public void choixJoueur(MouseEvent mouseEvent) throws IOException{ - - Pane pane = FXMLLoader.load(getClass().getResource("../ressources/jouerSonTour4.fxml")); + Pane pane = FXMLLoader.load(getClass().getResource("../ressources/jouerSonTour4.fxml")); rootPane.getChildren().setAll(pane); - } + }*/ @FXML - public void equipementVole(MouseEvent mouseEvent) throws IOException{ - - Pane pane = FXMLLoader.load(getClass().getResource("../ressources/jouerSonTour5.fxml")); - rootPane.getChildren().setAll(pane); - + public void pasAttaquer(MouseEvent mouseEvent) throws IOException{ + Stage appStage = (Stage) ((Node) mouseEvent.getSource()).getScene().getWindow(); + appStage.close(); } } diff --git a/src/ihm/controller/PlateauController.java b/src/ihm/controller/PlateauController.java index 590e3f5..b1c98ce 100644 --- a/src/ihm/controller/PlateauController.java +++ b/src/ihm/controller/PlateauController.java @@ -40,7 +40,7 @@ public class PlateauController implements Initializable { @FXML private VBox joueur8; /** - * initialise les donn�es du plateau + * initialise les données du plateau */ @Override public void initialize(URL arg0, ResourceBundle arg1) { @@ -108,7 +108,7 @@ public class PlateauController implements Initializable { /** * Permet de consulter sa carte perssonage en cas d'oublie * - * @param j : Le joueur sur lequel on a cliqu� + * @param j : Le joueur sur lequel on a cliqué */ public void consulterSaCarte(int numJoueur) throws IOException { System.out.println(listJoueur.get(numJoueur).getNom() + " consulte sa carte"); diff --git a/src/ihm/controller/PlayersController.java b/src/ihm/controller/PlayersController.java index be5eded..60b5586 100644 --- a/src/ihm/controller/PlayersController.java +++ b/src/ihm/controller/PlayersController.java @@ -21,7 +21,6 @@ import javafx.scene.control.CheckBox; import javafx.scene.control.TextField; import javafx.scene.input.MouseEvent; import javafx.scene.layout.AnchorPane; -import javafx.scene.layout.BorderPane; import javafx.scene.layout.HBox; import javafx.stage.Stage; diff --git a/src/ihm/ressources/Jouer_son_tour_donner_vision.fxml b/src/ihm/ressources/Jouer_son_tour_donner_vision.fxml deleted file mode 100644 index bbfc643..0000000 --- a/src/ihm/ressources/Jouer_son_tour_donner_vision.fxml +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - - - - - - - - - - - - + + + + + diff --git a/src/ihm/ressources/Jouer_tour(2)carte_lieux.fxml b/src/ihm/ressources/Jouer_tour(2)carte_lieux.fxml new file mode 100644 index 0000000..f5089a7 --- /dev/null +++ b/src/ihm/ressources/Jouer_tour(2)carte_lieux.fxml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + diff --git a/src/ihm/ressources/Jouer_tour(2a)voler_equipement.fxml b/src/ihm/ressources/Jouer_tour(2a)voler_equipement.fxml new file mode 100644 index 0000000..aa8201f --- /dev/null +++ b/src/ihm/ressources/Jouer_tour(2a)voler_equipement.fxml @@ -0,0 +1,20 @@ + + + + + + + + + + + + diff --git a/src/ihm/ressources/Jouer_tour(2b)piocher_carte.fxml b/src/ihm/ressources/Jouer_tour(2b)piocher_carte.fxml new file mode 100644 index 0000000..530c87f --- /dev/null +++ b/src/ihm/ressources/Jouer_tour(2b)piocher_carte.fxml @@ -0,0 +1,15 @@ + + + + + + + + + + + diff --git a/src/ihm/ressources/Jouer_son_tour_piocher_lum_et_ten.fxml b/src/ihm/ressources/Jouer_tour(2ba)piocher_lumiere_tenebre.fxml similarity index 71% rename from src/ihm/ressources/Jouer_son_tour_piocher_lum_et_ten.fxml rename to src/ihm/ressources/Jouer_tour(2ba)piocher_lumiere_tenebre.fxml index 331a76e..e85746c 100644 --- a/src/ihm/ressources/Jouer_son_tour_piocher_lum_et_ten.fxml +++ b/src/ihm/ressources/Jouer_tour(2ba)piocher_lumiere_tenebre.fxml @@ -1,15 +1,15 @@ + - - + - + @@ -25,11 +25,7 @@ - - - - - +