Voir carte vision

This commit is contained in:
Paul Gross
2020-05-12 12:30:57 +02:00
parent 985a085e74
commit f1a46ada87
15 changed files with 171 additions and 43 deletions

View File

@@ -15,6 +15,8 @@ import java.util.Set;
import carte.Carte;
import carte.CarteEquipement;
import carte.CarteLieu;
import carte.CartePiochable;
import carte.CartePiochable.Type;
import database.RessourceLoader;
import ihm.EffetSonore;
import ihm.PopUp;
@@ -25,6 +27,7 @@ import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable;
import javafx.scene.Group;
import javafx.scene.Parent;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
@@ -36,6 +39,7 @@ import javafx.scene.layout.Pane;
import javafx.scene.layout.StackPane;
import javafx.scene.layout.VBox;
import javafx.scene.paint.Color;
import javafx.scene.transform.Rotate;
import javafx.util.Duration;
import main.Contexte;
import main.GestionnaireJeu;
@@ -426,7 +430,6 @@ public class PlateauController implements Initializable {
public void updateVieJoueur(Joueur joueur, int damage) {
JoueurIHM jIHM = getJoueurIHM(joueur);
jIHM.deplacerPionVie(damage);
}
@FXML
@@ -467,16 +470,42 @@ public class PlateauController implements Initializable {
public void close () throws IOException {
final URL fxmlURL = PlateauController.class.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);
}
public void afficherLT(Joueur j, CartePiochable cartePiochable) throws IOException {
Image i = getImageCarte(cartePiochable);
ImageView iv = new ImageView(i);
Pane p = new Pane(iv);
PopUp pu = new PopUp(p,"Image");
pu.getStage().focusedProperty().addListener((obs,wasFocused,isNowFocused) -> {
if(!isNowFocused) {
GestionnaireJeu.notifyPlateau();
pu.getStage().hide();
}
});
pu.display();
}
public void afficherVision(Joueur j, CartePiochable cartePiochable) throws IOException {
final URL fxmlURL = getClass().getResource("/ihm/ressources/RecevoirCarte.fxml");
final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", Locale.FRANCE);
final FXMLLoader fxmlLoader = new FXMLLoader(fxmlURL, bundle);
Pane root = (Pane)fxmlLoader.load();
RecevoirCarte lzj = fxmlLoader.getController();
Image im = getImageCarte(cartePiochable);
lzj.setImageView(im);
lzj.setText("Cachez la carte vision");
JoueurIHM jihm = getJoueurIHM(j);
jihm.setZoneJoueur(root);
}
}