Ajout de nouvelles étapes au tutoriel avec des descriptions améliorées + améliorations

This commit is contained in:
2024-12-07 23:34:39 +01:00
parent cd22460ab8
commit 79857ac00c
33 changed files with 49 additions and 10 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 188 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 121 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 103 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 MiB

After

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 MiB

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 888 KiB

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 MiB

After

Width:  |  Height:  |  Size: 234 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 191 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

View File

@@ -46,10 +46,13 @@ public class TutorialController {
// Création des étapes du tutoriel avec leurs titres, descriptions et images
List<Step> steps = new ArrayList<>();
steps.add(new Step("Étape n°1", "Explication de la première étape ici.", Images.TUTORIAL_GIF1.getImagePath()));
steps.add(new Step("Étape n°2", "Explication de la deuxième étape ici.", Images.TUTORIAL_GIF2.getImagePath()));
steps.add(new Step("Étape n°3", "Explication de la troisième étape ici.", Images.TUTORIAL_GIF3.getImagePath()));
steps.add(new Step("Étape n°4", "Explication de la quatrième étape ici.", Images.TUTORIAL_GIF4.getImagePath()));
steps.add(new Step("Étape n°1", "Pour prévisualiser le placement d'une tuile, placez votre souris sur l'un des points rouges affichés sur le plateau.", Images.TUTORIAL_GIF1.getImagePath()));
steps.add(new Step("Étape n°2", "Pour effectuer une rotation de la tuile, utilisez la molette de la souris. Cela permet d'orienter la tuile selon votre stratégie.", Images.TUTORIAL_GIF2.getImagePath()));
steps.add(new Step("Étape n°3", "Pour placer une tuile, cliquez sur l'un des points rouges où la prévisualisation est visible.", Images.TUTORIAL_GIF3.getImagePath()));
steps.add(new Step("Étape n°4", "Le nombre de tuiles restantes est affiché dans la section droite de l'écran, pour suivre votre progression dans la partie.", Images.TUTORIAL_GIF4.getImagePath()));
steps.add(new Step("Étape n°5", "Votre score est mis à jour en temps réel et est visible en haut au milieu de l'écran.", Images.TUTORIAL_GIF5.getImagePath()));
steps.add(new Step("Étape n°6", "En cas de besoin, vous pouvez afficher le menu d'aide en appuyant sur la touche 'T'.", Images.TUTORIAL_GIF6.getImagePath()));
// Initialisation du panneau de tutoriel avec les étapes, le menu principal et la fenêtre associée
tutorialPanel = new TutorialPanel(steps, this.mainMenu, this.tutorialFrame);

View File

@@ -6,7 +6,7 @@ import java.awt.Color;
* Enumération des différents biomes possibles pour les tuiles.
*
* @version 1.0
* @author Lenny FOULOU
* @author Moncef STITI
* @see Color
*/
public enum Biome {

View File

@@ -11,7 +11,7 @@ import java.awt.FontFormatException;
* Cette classe permet de récupérer le chemin d'accès aux fichiers de police et de charger une police à une taille donnée.
*
* @version 1.0
* @author Lenny FOULOU
* @author Khalid CHENOUNA
*/
public enum Fonts {
/**

View File

@@ -37,7 +37,19 @@ public enum Images {
/**
* Gif de la quatrième étape du tutoriel.
*/
TUTORIAL_GIF4;
TUTORIAL_GIF4,
/**
* Gif de la cinquième étape du tutoriel.
*/
TUTORIAL_GIF5,
/**
* Gif de la sixième étape du tutoriel.
*/
TUTORIAL_GIF6;
/**
* Récupère le chemin du fichier d'image correspondant à l'énumération.
@@ -58,6 +70,10 @@ public enum Images {
return "./ressources/images/Tutorial/Gif3.gif";
case TUTORIAL_GIF4:
return "./ressources/images/Tutorial/Gif4.gif";
case TUTORIAL_GIF5:
return "./ressources/images/Tutorial/Gif5.gif";
case TUTORIAL_GIF6:
return "./ressources/images/Tutorial/Gif6.gif";
default:
throw new IllegalArgumentException("Unexpected value: " + this);
}

View File

@@ -6,7 +6,7 @@ package fr.monkhanny.dorfromantik.enums;
* Cette classe permet de récupérer le chemin d'accès au fichier de musique associé.
*
* @version 1.0
* @author Lenny FOULOU
* @author Moncef STITI
*/
public enum Musics {
/**

View File

@@ -6,7 +6,7 @@ package fr.monkhanny.dorfromantik.enums;
* Cette classe permet de récupérer le chemin d'accès au fichier sonore associé.
*
* @version 1.0
* @author Lenny FOULOU
* @author Moncef STITI
*/
public enum Sounds {
/**

View File

@@ -120,7 +120,8 @@ public class TutorialPanel extends JPanel {
private void updateStepDisplay() {
Step currentStep = steps.get(currentStepIndex);
stepText.setText(currentStep.getText());
String formattedText = addLineBreaks(currentStep.getText(), 10); // Limite à 10 mots par ligne
stepText.setText(formattedText);
stepImage.setIcon(new ImageIcon(currentStep.getImagePath()));
stepImage.setHorizontalAlignment(JLabel.CENTER);
stepImage.setVerticalAlignment(JLabel.CENTER);
@@ -128,6 +129,7 @@ public class TutorialPanel extends JPanel {
nextButton.setEnabled(currentStepIndex < steps.size() - 1);
}
private void styleButton(JButton button) {
// Police et taille
button.setFont(new Font("Arial", Font.BOLD, 18));
@@ -177,4 +179,22 @@ public class TutorialPanel extends JPanel {
return returnButton;
}
private String addLineBreaks(String text, int maxWordsPerLine) {
String[] words = text.split(" ");
StringBuilder formattedText = new StringBuilder("<html>");
int wordCount = 0;
for (String word : words) {
formattedText.append(word).append(" ");
wordCount++;
if (wordCount >= maxWordsPerLine) {
formattedText.append("<br>");
wordCount = 0;
}
}
formattedText.append("</html>");
return formattedText.toString();
}
}