Merge branch 'development' of https://github.com/PTE-SH/ShadowHunterGame into development
This commit is contained in:
commit
09d2d520c3
@ -32,12 +32,7 @@ public class DatabaseTesting {
|
|||||||
|
|
||||||
Table a = new Table("a");
|
Table a = new Table("a");
|
||||||
a.remplirTable("CartesLumiere");
|
a.remplirTable("CartesLumiere");
|
||||||
try {
|
|
||||||
ByteaToCardImage.getImg(a.getList().get(5).getImg());
|
|
||||||
} catch (Exception e) {
|
|
||||||
// TODO Auto-generated catch block
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ public class Table {
|
|||||||
while (retour.next()) {
|
while (retour.next()) {
|
||||||
Record r = new Record(retour.getString("id"), retour.getString("nom"), retour.getBytes("image"));
|
Record r = new Record(retour.getString("id"), retour.getString("nom"), retour.getBytes("image"));
|
||||||
list.add(r);
|
list.add(r);
|
||||||
//System.out.printf("%-20.30s %-30.30s %-20.30s%n", retour.getString("id"), retour.getString("nom"), retour.getBytes("image"));
|
System.out.printf("%-20.30s %-30.30s %-20.30s%n", retour.getString("id"), retour.getString("nom"), retour.getBytes("image"));
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
|
@ -7,7 +7,6 @@ import java.util.ResourceBundle;
|
|||||||
import javafx.application.Application;
|
import javafx.application.Application;
|
||||||
import javafx.fxml.FXMLLoader;
|
import javafx.fxml.FXMLLoader;
|
||||||
import javafx.scene.Scene;
|
import javafx.scene.Scene;
|
||||||
import javafx.scene.layout.AnchorPane;
|
|
||||||
import javafx.scene.layout.Pane;
|
import javafx.scene.layout.Pane;
|
||||||
import javafx.stage.Stage;
|
import javafx.stage.Stage;
|
||||||
|
|
||||||
@ -28,11 +27,6 @@ public class Main extends Application {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
|
||||||
String filepath = "src//ihm//ressources//musique//The_Red_Fox_Tavern.wav"; // lien vers la musique :
|
|
||||||
// https://www.youtube.com/watch?v=LBpKUIyOHdo
|
|
||||||
Musique musiqueObjet = new Musique();
|
|
||||||
//musiqueObjet.playMusique(filepath);
|
|
||||||
launch(args);
|
launch(args);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,11 +5,13 @@ import java.io.File;
|
|||||||
import javax.sound.sampled.AudioInputStream;
|
import javax.sound.sampled.AudioInputStream;
|
||||||
import javax.sound.sampled.AudioSystem;
|
import javax.sound.sampled.AudioSystem;
|
||||||
import javax.sound.sampled.Clip;
|
import javax.sound.sampled.Clip;
|
||||||
import javax.swing.JOptionPane;
|
|
||||||
|
|
||||||
public class Musique {
|
public class Musique {
|
||||||
|
|
||||||
public void playMusique(String path) {
|
public static Clip clip;
|
||||||
|
public static long clipTimePosition = 0;
|
||||||
|
|
||||||
|
public static void playMusique(String path) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
@ -18,7 +20,7 @@ public class Musique {
|
|||||||
if (musicPath.exists()) {
|
if (musicPath.exists()) {
|
||||||
|
|
||||||
AudioInputStream audioInput = AudioSystem.getAudioInputStream(musicPath);
|
AudioInputStream audioInput = AudioSystem.getAudioInputStream(musicPath);
|
||||||
Clip clip = AudioSystem.getClip();
|
clip = AudioSystem.getClip();
|
||||||
clip.open(audioInput);
|
clip.open(audioInput);
|
||||||
clip.start();
|
clip.start();
|
||||||
clip.loop(Clip.LOOP_CONTINUOUSLY);
|
clip.loop(Clip.LOOP_CONTINUOUSLY);
|
||||||
@ -32,4 +34,14 @@ public class Musique {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void pauseMusique(Clip clip) {
|
||||||
|
clipTimePosition = clip.getMicrosecondPosition();
|
||||||
|
clip.stop();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void resumeMusique(Clip clip) {
|
||||||
|
clip.setMicrosecondPosition(clipTimePosition);
|
||||||
|
clip.start();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package ihm.controller;
|
package ihm.controller;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.util.ResourceBundle;
|
import java.util.ResourceBundle;
|
||||||
@ -8,45 +9,82 @@ import ihm.Musique;
|
|||||||
import javafx.fxml.FXML;
|
import javafx.fxml.FXML;
|
||||||
import javafx.fxml.FXMLLoader;
|
import javafx.fxml.FXMLLoader;
|
||||||
import javafx.fxml.Initializable;
|
import javafx.fxml.Initializable;
|
||||||
import javafx.scene.control.Button;
|
|
||||||
import javafx.scene.control.CheckBox;
|
import javafx.scene.control.CheckBox;
|
||||||
import javafx.scene.control.ComboBox;
|
import javafx.scene.control.ComboBox;
|
||||||
import javafx.scene.input.MouseEvent;
|
import javafx.scene.input.MouseEvent;
|
||||||
import javafx.scene.layout.Pane;
|
import javafx.scene.layout.Pane;
|
||||||
|
|
||||||
public class ParametreController implements Initializable {
|
public class ParametreController implements Initializable {
|
||||||
@FXML private Pane rootPane;
|
@FXML
|
||||||
@FXML private CheckBox cmusique;
|
private Pane rootPane;
|
||||||
@FXML private CheckBox clair;
|
@FXML
|
||||||
@FXML private ComboBox<String> langues;
|
private CheckBox cmusique;
|
||||||
|
@FXML
|
||||||
|
private CheckBox clair;
|
||||||
|
@FXML
|
||||||
|
private ComboBox<String> langues;
|
||||||
|
boolean coche = false; // verifi si la checbox musical est coche
|
||||||
|
boolean MusiqueLancee = false; //verifi si la musique a déja été lancé une première fois
|
||||||
|
|
||||||
|
String filepath = "src//ihm//ressources//musique//The_Red_Fox_Tavern.wav"; // lien vers la musique :
|
||||||
|
// https://www.youtube.com/watch?v=LBpKUIyOHdo
|
||||||
|
File files = new File("src//ihm//ressources//musique//The_Red_Fox_Tavern.wav");
|
||||||
|
|
||||||
|
File repertoire = new File("src//ihm//ressources");
|
||||||
|
|
||||||
|
String liste[] = repertoire.list();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initialize(URL arg0, ResourceBundle arg1) {
|
public void initialize(URL arg0, ResourceBundle arg1) {
|
||||||
langues.getItems().add("Anglais");
|
langues.getItems().add("Anglais");
|
||||||
langues.getItems().add("Allemand");
|
langues.getItems().add("Allemand");
|
||||||
langues.getItems().add("Espagnol");
|
langues.getItems().add("Espagnol");
|
||||||
langues.getItems().add("Français");
|
langues.getItems().add("Français");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
/*@FXML
|
|
||||||
public void enregistre(MouseEvent mouseEvent) throws IOException{
|
@FXML
|
||||||
|
public void enregistre(MouseEvent mouseEvent) throws IOException, Exception {
|
||||||
|
|
||||||
|
if (files.exists()) {
|
||||||
|
|
||||||
if (cmusique.isSelected() == true) {
|
if (cmusique.isSelected() == true) {
|
||||||
|
coche = true;
|
||||||
|
if (Musique.clipTimePosition == 0 && MusiqueLancee == false) { // si la musique n'a jamais été lancé
|
||||||
|
Musique.playMusique(filepath);
|
||||||
|
MusiqueLancee = true;
|
||||||
|
|
||||||
String filepath = "src//ihm//ressources//musique//The_Red_Fox_Tavern.wav"; // lien vers la musique :
|
} else {
|
||||||
// https://www.youtube.com/watch?v=LBpKUIyOHdo
|
Musique.resumeMusique(Musique.clip); // si elle a deja été lancé mais mis en pause, reprend a partir du point d'arret
|
||||||
Musique musiqueObjet = new Musique();
|
}
|
||||||
//musiqueObjet.playMusique(filepath);
|
|
||||||
|
|
||||||
Pane root = FXMLLoader.load(getClass().getResource("ressources/parametre.fxml"));
|
} else {
|
||||||
//root.setStyle("ressources/style/menuLight.css);
|
if (coche == true) {
|
||||||
|
coche = false;
|
||||||
|
Musique.pauseMusique(Musique.clip); //met en pause la musique
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} */
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* if(clair.isSelected()) { Pane root =
|
||||||
|
* FXMLLoader.load(getClass().getResource("ressources/parametre.fxml"));
|
||||||
|
* root.setStyle("ressources/style/menuLight.css"); if (liste != null) { for
|
||||||
|
* (int i = 0; i < liste.length; i++) { System.out.println(liste[i]); Pane root1
|
||||||
|
* = FXMLLoader.load(getClass().getResource(liste[i]));
|
||||||
|
* root1.setStyle("ressources/style/menuLight.css"); } }
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
Pane pane = FXMLLoader.load(getClass().getResource("../ressources/Jouer_tour(3)attaquer.fxml"));
|
||||||
|
|
||||||
|
rootPane.getChildren().setAll(pane);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
@ -37,6 +37,6 @@
|
|||||||
<Font size="36.0" />
|
<Font size="36.0" />
|
||||||
</font>
|
</font>
|
||||||
</Label>
|
</Label>
|
||||||
<Button layoutX="340.0" layoutY="525.0" mnemonicParsing="false" styleClass="bouton" stylesheets="@style/menu.css" text="Enregistrer" />
|
<Button layoutX="340.0" layoutY="525.0" mnemonicParsing="false" onMouseClicked="#enregistre" styleClass="bouton" stylesheets="@style/menu.css" text="Enregistrer" />
|
||||||
</children>
|
</children>
|
||||||
</Pane>
|
</Pane>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user