diff --git a/src/ihm/PopUp.java b/src/ihm/PopUp.java new file mode 100644 index 0000000..9180698 --- /dev/null +++ b/src/ihm/PopUp.java @@ -0,0 +1,24 @@ +package ihm; + +import javafx.scene.Scene; +import javafx.scene.layout.Pane; +import javafx.stage.Modality; +import javafx.stage.Stage; + +public class PopUp { + private Scene scene; + private Stage popupwindow; + + public PopUp (Pane p, String titre) { + popupwindow = new Stage(); + popupwindow.initModality(Modality.APPLICATION_MODAL); + popupwindow.setTitle(titre); + + scene = new Scene(p); + } + + public void display() { + popupwindow.setScene(scene); + popupwindow.showAndWait(); + } +} diff --git a/src/ihm/controller/PlateauController.java b/src/ihm/controller/PlateauController.java new file mode 100644 index 0000000..9a1a968 --- /dev/null +++ b/src/ihm/controller/PlateauController.java @@ -0,0 +1,36 @@ +package ihm.controller; + +import java.io.IOException; +import java.net.URL; +import java.util.ResourceBundle; + +import ihm.PopUp; +import javafx.fxml.FXMLLoader; +import javafx.fxml.Initializable; +import javafx.scene.control.Alert; +import javafx.scene.control.Alert.AlertType; +import javafx.scene.input.MouseEvent; +import javafx.scene.layout.BorderPane; +import javafx.scene.layout.Pane; + +public class PlateauController implements Initializable{ + + @Override + public void initialize(URL arg0, ResourceBundle arg1) { + // TODO Auto-generated method stub + + } + + /** + * Affiche aux yeux de tous la carte personnage du joueur + * + * @param mouseEvent : clique sur le bouton + * @throws IOException + */ + public void seReveler(MouseEvent mouseEvent) throws IOException { + System.out.println("Le joueur ... se revèle"); + Pane pane = FXMLLoader.load(getClass().getResource("../ressources/Reveler_son_identite.fxml")); + PopUp popup = new PopUp(pane, "reveler son identité"); + popup.display(); + } +} diff --git a/src/ihm/controller/PlayersController.java b/src/ihm/controller/PlayersController.java index 2298c74..cd10bdf 100644 --- a/src/ihm/controller/PlayersController.java +++ b/src/ihm/controller/PlayersController.java @@ -7,6 +7,7 @@ import java.util.ResourceBundle; import javafx.fxml.FXML; import javafx.fxml.FXMLLoader; import javafx.fxml.Initializable; +import javafx.scene.control.TextField; import javafx.scene.input.MouseEvent; import javafx.scene.layout.BorderPane; import javafx.scene.layout.Pane; @@ -24,7 +25,7 @@ public class PlayersController implements Initializable{ @FXML public void commencerJeux(MouseEvent mouseEvent) throws IOException{ System.out.println("Lancement du jeu..."); - Pane pane = FXMLLoader.load(getClass().getResource("../ressources/Plateau.fxml")); + BorderPane pane = FXMLLoader.load(getClass().getResource("../ressources/Plateau.fxml")); rootPane.getChildren().setAll(pane); } } diff --git a/src/ihm/ressources/Choix_joueur.fxml b/src/ihm/ressources/Choix_joueur.fxml index 560e5a0..ee7bed9 100644 --- a/src/ihm/ressources/Choix_joueur.fxml +++ b/src/ihm/ressources/Choix_joueur.fxml @@ -33,7 +33,7 @@ -