diff --git a/0 b/0 index d7619da..4588032 100644 --- a/0 +++ b/0 @@ -1 +1 @@ -Appuyez sur une touche pour continuer... \ No newline at end of file +Appuyez sur une touche pour continuer... diff --git a/main.cpp b/main.cpp index 4dc4d5d..8396696 100644 --- a/main.cpp +++ b/main.cpp @@ -28,6 +28,7 @@ int main() { while (quitter == false) { curseur(false); + backgroundDefault(); afficherMenu("AfficheMenu/Taxon.txt"); int choixMenu = _getch(); @@ -37,6 +38,8 @@ int main() { afficherMenu("AfficheMenu/TaxonOption1.txt"); delai(); curseur(true); + system("cls"); + background(temp); choisirMot("Mots/mot3lettres.txt", nbMot3lettre); break; @@ -44,6 +47,7 @@ int main() { afficherMenu("AfficheMenu/TaxonOption2.txt"); delai(); curseur(true); + system("cls"); temp = demanderBackground(); background(temp); break; diff --git a/mesFonctions.cpp b/mesFonctions.cpp index 21e727f..64be1c8 100644 --- a/mesFonctions.cpp +++ b/mesFonctions.cpp @@ -88,7 +88,6 @@ void curseur(bool interrupteur) { ====================================*/ //fonction pour choisir le mot de facon random void choisirMot(string nomFichier, int maximum) { - int numeroLigne = rand() % (maximum)+1; fstream monFlux; @@ -110,6 +109,7 @@ string goToLine(fstream& monFlux, int numeroLigne) { ====================================*/ void background(int couleur) { HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE); + switch (couleur) { case '1': SetConsoleTextAttribute(hConsole, BACKGROUND_RED | BACKGROUND_INTENSITY); @@ -141,8 +141,12 @@ void background(int couleur) { } int demanderBackground() { - system("cls"); cout << "Choix"; int choix = _getche(); return choix; +} + +void backgroundDefault() { + HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE); + SetConsoleTextAttribute(hConsole, 0x0F); } \ No newline at end of file diff --git a/mesFonctions.h b/mesFonctions.h index edc7744..428e6fb 100644 --- a/mesFonctions.h +++ b/mesFonctions.h @@ -26,6 +26,7 @@ void delai(); void curseur(bool interrupteur); void background(int couleur); int demanderBackground(); +void backgroundDefault(); // Mot void choisirMot(string nomFichier, int maximum);