Voir carte vision
This commit is contained in:
@ -42,7 +42,6 @@ public class ChoisirJoueur implements Initializable{
|
||||
this.buttons.add(btn6);
|
||||
this.buttons.add(btn7);
|
||||
this.buttons.add(btn8);
|
||||
|
||||
}
|
||||
|
||||
public void initButtons() {
|
||||
|
28
src/ihm/controller/Dialog.java
Normal file
28
src/ihm/controller/Dialog.java
Normal file
@ -0,0 +1,28 @@
|
||||
package ihm.controller;
|
||||
|
||||
import java.net.URL;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.fxml.Initializable;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import main.GestionnaireJeu;
|
||||
|
||||
public class Dialog implements Initializable {
|
||||
@FXML private Button button;
|
||||
@FXML private Label label;
|
||||
|
||||
@Override
|
||||
public void initialize(URL arg0, ResourceBundle arg1) {
|
||||
|
||||
button.setOnAction(x -> {
|
||||
GestionnaireJeu.notifyPlateau();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public void setText(String text) {
|
||||
this.label.setText(text);
|
||||
}
|
||||
}
|
@ -7,21 +7,16 @@ import javafx.fxml.FXML;
|
||||
import javafx.fxml.Initializable;
|
||||
import javafx.scene.control.Button;
|
||||
|
||||
import main.Type;
|
||||
import main.TypeLumiere;
|
||||
import main.TypeTenebre;
|
||||
import main.TypeVision;
|
||||
|
||||
public class PiocherCarte implements Initializable{
|
||||
@FXML private Button lumiere;
|
||||
@FXML private Button vision;
|
||||
@FXML private Button tenebre;
|
||||
|
||||
private Type carte;
|
||||
//private Type carte;
|
||||
|
||||
@Override
|
||||
public void initialize(URL arg0, ResourceBundle arg1) {
|
||||
lumiere.setOnAction(e ->{
|
||||
/*lumiere.setOnAction(e ->{
|
||||
carte = new TypeLumiere();
|
||||
});
|
||||
|
||||
@ -31,10 +26,10 @@ public class PiocherCarte implements Initializable{
|
||||
|
||||
tenebre.setOnAction(e -> {
|
||||
carte = new TypeTenebre();
|
||||
});
|
||||
});*/
|
||||
}
|
||||
|
||||
/*
|
||||
public Type getCarte() {
|
||||
return carte;
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
@ -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);
|
||||
|
||||
}
|
||||
}
|
36
src/ihm/controller/RecevoirCarte.java
Normal file
36
src/ihm/controller/RecevoirCarte.java
Normal file
@ -0,0 +1,36 @@
|
||||
package ihm.controller;
|
||||
|
||||
|
||||
import java.net.URL;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.fxml.Initializable;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.image.Image;
|
||||
import javafx.scene.image.ImageView;
|
||||
import main.GestionnaireJeu;
|
||||
|
||||
public class RecevoirCarte implements Initializable {
|
||||
@FXML private Button okButton;
|
||||
@FXML private Label label;
|
||||
@FXML private ImageView imageView;
|
||||
|
||||
@Override
|
||||
public void initialize(URL arg0, ResourceBundle arg1) {
|
||||
|
||||
okButton.setOnAction(x -> {
|
||||
GestionnaireJeu.notifyPlateau();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public void setText(String name) {
|
||||
this.label.setText(name);
|
||||
}
|
||||
|
||||
public void setImageView(Image imageCarte) {
|
||||
this.imageView.setImage(imageCarte);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user