Merge branch 'development' of https://github.com/PTE-SH/ShadowHunterGame into development

This commit is contained in:
Paul Gross 2020-05-05 13:13:44 +02:00
commit fea2ecba5a
7 changed files with 149 additions and 79 deletions

View File

@ -17,7 +17,7 @@ public class Main extends Application {
@Override
public void start(Stage primaryStage) throws Exception {
final URL fxmlURL = getClass().getResource("ressources/parametre.fxml"); // "ressources/Jouer_tour(1)lancer_des.fxml"
final URL fxmlURL = getClass().getResource("ressources/Jouer_tour(1)lancer_des.fxml"); // "ressources/Jouer_tour(1)lancer_des.fxml"
final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", Locale.FRANCE);
final FXMLLoader fxmlLoader = new FXMLLoader(fxmlURL, bundle);
Pane root = fxmlLoader.load();
@ -31,7 +31,7 @@ public class Main extends Application {
System.exit(0);
}
});
primaryStage.setMaximized(true);
//primaryStage.setMaximized(true);
primaryStage.show();
}

View File

@ -16,6 +16,7 @@ import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable;
import javafx.geometry.Rectangle2D;
import javafx.scene.Group;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.image.ImageView;
import javafx.scene.input.MouseEvent;
@ -26,71 +27,42 @@ import javafx.util.Duration;
import main.Joueur;
public class JouerSonTour1Controller implements Initializable{
private Joueur joueur;
@FXML private Pane rootPane;
@FXML private Label nomJoueur;
@FXML private AnchorPane d6;
@FXML private AnchorPane d4;
@FXML private Label d6;
@FXML private Label d4;
@FXML private Button btnStop;
@FXML private Button btnLancer;
@Override
public void initialize(URL arg0, ResourceBundle arg1) {
btnStop.setVisible(false);
}
@FXML
public void lancerDes(MouseEvent mouseEvent)throws InterruptedException{
System.out.println("\tLancements des dès");
//nomJoueur.setText(joueur.getNom());
btnLancer.setVisible(false);
btnStop.setVisible(true);
int OFFSET_X = 0;
int OFFSET_Y = 0;
int WIDTH = 80;
int HEIGHT = 80;
int COUNT = 6;
int COLUMNS = 6;
for (int i=1; i<7; i++) {
Thread.sleep(500);
d6.setText(Integer.toString(i));
}
//anchorPane1.getChildren().setAll(imageView);
ImageView imageView;
try {
imageView = FXMLLoader.load(getClass().getResource("/ihm/ressources/img/des.fxml"));
imageView.setViewport(new Rectangle2D(OFFSET_X, OFFSET_Y, WIDTH, HEIGHT));
imageView.fitWidthProperty().bind(d6.widthProperty());
final SpriteAnimation animation = new SpriteAnimation(
imageView,
Duration.millis(250),
COUNT, COLUMNS,
OFFSET_X, OFFSET_Y,
557, 557
);
animation.setCycleCount(Animation.INDEFINITE);
animation.play();
d6.getChildren().addAll(new Group(imageView));
d6.setOnMousePressed(new EventHandler<Event>(
) {
@Override
public void handle(Event arg0) {
animation.stop();
}
});
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
for (int i=1; i<5; i++) {
Thread.sleep(500);
d4.setText(Integer.toString(i));
}
}
@FXML
public void lancerDes(MouseEvent mouseEvent) throws IOException, InterruptedException{
public void stop(MouseEvent mouseEvent) throws IOException, InterruptedException {
Thread.sleep(2000);
final URL fxmlURL = getClass().getResource("/ihm/ressources/Jouer_tour(2)carte_lieux.fxml");
final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", Locale.ENGLISH);
final FXMLLoader fxmlLoader = new FXMLLoader(fxmlURL, bundle);
Pane root = fxmlLoader.load();
rootPane.getChildren().setAll(root);
}
public void deplacerPion(CarteLieu lieux) {
}
}

View File

@ -3,17 +3,23 @@ package ihm.controller;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.Locale;
import java.util.Map;
import java.util.ResourceBundle;
import ihm.EffetSonore;
import ihm.Musique;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable;
import javafx.scene.Node;
import javafx.scene.Scene;
import javafx.scene.control.CheckBox;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.AnchorPane;
import javafx.stage.Stage;
import main.GestionnaireJeu;
import main.Joueur;
public class PauseController implements Initializable {
@FXML
@ -96,5 +102,11 @@ public class PauseController implements Initializable {
Stage appStage = (Stage) ((Node) me.getSource()).getScene().getWindow();
appStage.close();
final URL fxmlURL = getClass().getResource("/ihm/ressources/Menu.fxml");
final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", Locale.FRENCH);
final FXMLLoader fxmlLoader = new FXMLLoader(fxmlURL, bundle);
AnchorPane root = fxmlLoader.load();
}
}

View File

@ -1,28 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import java.lang.Double?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.Pane?>
<?import javafx.scene.shape.Polygon?>
<?import javafx.scene.shape.Rectangle?>
<?import javafx.scene.text.Font?>
<Pane fx:id="rootPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="180.0" prefWidth="255.0" stylesheets="@style/popUp.css" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ihm.controller.JouerSonTour1Controller">
<children>
<Label layoutX="54.0" layoutY="19.0" text="%au.tour.de">
<font>
<Font size="14.0" />
</font>
</Label>
<Button layoutX="70.0" layoutY="140.0" mnemonicParsing="false" onMouseClicked="#lancerDes" text="%lancer.de.des">
<Button fx:id="btnLancer" layoutX="70.0" layoutY="140.0" mnemonicParsing="false" onMouseClicked="#lancerDes" text="%lancer.de.des">
<font>
<Font size="14.0" />
</font></Button>
<Label fx:id="nomJoueur" layoutX="140.0" layoutY="19.0" text="%joueur1">
<Rectangle arcHeight="5.0" arcWidth="5.0" fill="WHITE" height="96.0" layoutX="22.0" layoutY="25.0" stroke="BLACK" strokeType="INSIDE" width="96.0" />
<Polygon fill="WHITE" layoutX="191.0" layoutY="81.0" stroke="BLACK" strokeType="INSIDE">
<points>
<Double fx:value="-50.0" />
<Double fx:value="40.0" />
<Double fx:value="50.0" />
<Double fx:value="40.0" />
<Double fx:value="0.0" />
<Double fx:value="-60.0" />
</points>
</Polygon>
<Label fx:id="d6" layoutX="57.0" layoutY="38.0" styleClass="des" text="6">
<font>
<Font size="48.0" />
</font>
</Label>
<Label fx:id="d4" layoutX="178.0" layoutY="51.0" styleClass="des" text="4">
<font>
<Font size="48.0" />
</font>
</Label>
<Button fx:id="btnStop" layoutX="101.0" layoutY="140.0" mnemonicParsing="false" onMouseClicked="#stop" text="Stop">
<font>
<Font size="14.0" />
</font>
</Label>
<AnchorPane fx:id="d6" layoutX="23.0" layoutY="50.0" prefHeight="80.0" prefWidth="80.0" />
<AnchorPane fx:id="d4" layoutX="129.0" layoutY="50.0" prefHeight="80.0" prefWidth="80.0" />
</Button>
</children>
</Pane>

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.image.ImageView?>
@ -7,18 +8,20 @@
<?import javafx.scene.layout.Pane?>
<?import javafx.scene.text.Font?>
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="180.0" prefWidth="255.0" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ihm.controller.JouerSonTour2Controller">
<children>
<Pane fx:id="rootPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="180.0" prefWidth="255.0" stylesheets="@style/popUp.css">
<children>
<Button layoutX="112.0" layoutY="128.0" mnemonicParsing="false" onMouseClicked="#capaciteLieu" text="%utiliser.capaciter.lieux" />
<Button layoutX="136.0" layoutY="90.0" mnemonicParsing="false" onMouseClicked="#ignorerEtape" text="%sauter.etape" />
<Button layoutX="103.0" layoutY="133.0" mnemonicParsing="false" onMouseClicked="#capaciteLieu" text="%utiliser.capaciter.lieux" />
<Button layoutX="104.0" layoutY="97.0" mnemonicParsing="false" onMouseClicked="#ignorerEtape" prefHeight="29.0" prefWidth="142.0" text="%sauter.etape" />
<ImageView fitHeight="114.0" fitWidth="82.0" layoutX="14.0" layoutY="33.0" pickOnBounds="true" preserveRatio="true" />
<Label fx:id="descriptionLieu" layoutX="96.0" layoutY="33.0" text="%description.capacite.carte.lieux">
<font>
<Font size="11.0" />
</font>
<padding>
<Insets left="5.0" />
</padding>
</Label>
</children>
</Pane>

View File

@ -1,18 +1,81 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.Pane?>
<?import javafx.scene.text.Font?>
<Pane fx:id="rootPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="480.0" prefWidth="640.0" stylesheets="@style/popUp.css" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ihm.controller.JouerSonTour3Controller">
<Pane fx:id="rootPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="180.0" prefWidth="255.0" stylesheets="@style/popUp.css" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ihm.controller.JouerSonTour3Controller">
<children>
<Label layoutX="191.0" layoutY="163.0" text="%attaquer.joueur">
<font>
<Font size="24.0" />
</font>
</Label>
<Button layoutX="277.0" layoutY="265.0" mnemonicParsing="false" onMouseClicked="#pasAttaquer" text="%ne.pas.attaqur" />
<Label layoutX="182.0" layoutY="208.0" text="Cliquez sur le nom du joueur que vous voulez attaquer" />
<Button layoutX="76.0" layoutY="76.0" mnemonicParsing="false" onMouseClicked="#pasAttaquer" text="Ne pas attaquer" />
<HBox layoutY="1.0">
<children>
<Button mnemonicParsing="false" text="Joueur 1">
<font>
<Font size="10.0" />
</font>
<HBox.margin>
<Insets right="10.0" />
</HBox.margin>
</Button>
<Button mnemonicParsing="false" text="Joueur 2">
<font>
<Font size="10.0" />
</font>
<HBox.margin>
<Insets right="10.0" />
</HBox.margin>
</Button>
<Button mnemonicParsing="false" text="Joueur 3">
<font>
<Font size="10.0" />
</font>
<HBox.margin>
<Insets right="10.0" />
</HBox.margin>
</Button>
<Button mnemonicParsing="false" text="Joueur 4">
<font>
<Font size="10.0" />
</font>
</Button>
</children>
</HBox>
<HBox layoutX="1.0" layoutY="153.0">
<children>
<Button mnemonicParsing="false" text="Joueur 5">
<font>
<Font size="10.0" />
</font>
<HBox.margin>
<Insets right="10.0" />
</HBox.margin>
</Button>
<Button mnemonicParsing="false" text="Joueur 6">
<font>
<Font size="10.0" />
</font>
<HBox.margin>
<Insets right="10.0" />
</HBox.margin>
</Button>
<Button mnemonicParsing="false" text="Joueur 7">
<font>
<Font size="10.0" />
</font>
<HBox.margin>
<Insets right="10.0" />
</HBox.margin>
</Button>
<Button mnemonicParsing="false" text="Joueur 8">
<font>
<Font size="10.0" />
</font>
</Button>
</children>
</HBox>
<Label layoutX="73.0" layoutY="55.0" text="Attaquer un joueur !" />
</children>
</Pane>

View File

@ -18,3 +18,7 @@ Button {
-fx-text-fill: #d8d8d8;
-fx-background-insets: 0 0 0 0, 0, 1, 2;
}
.anchorDes{
-fx-border-color: #e2e2e2;
}