validation pour le choix du thème et ajout d'un thème par défaut
This commit is contained in:
@@ -17,7 +17,7 @@ using namespace std;
|
||||
extern const int LARGTIC;
|
||||
string iconJ1 = "X";
|
||||
string iconJ2 = "O";
|
||||
string style = "themes/themeSea.txt";
|
||||
string style = "themes/themeDefaut.txt";
|
||||
int codeConsole = 0;
|
||||
|
||||
fstream monFlux;
|
||||
@@ -362,9 +362,10 @@ void changerLeTheme(bool& theme) {
|
||||
system("cls");
|
||||
do {
|
||||
cout << endl << "Changer le theme du jeu Tic Tac Toe" << endl
|
||||
<< "Options des styles: " << "\nA) Ocean"
|
||||
<< "Options des styles: " << "\n-------------------------------------"
|
||||
<< "\nA) Ocean"
|
||||
<< "\nB) Fantaisie" << "\nC) Espace"
|
||||
<< "\nD) Animaux" << "\nQ) Revenir en arriere"
|
||||
<< "\nD) Animaux" << "\nE) Defaut" << "\nQ) Revenir en arriere"
|
||||
<< "\nChoisir une option: ";
|
||||
choix = toupper(_getche());
|
||||
cout << endl;
|
||||
@@ -376,21 +377,87 @@ void changerLeTheme(bool& theme) {
|
||||
case 'A':
|
||||
style = "themes/themeSea.txt";
|
||||
afficherImageTableau(grid, style);
|
||||
|
||||
cout << "\n\nVoulez vous utiliser ce theme? ";
|
||||
choix = toupper(_getche());
|
||||
|
||||
if (choix == 'O') {
|
||||
style = "themes/themeSea.txt";
|
||||
}
|
||||
|
||||
else {
|
||||
style = "themes/themeDefaut.txt";
|
||||
cout << "Le theme par defaut sera choisi.";
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 'B':
|
||||
style = "themes/themeFantasy.txt";
|
||||
afficherImageTableau(grid, style);
|
||||
|
||||
cout << "\n\nVoulez vous utiliser ce theme? ";
|
||||
choix = toupper(_getche());
|
||||
|
||||
if (choix == 'O') {
|
||||
style = "themes/themeFantasy.txt";
|
||||
}
|
||||
|
||||
else {
|
||||
style = "themes/themeDefaut.txt";
|
||||
cout << "Le theme par defaut sera choisi.";
|
||||
}
|
||||
break;
|
||||
|
||||
case 'C':
|
||||
style = "themes/themeEspace.txt";
|
||||
afficherImageTableau(grid, style);
|
||||
|
||||
cout << "\n\nVoulez vous utiliser ce theme? ";
|
||||
choix = toupper(_getche());
|
||||
|
||||
if (choix == 'O') {
|
||||
style = "themes/themeEspace.txt";
|
||||
}
|
||||
|
||||
else {
|
||||
style = "themes/themeDefaut.txt";
|
||||
cout << "Le theme par defaut sera choisi.";
|
||||
}
|
||||
break;
|
||||
|
||||
case 'D':
|
||||
style = "themes/themeAnimaux.txt";
|
||||
afficherImageTableau(grid, style);
|
||||
|
||||
cout << "\n\nVoulez vous utiliser ce theme? ";
|
||||
choix = toupper(_getche());
|
||||
|
||||
if (choix == 'O') {
|
||||
style = "themes/themeAnimaux.txt";
|
||||
}
|
||||
|
||||
else {
|
||||
style = "themes/themeDefaut.txt";
|
||||
cout << "Le theme par defaut sera choisi.";
|
||||
}
|
||||
break;
|
||||
|
||||
case 'E':
|
||||
style = "themes/themeDefaut.txt";
|
||||
afficherImageTableau(grid, style);
|
||||
|
||||
cout << "\n\nVoulez vous utiliser ce theme? ";
|
||||
choix = toupper(_getche());
|
||||
|
||||
if (choix == 'O') {
|
||||
style = "themes/themeDefaut.txt";
|
||||
}
|
||||
|
||||
else {
|
||||
style = "themes/themeDefaut.txt";
|
||||
cout << "Le theme par defaut sera quand meme choisi.";
|
||||
}
|
||||
break;
|
||||
|
||||
case 'Q':
|
||||
|
||||
@@ -22,7 +22,6 @@ void afficherImageMenu(std::fstream& monFlux);
|
||||
|
||||
//G<>n<EFBFBD>ral
|
||||
void afficherImageTableau(std::string grid[][LARGTIC], std::string style);
|
||||
void changerLeTheme();
|
||||
void tourJoueur(std::string grid[][LARGTIC], int joueur); //pour savoir quel icon utiliser
|
||||
bool verifFinMatch(std::string grid[][LARGTIC]);
|
||||
void afficherFinMatch(std::string grid[][LARGTIC], int gagnant, int nbJoueurs);
|
||||
|
||||
Reference in New Issue
Block a user