Fix bug tours, choix fonctionnels

This commit is contained in:
Paul Gross
2020-05-03 17:08:45 +02:00
parent 03499c7191
commit afaef5411b
7 changed files with 40 additions and 26 deletions

View File

@@ -6,8 +6,6 @@ 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.layout.Pane;
import main.GestionnaireJeu;
public class ChoisirBoolean implements Initializable {

View File

@@ -69,10 +69,15 @@ public class JoueurIHM {
public void setZoneJoueur(Pane p) {
AnchorPane ap = (AnchorPane) zoneJoueur.getChildren().get(1);
ap.getChildren().setAll(p);
AnchorPane.getBottomAnchor(p);
AnchorPane.getLeftAnchor(p);
AnchorPane.getRightAnchor(p);
AnchorPane.getTopAnchor(p);
//ap.prefWidthProperty().bind(ap.widthProperty());
//ap.prefHeightProperty().bind(ap.heightProperty());
AnchorPane.setBottomAnchor(p,0.0);
AnchorPane.setLeftAnchor(p,0.0);
AnchorPane.setRightAnchor(p,0.0);
AnchorPane.setTopAnchor(p,0.0);
}

View File

@@ -35,7 +35,8 @@ public class PlateauController implements Initializable {
@FXML private AnchorPane rootPane;
@FXML private GridPane gridPaneVie;
//@FXML static public GridPane gridPaneLieux;
private ChoisirBoolean cb;
public static int DICE_SIX = 2;
public static int DICE_QUATRE = 1;
@@ -268,14 +269,16 @@ public class PlateauController implements Initializable {
final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", Locale.FRANCE);
final FXMLLoader fxmlLoader = new FXMLLoader(fxmlURL, bundle);
Pane root = (Pane)fxmlLoader.load();
this.cb = fxmlLoader.getController();
JoueurIHM jihm = getJoueurIHM(j);
jihm.setZoneJoueur(root);
}
public boolean getChoix(Joueur joueur) {
JoueurIHM jihm = getJoueurIHM(joueur);
boolean result = this.cb.getResult();
this.cb = null;
jihm.getZoneJoueur().getChildren().setAll();
return true;
return result;
}
}