Fix d'un bug suite au changement de la couleurs du background, lorsqu'on retourne dans le menu principal.
This commit is contained in:
4
main.cpp
4
main.cpp
@@ -28,6 +28,7 @@ int main() {
|
|||||||
|
|
||||||
while (quitter == false) {
|
while (quitter == false) {
|
||||||
curseur(false);
|
curseur(false);
|
||||||
|
backgroundDefault();
|
||||||
afficherMenu("AfficheMenu/Taxon.txt");
|
afficherMenu("AfficheMenu/Taxon.txt");
|
||||||
|
|
||||||
int choixMenu = _getch();
|
int choixMenu = _getch();
|
||||||
@@ -37,6 +38,8 @@ int main() {
|
|||||||
afficherMenu("AfficheMenu/TaxonOption1.txt");
|
afficherMenu("AfficheMenu/TaxonOption1.txt");
|
||||||
delai();
|
delai();
|
||||||
curseur(true);
|
curseur(true);
|
||||||
|
system("cls");
|
||||||
|
background(temp);
|
||||||
choisirMot("Mots/mot3lettres.txt", nbMot3lettre);
|
choisirMot("Mots/mot3lettres.txt", nbMot3lettre);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -44,6 +47,7 @@ int main() {
|
|||||||
afficherMenu("AfficheMenu/TaxonOption2.txt");
|
afficherMenu("AfficheMenu/TaxonOption2.txt");
|
||||||
delai();
|
delai();
|
||||||
curseur(true);
|
curseur(true);
|
||||||
|
system("cls");
|
||||||
temp = demanderBackground();
|
temp = demanderBackground();
|
||||||
background(temp);
|
background(temp);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -88,7 +88,6 @@ void curseur(bool interrupteur) {
|
|||||||
====================================*/
|
====================================*/
|
||||||
//fonction pour choisir le mot de facon random
|
//fonction pour choisir le mot de facon random
|
||||||
void choisirMot(string nomFichier, int maximum) {
|
void choisirMot(string nomFichier, int maximum) {
|
||||||
|
|
||||||
int numeroLigne = rand() % (maximum)+1;
|
int numeroLigne = rand() % (maximum)+1;
|
||||||
|
|
||||||
fstream monFlux;
|
fstream monFlux;
|
||||||
@@ -110,6 +109,7 @@ string goToLine(fstream& monFlux, int numeroLigne) {
|
|||||||
====================================*/
|
====================================*/
|
||||||
void background(int couleur) {
|
void background(int couleur) {
|
||||||
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
|
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||||
|
|
||||||
switch (couleur) {
|
switch (couleur) {
|
||||||
case '1':
|
case '1':
|
||||||
SetConsoleTextAttribute(hConsole, BACKGROUND_RED | BACKGROUND_INTENSITY);
|
SetConsoleTextAttribute(hConsole, BACKGROUND_RED | BACKGROUND_INTENSITY);
|
||||||
@@ -141,8 +141,12 @@ void background(int couleur) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int demanderBackground() {
|
int demanderBackground() {
|
||||||
system("cls");
|
|
||||||
cout << "Choix";
|
cout << "Choix";
|
||||||
int choix = _getche();
|
int choix = _getche();
|
||||||
return choix;
|
return choix;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void backgroundDefault() {
|
||||||
|
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||||
|
SetConsoleTextAttribute(hConsole, 0x0F);
|
||||||
|
}
|
||||||
@@ -26,6 +26,7 @@ void delai();
|
|||||||
void curseur(bool interrupteur);
|
void curseur(bool interrupteur);
|
||||||
void background(int couleur);
|
void background(int couleur);
|
||||||
int demanderBackground();
|
int demanderBackground();
|
||||||
|
void backgroundDefault();
|
||||||
|
|
||||||
// Mot
|
// Mot
|
||||||
void choisirMot(string nomFichier, int maximum);
|
void choisirMot(string nomFichier, int maximum);
|
||||||
|
|||||||
Reference in New Issue
Block a user