private void partieSimpleClosed(object sender, FormClosedEventArgs e) { Program.menuPrincipal.Show(); FonctionsNatives.desactiverSon(); FonctionsNatives.affichageTexte(); panel2.SetBounds(panel2.Bounds.X, panel2.Bounds.Y, 1214, 753, BoundsSpecified.Location); this.Close(); }
private void menuPrincipalToolStripMenuItem_Click(object sender, EventArgs e) { this.DialogResult = DialogResult.No; Program.menuPrincipal.Show(); FonctionsNatives.desactiverSon(); FonctionsNatives.affichageTexte(); panel2.SetBounds(panel2.Bounds.X, panel2.Bounds.Y, 1214, 753, BoundsSpecified.Location); this.Close(); }
/// <summary> /// Cette methode configure la Campagne selon la configuration de partieRapide /// recu en parametre /// /// </summary> /// <param name="config">configuration qui inclus tout ce que la campagne /// a besoin pour se configurer</param> /// /// <returns></returns> private void chargerZone(ZoneDeJeux zone) { //initialise l'arbre if (!FonctionsNatives.lireXML(zone.path_.ToCharArray(0, zone.path_.Length))) { MessageBox.Show("La zone par défaut seras chargé ", "Zone de jeux inexistante!", MessageBoxButtons.OK); string zoneDefault = Application.StartupPath + @"\zones\default.xml" + "\0"; if (!FonctionsNatives.lireXML(zoneDefault.ToCharArray(0, zoneDefault.Length))) { MessageBox.Show("Probleme avec la zoneDefault", "Zone par défault introuvalbe!", MessageBoxButtons.OK); FonctionsNatives.desactiverSon(); panel2.SetBounds(panel2.Bounds.X, panel2.Bounds.Y, 1214, 753, BoundsSpecified.Location); this.Close(); } } //initialise le nombre de billes dans l'arbre FonctionsNatives.assignerNbBillesInitial(configSimple_.billesInitialles_); //initialise points Zone Suivante dans l'arbre }
public void MettreAJour(double tempsInterAffichage) { try { if (isActive) { FonctionsNatives.redimensionnerFenetre(panel2.Width, panel2.Height); } this.Invoke((MethodInvoker) delegate { //si la zone est réussi if (FonctionsNatives.victoire() == 1) { this.DialogResult = DialogResult.OK; FonctionsNatives.desactiverSon(); FonctionsNatives.libererOpenGL(); isActive = false; this.Close(); } //si la zone est échoué else if (FonctionsNatives.gameOver() == 1) { this.DialogResult = DialogResult.No; FonctionsNatives.desactiverSon(); FonctionsNatives.libererOpenGL(); isActive = false; this.Close(); } if (!pause) { FonctionsNatives.animer(tempsInterAffichage); } FonctionsNatives.dessinerOpenGL(); }); } catch (Exception) { } }