Fix d'un bug suite au changement de la couleurs du background, lorsqu'on retourne dans le menu principal.

This commit is contained in:
2025-11-26 09:07:56 -05:00
parent a8121afad1
commit 97d72b9246
4 changed files with 12 additions and 3 deletions

View File

@@ -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);
}