Ejemplo n.º 1
0
        private void buttonEsci_Click(object sender, EventArgs e)
        {
            this.Close();
            cln = new Cliente();
            cln.ShowDialog();

        }
Ejemplo n.º 2
0
        private void onClick(object sender, EventArgs e)
        {            
            if (sender is Button)
            {                
                if(timer1 != null)

                    timer1.Stop();

                if (timer2 != null)
                
                    timer2.Stop();

                this.SuspendLayout();
                textBox.Hide();
                this.ResumeLayout(false);

                switch (((Button)sender).Name)
                {
                    case "negozio":

                        //if(Globals.statoGioco == 5)
                        //{
                          //  this.Close();
                        //}

//                        else
  //                      {
                            this.pictureBox3.Visible = false;

                            if (!HomePage.newGame)
                            {
                                animFabNeg();
                            }

                            else

                                HomePage.newGame = false;

                            pictureBox2.Visible = false;
                            this.Close();

                           /* if(Globals.statoGioco == 0 || !Globals.visualizzaDialogo)
                            {
                                ngz2 = new Negozio2();
                                ngz2.ShowDialog();
                            }

                            else
                            {
                                ngz1 = new Negozio1();
                                ngz1.ShowDialog();
                            }*/

                            if (Globals.visualizzaDialogo)
                            {
                                if (Globals.Livello == 6)
                                {
                                    ngz3 = new Negozio3();
                                    ngz3.ShowDialog();
                                }
                                else
                                {
                                    ngz1 = new Negozio1();
                                    ngz1.ShowDialog();
                                }
                            }

                            else
                            {
                                ngz2 = new Negozio2();
                                ngz2.ShowDialog();
                            }
    //                    }

                        break;

                    case "fabbrica":

                        this.pictureBox3.Visible = false;
                        animNegFab();
                        mgzz = new Fabbrica();
                        this.Close();
                        mgzz.ShowDialog();

                        break;

                    case "cliente1":

                        this.pictureBox3.Visible = false;
           
                        if (Globals.statoGioco == 3)
                        {
                            //Globals.statoGioco = 2;
                            Globals.statoGioco = 5;
                            animClNeg1();
                            cl = new Cliente();
                            this.Close();
                            cl.ShowDialog();
                        }

                        break;

                    case "cliente2":

                        this.pictureBox3.Visible = false;
            
                        if (Globals.statoGioco == 3)
                        {
                            //Globals.statoGioco = 2;
                            Globals.statoGioco = 5;
                            animClNeg2();
                            cl = new Cliente();
                            this.Close();
                            cl.ShowDialog();
                        }

                        break;

                    case "cliente3":

                        this.pictureBox3.Visible = false;
            
                        if (Globals.statoGioco == 3)
                        {
                            //Globals.statoGioco = 2;
                            Globals.statoGioco = 5;
                            animClNeg3();
                            cl = new Cliente();
                            this.Close();
                            cl.ShowDialog();
                        }

                        break;

                    case "bHome":

                        Globals.newGame = false;
                        pagIniz = new HomePage();
                        this.Close();
                        pagIniz.ShowDialog();

                        break;

                    case "bChiamaCliente":

                        Globals.statoGioco = 3;
                        Mappa mappa = new Mappa();
                        this.Close();
                        mappa.ShowDialog();
                        //animazioneClienteDaFuori();

                        break;

                    case "bEsci":

                        Application.Exit();

                        break;
                }

                this.Close();
            }
        }
Ejemplo n.º 3
0
 public void animazioneClienteDaFuori()
 {
     int i = Globals.global_rnd.Next(2);
     switch (i)
     {
         case 0: animClNeg1();
             break;
         case 1: animClNeg2();
             break;
         case 2: animClNeg3();
             break;                    
     }
     
     cl = new Cliente();
     this.Close();
     cl.ShowDialog();
 }