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;
|
extern const int LARGTIC;
|
||||||
string iconJ1 = "X";
|
string iconJ1 = "X";
|
||||||
string iconJ2 = "O";
|
string iconJ2 = "O";
|
||||||
string style = "themes/themeSea.txt";
|
string style = "themes/themeDefaut.txt";
|
||||||
int codeConsole = 0;
|
int codeConsole = 0;
|
||||||
|
|
||||||
fstream monFlux;
|
fstream monFlux;
|
||||||
@@ -362,9 +362,10 @@ void changerLeTheme(bool& theme) {
|
|||||||
system("cls");
|
system("cls");
|
||||||
do {
|
do {
|
||||||
cout << endl << "Changer le theme du jeu Tic Tac Toe" << endl
|
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"
|
<< "\nB) Fantaisie" << "\nC) Espace"
|
||||||
<< "\nD) Animaux" << "\nQ) Revenir en arriere"
|
<< "\nD) Animaux" << "\nE) Defaut" << "\nQ) Revenir en arriere"
|
||||||
<< "\nChoisir une option: ";
|
<< "\nChoisir une option: ";
|
||||||
choix = toupper(_getche());
|
choix = toupper(_getche());
|
||||||
cout << endl;
|
cout << endl;
|
||||||
@@ -376,21 +377,87 @@ void changerLeTheme(bool& theme) {
|
|||||||
case 'A':
|
case 'A':
|
||||||
style = "themes/themeSea.txt";
|
style = "themes/themeSea.txt";
|
||||||
afficherImageTableau(grid, style);
|
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;
|
break;
|
||||||
|
|
||||||
case 'B':
|
case 'B':
|
||||||
style = "themes/themeFantasy.txt";
|
style = "themes/themeFantasy.txt";
|
||||||
afficherImageTableau(grid, style);
|
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;
|
break;
|
||||||
|
|
||||||
case 'C':
|
case 'C':
|
||||||
style = "themes/themeEspace.txt";
|
style = "themes/themeEspace.txt";
|
||||||
afficherImageTableau(grid, style);
|
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;
|
break;
|
||||||
|
|
||||||
case 'D':
|
case 'D':
|
||||||
style = "themes/themeAnimaux.txt";
|
style = "themes/themeAnimaux.txt";
|
||||||
afficherImageTableau(grid, style);
|
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;
|
break;
|
||||||
|
|
||||||
case 'Q':
|
case 'Q':
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ void afficherImageMenu(std::fstream& monFlux);
|
|||||||
|
|
||||||
//G<>n<EFBFBD>ral
|
//G<>n<EFBFBD>ral
|
||||||
void afficherImageTableau(std::string grid[][LARGTIC], std::string style);
|
void afficherImageTableau(std::string grid[][LARGTIC], std::string style);
|
||||||
void changerLeTheme();
|
|
||||||
void tourJoueur(std::string grid[][LARGTIC], int joueur); //pour savoir quel icon utiliser
|
void tourJoueur(std::string grid[][LARGTIC], int joueur); //pour savoir quel icon utiliser
|
||||||
bool verifFinMatch(std::string grid[][LARGTIC]);
|
bool verifFinMatch(std::string grid[][LARGTIC]);
|
||||||
void afficherFinMatch(std::string grid[][LARGTIC], int gagnant, int nbJoueurs);
|
void afficherFinMatch(std::string grid[][LARGTIC], int gagnant, int nbJoueurs);
|
||||||
|
|||||||
Reference in New Issue
Block a user