//////////////////////////////////////////////////////////////////////// /// /// @fn private void Quitter() /// @brief Quitte le mode Jeu. /// /// @return Aucune. /// //////////////////////////////////////////////////////////////////////// public void Quitter() { FonctionsNatives.arreterToutSons(); // resetConfig(); Program.myCustomConsole.Hide(); this.Close(); }
//////////////////////////////////////////////////////////////////////// /// /// @fn private void PartieRapide_FormClosing(object sender, EventArgs e) /// @brief Evenement lorsqu'on ferme la form PartieRapide. /// @param[in] sender : Objet duquel provient un evenement. /// @param[in] e : evenement qui lance la fonction. /// @return Aucune. /// //////////////////////////////////////////////////////////////////////// private void PartieRapide_FormClosing(object sender, FormClosingEventArgs e) { FonctionsNatives.arreterToutSons(); lock (Program.unLock) { FonctionsNatives.libererOpenGL(); Program.peutAfficher = false; Program.tempBool = false; } Program.myCustomConsole.Hide(); }
//////////////////////////////////////////////////////////////////////// /// /// @fn private void ProchainePartie() /// @brief Chargement de la prochaine partie. /// @return Aucune. /// //////////////////////////////////////////////////////////////////////// private void ProchainePartie() { FonctionsNatives.arreterToutSons(); boolTemp = false; peutAnimer = false; map = new StringBuilder(myMaps[currentZone]); nextMap = new StringBuilder(map.ToString()); nextMap.Remove(nextMap.Length - 4, 4); System.Threading.Thread.Sleep(500); zInfo = new ZoneInfo(Path.GetFileName(nextMap.ToString()), FonctionsNatives.obtenirDifficulte(map, map.Capacity).ToString(), true); Program.myCustomConsole.Hide(); this.Hide(); zInfo.ShowDialog(); this.Show(); Program.myCustomConsole.Show(); if (Program.mMenu.modeJeuMain != null) { FonctionsNatives.arreterToutSons(); Program.myCustomConsole.Show(); Program.mMenu.modeJeuMain.Focus(); } FonctionsNatives.ouvrirXML(map, map.Capacity); FonctionsNatives.construireListesPalettes(); FonctionsNatives.resetNombreDePointsDePartie(); FonctionsNatives.resetNombreBillesCourantes(); FonctionsNatives.mettreAJourListeBillesEtNoeuds(); currentZone++; peutAnimer = true; boolTemp = true; FonctionsNatives.bouclerSon(bgm, bgm.Length); FonctionsNatives.ajusterVolume(bgm, bgm.Length, 90); FonctionsNatives.jouerSon(bgm, bgm.Length); /// La création de l'état s'occupe d'appeler resetConfig etat = new EtatJeuDebutDePartie(this); // Il faut changer le mode car le traitement de début est fini etat = new EtatJeuJouer(this); label_Nom.Text = "Nom: " + Path.GetFileNameWithoutExtension(map.ToString()); if (nbZones == 1) { this.Text = "Partie Rapide: " + Path.GetFileNameWithoutExtension(map.ToString()); } if (nbZones > 1) { this.Text = "Campagne: " + Path.GetFileNameWithoutExtension(map.ToString()); } }
//////////////////////////////////////////////////////////////////////// /// /// @fn private void FinCampagne(bool active, nbPoints) /// @brief Desactivation d'options en fin de campagne. /// @param[in] active : valeur d'activation. /// @param[in] nbPoints : nombre de points gagne. /// @return Aucune. /// //////////////////////////////////////////////////////////////////////// private void FinCampagne(bool active, int nbPoints) { if (active) { FonctionsNatives.jouerSon(winSound, winSound.Length); } FonctionsNatives.arreterToutSons(); Program.myCustomConsole.Hide(); peutAnimer = false; boolTemp = false; gameOver = new PartieTerminee(active, nbPoints); Program.myCustomConsole.Hide(); gameOver.ShowDialog(this); if (Program.mMenu.modeJeuMain != null) { Program.myCustomConsole.Show(); Program.mMenu.modeJeuMain.Focus(); } }
private void MainMenu_VisibleChanged(object sender, EventArgs e) { FonctionsNatives.arreterToutSons(); }