Example #1
0
 public void animazioneFabbricaDaFuori()
 {
     animNegFab();
     mgzz = new Fabbrica();
     this.Close();
     mgzz.ShowDialog();
 }
Example #2
0
        private void buttonAzione_Click(object sender, EventArgs e)
        {
            if (Globals.listProdottiNegozio.Count == 0 || ProdottiFiniti())
            {
                this.Close();
                fabbr = new Fabbrica();
                fabbr.ShowDialog();
            }

            else
            {
                MessageBox.Show("Vai a Cliente");
            }
        }
Example #3
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();
            }
        }