travail sur le plateau
This commit is contained in:
@ -81,6 +81,7 @@ public class JoueurIHM {
|
||||
AnchorPane.setLeftAnchor(p,0.0);
|
||||
AnchorPane.setRightAnchor(p,0.0);
|
||||
AnchorPane.setTopAnchor(p,0.0);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
29
src/ihm/controller/LieuZJ.java
Normal file
29
src/ihm/controller/LieuZJ.java
Normal file
@ -0,0 +1,29 @@
|
||||
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.image.Image;
|
||||
import javafx.scene.image.ImageView;
|
||||
import main.GestionnaireJeu;
|
||||
|
||||
public class LieuZJ implements Initializable {
|
||||
@FXML private Button okButton;
|
||||
@FXML private ImageView imageView;
|
||||
|
||||
@Override
|
||||
public void initialize(URL arg0, ResourceBundle arg1) {
|
||||
|
||||
okButton.setOnAction(x -> {
|
||||
GestionnaireJeu.notifyPlateau();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public void setImageView(Image imageCarte) {
|
||||
this.imageView.setImage(imageCarte);
|
||||
}
|
||||
}
|
@ -289,7 +289,6 @@ public class PlateauController implements Initializable {
|
||||
for(JoueurIHM joueurIHM : joueursIHM) {
|
||||
if(joueurIHM.getJoueur().equals(j)) return joueurIHM;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -327,7 +326,6 @@ public class PlateauController implements Initializable {
|
||||
getPaneJoueur(i).getChildren().setAll();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void rollDice(Joueur joueur, int typeDice, int[] rolls) {
|
||||
@ -345,6 +343,7 @@ public class PlateauController implements Initializable {
|
||||
jihm.setZoneJoueur(root);
|
||||
}
|
||||
|
||||
|
||||
public void afficherChoisirEquipementVole(Joueur j) throws IOException {
|
||||
final URL fxmlURL = getClass().getResource("/ihm/ressources/Jouer_tour(2a)voler_equipement.fxml");
|
||||
final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", Locale.FRANCE);
|
||||
@ -355,6 +354,20 @@ public class PlateauController implements Initializable {
|
||||
jihm.setZoneJoueur(root);
|
||||
}
|
||||
|
||||
public void afficherLieu(Joueur j) throws IOException {
|
||||
|
||||
final URL fxmlURL = getClass().getResource("/ihm/ressources/LieuZJ.fxml");
|
||||
final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", Locale.FRANCE);
|
||||
final FXMLLoader fxmlLoader = new FXMLLoader(fxmlURL, bundle);
|
||||
Pane root = (Pane)fxmlLoader.load();
|
||||
LieuZJ lzj = fxmlLoader.getController();
|
||||
lzj.setImageView(this.getImageCarte(j.getCarteLieu()));
|
||||
JoueurIHM jihm = getJoueurIHM(j);
|
||||
jihm.setZoneJoueur(root);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public CarteEquipement getChoixEquipementVole(Joueur joueur) {
|
||||
JoueurIHM jihm = getJoueurIHM(joueur);
|
||||
CarteEquipement result = this.ce.getResult();
|
||||
@ -404,4 +417,7 @@ public class PlateauController implements Initializable {
|
||||
BufferedImage bi = this.mapRessourcesCartes.get(carte);
|
||||
return RessourceLoader.toJavaFX(bi);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
38
src/ihm/ressources/LieuZJ.fxml
Normal file
38
src/ihm/ressources/LieuZJ.fxml
Normal file
@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.scene.control.Button?>
|
||||
<?import javafx.scene.control.Label?>
|
||||
<?import javafx.scene.control.SplitPane?>
|
||||
<?import javafx.scene.image.ImageView?>
|
||||
<?import javafx.scene.layout.AnchorPane?>
|
||||
<?import javafx.scene.layout.VBox?>
|
||||
<?import javafx.scene.text.Font?>
|
||||
|
||||
|
||||
<AnchorPane xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ihm.controller.LieuZJ">
|
||||
<children>
|
||||
<SplitPane dividerPositions="0.6212121212121212" styleClass="background" stylesheets="@style/plateau.css" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||
<items>
|
||||
<AnchorPane>
|
||||
<children>
|
||||
<VBox prefHeight="200.0" prefWidth="100.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||
<children>
|
||||
<Label styleClass="text" text="Vous arrivez sur cette Carte Lieu" textOverrun="CLIP" wrapText="true">
|
||||
<font>
|
||||
<Font size="14.0" />
|
||||
</font>
|
||||
</Label>
|
||||
<Button fx:id="okButton" mnemonicParsing="false" styleClass="bouton" text="Ok" />
|
||||
</children>
|
||||
</VBox>
|
||||
</children>
|
||||
</AnchorPane>
|
||||
<AnchorPane>
|
||||
<children>
|
||||
<ImageView fx:id="imageView" fitHeight="158.0" fitWidth="132.0" pickOnBounds="true" preserveRatio="true" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" />
|
||||
</children>
|
||||
</AnchorPane>
|
||||
</items>
|
||||
</SplitPane>
|
||||
</children>
|
||||
</AnchorPane>
|
@ -3,16 +3,26 @@
|
||||
<?import javafx.scene.control.Button?>
|
||||
<?import javafx.scene.control.Label?>
|
||||
<?import javafx.scene.layout.AnchorPane?>
|
||||
<?import javafx.scene.layout.HBox?>
|
||||
<?import javafx.scene.layout.VBox?>
|
||||
<?import javafx.scene.text.Font?>
|
||||
|
||||
<AnchorPane fx:id="root" minHeight="0.0" minWidth="0.0" prefHeight="129.0" prefWidth="201.0" style="-fx-background-color: white;" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ihm.controller.ChoisirBoolean">
|
||||
<AnchorPane fx:id="root" minHeight="0.0" minWidth="0.0" prefHeight="289.0" prefWidth="450.0" styleClass="background" stylesheets="@style/plateau.css" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ihm.controller.ChoisirBoolean">
|
||||
<children>
|
||||
<Label fx:id="titre" layoutX="8.0" layoutY="-11.0" prefHeight="26.0" prefWidth="128.0" text="Voulez vous faire cette action ?" AnchorPane.bottomAnchor="77.0" AnchorPane.leftAnchor="8.0" AnchorPane.rightAnchor="7.0" AnchorPane.topAnchor="-11.0">
|
||||
<font>
|
||||
<Font size="13.0" />
|
||||
</font>
|
||||
</Label>
|
||||
<Button fx:id="ouiButton" layoutX="34.0" layoutY="85.0" mnemonicParsing="false" prefHeight="30.0" prefWidth="45.0" text="Oui" AnchorPane.bottomAnchor="14.0" AnchorPane.leftAnchor="34.0" AnchorPane.rightAnchor="122.0" AnchorPane.topAnchor="85.0" />
|
||||
<Button fx:id="nonButton" layoutX="126.0" layoutY="85.0" mnemonicParsing="false" prefHeight="30.0" prefWidth="45.0" text="Non" AnchorPane.bottomAnchor="14.0" AnchorPane.leftAnchor="126.0" AnchorPane.rightAnchor="30.0" AnchorPane.topAnchor="85.0" />
|
||||
<VBox alignment="CENTER" layoutX="37.0" layoutY="14.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||
<children>
|
||||
<Label fx:id="titre" alignment="CENTER" prefHeight="88.0" prefWidth="158.0" styleClass="text" text="Voulez vous faire cette action ?" wrapText="true">
|
||||
<font>
|
||||
<Font size="13.0" />
|
||||
</font>
|
||||
</Label>
|
||||
<HBox alignment="CENTER">
|
||||
<children>
|
||||
<Button fx:id="ouiButton" mnemonicParsing="false" prefHeight="30.0" prefWidth="45.0" styleClass="bouton" text="Oui" />
|
||||
<Button fx:id="nonButton" mnemonicParsing="false" prefHeight="30.0" prefWidth="45.0" styleClass="bouton" text="Non" />
|
||||
</children>
|
||||
</HBox>
|
||||
</children>
|
||||
</VBox>
|
||||
</children>
|
||||
</AnchorPane>
|
||||
|
Reference in New Issue
Block a user