private void buttonMenu_Click(object sender, EventArgs e) { // codice con buttonMappa /* if (Globals.statoGioco != 3) * { * if (Globals.listProdottiNegozio.Count == 0 || ProdottiFiniti()) * Globals.statoGioco = 1; * else * Globals.statoGioco = 2; * } * * //Globals.stampaProdottiNegozio(); * * this.Close(); * mappa = new Mappa(); * mappa.ShowDialog(); */ home = new HomePage(); this.Close(); home.ShowDialog(); }
private void buttonMenu_Click(object sender, EventArgs e) { // codice con buttonMappa /* if (Globals.statoGioco != 3) { if (Globals.listProdottiNegozio.Count == 0 || ProdottiFiniti()) Globals.statoGioco = 1; else Globals.statoGioco = 2; } //Globals.stampaProdottiNegozio(); this.Close(); mappa = new Mappa(); mappa.ShowDialog(); */ home = new HomePage(); this.Close(); home.ShowDialog(); }
private void OnClick(object sender, System.EventArgs e) { if (sender is System.Windows.Forms.Button) { System.Drawing.Color highlighting_color = Color.FromName(Globals.BUTTON_BACKGROUND_OK); switch (((System.Windows.Forms.Button)sender).Name) { case "menu": Globals.newGame = false; HomePage pagIniz = new HomePage(); this.Close(); pagIniz.ShowDialog(); break; case "si": si.BackColor = highlighting_color; no.BackColor = Color.FromName(Globals.BUTTON_BACKGROUND); risUtente = "si"; this.ok_1.Click += new System.EventHandler(this.OnClick); break; case "no": no.BackColor = highlighting_color; si.BackColor = Color.FromName(Globals.BUTTON_BACKGROUND); risUtente = "no"; this.ok_1.Click += new System.EventHandler(this.OnClick); break; case "ok_1": if(page == 1) { if (risUtente == "si") { smile.Visible = true; nosmile.Visible = false; smile2.Visible = false; nosmile2.Visible = false; pagina_ok = true; } else if (risUtente == "no") { nosmile.Visible = true; smile.Visible = false; smile2.Visible = false; nosmile2.Visible = false; pagina_ok = false; } } break; case "ok_2": spesa = Globals.soldiPrima - Globals.soldiDopo; guadagno = Globals.soldiDopoVendita - Globals.soldiPrima + Globals.soldiDopo; val_4 = Val_porta_4(); if(page == 2) { if(spesa == val_4) { ok_2.Visible = false; testo.Visible = true; //XXXXXX false; ok_3.Visible = true; testo2.Visible = true; risposta.Visible = true; smile.Visible = true; nosmile.Visible = false; smile2.Visible = false; nosmile2.Visible = false; } else { nosmile.Visible = true; smile.Visible = false; smile2.Visible = false; nosmile2.Visible = false; } } else if(page == 3) { if(guadagno == val_4) { ok_2.Visible = false; testo.Visible = true; //XXXXXX false; ok_3.Visible = true; testo2.Visible = true; risposta.Visible = true; smile.Visible = true; nosmile.Visible = false; smile2.Visible = false; nosmile2.Visible = false; } else { nosmile.Visible = true; smile.Visible = false; smile2.Visible = false; nosmile2.Visible = false; } } break; case "ok_3": spesa = Globals.soldiPrima - Globals.soldiDopo; guadagno = Globals.soldiDopoVendita - Globals.soldiPrima + Globals.soldiDopo; val_4 = Val_porta_4(); risp = System.Convert.ToDouble(risposta.Text); if(page == 2) { if(risp == val_4) { ok_2.Visible = false; testo.Visible = true; //XXXXXX false; ok_3.Visible = true; testo2.Visible = true; risposta.Visible = true; smile2.Visible = true; nosmile2.Visible = false; smile.Visible = false; nosmile.Visible = false; pagina_ok = true; } else { nosmile2.Visible = true; smile2.Visible = false; smile.Visible = false; nosmile.Visible = false; pagina_ok = false; } } else if(page == 3) { if(risp == val_4) { ok_2.Visible = false; testo.Visible = true; //XXXXXX false; ok_3.Visible = true; testo2.Visible = true; risposta.Visible = true; smile2.Visible = true; nosmile2.Visible = false; smile.Visible = false; nosmile.Visible = false; pagina_ok = true; } else { nosmile2.Visible = true; smile2.Visible = false; smile.Visible = false; nosmile.Visible = false; pagina_ok = false; } } break; case "avanti": if(pagina_ok == true) { if(page == 1) { // nonSo = new NonSo(2); nonSo = new NonSo(2); nonSo.ShowDialog(); this.Close(); } else if(page == 2) { nonSo = new NonSo(3); nonSo.ShowDialog(); this.Close(); } else if(page == 3) { this.Close(); } } break; } } }
// funzione Temp di test private void button_Menu_MouseClick(object sender, MouseEventArgs e) { // codice con button_Mappa /* aggiorna_lista_prodotti(); Globals.soldiDopo = Globals.GetSoldiPortafoglio(); this.Close(); mappa = new Mappa(); mappa.ShowDialog(); System.Console.WriteLine("SONO NELLA FABBRICA E CLICCO MAPPA"); //Globals.stampaProdottiNegozio(); System.Console.WriteLine("PRODOTTI STAMPATI"); */ this.Close(); home = new HomePage(); home.ShowDialog(); }
private void buttonMenu_Click(object sender, EventArgs e) { this.Close(); home = new HomePage(); home.ShowDialog(); }
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(); } }
/// <summary> /// Metodo che fa ritornare al menu principale dopo il click su Menu /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void MenuButton_Click(object sender, EventArgs e) { Globals.newGame = false; HomePage pagIniz = new HomePage(); this.Close(); pagIniz.ShowDialog(); }
private void onClick(object sender, EventArgs e) { if (sender is Button) { System.Drawing.Color color = Color.FromName(Globals.BUTTON_BACKGROUND_OK); switch (((Button)sender).Name) { case "bOpt1": risUtente = 1; bOpt1.BackColor = color; bOpt2.BackColor = Color.FromName(Globals.BUTTON_BACKGROUND); bOpt3.BackColor = Color.FromName(Globals.BUTTON_BACKGROUND); break; case "bOpt2": risUtente = 2; bOpt2.BackColor = color; bOpt1.BackColor = Color.FromName(Globals.BUTTON_BACKGROUND); bOpt3.BackColor = Color.FromName(Globals.BUTTON_BACKGROUND); break; case "bOpt3": risUtente = 3; bOpt3.BackColor = color; bOpt1.BackColor = Color.FromName(Globals.BUTTON_BACKGROUND); bOpt2.BackColor = Color.FromName(Globals.BUTTON_BACKGROUND); break; case "ok": if (risUtente == risCorretta) { smile.Image = global::Negozio_di_Viola.Properties.Resources.SmileFelice; bOpt1.Click -= new System.EventHandler(this.onClick); bOpt2.Click -= new System.EventHandler(this.onClick); bOpt3.Click -= new System.EventHandler(this.onClick); this.avanti.Click += new System.EventHandler(this.onClick); } else { if (pagina == 1) { this.avanti.Click -= new System.EventHandler(this.onClick); } else if (pagina == 2) { bOpt1.Click -= new System.EventHandler(this.onClick); bOpt2.Click -= new System.EventHandler(this.onClick); bOpt3.Click -= new System.EventHandler(this.onClick); } smile.Image = global::Negozio_di_Viola.Properties.Resources.SmileTriste; } break; case "avanti": { this.Close(); if (pagina == 1) { if (risUtente == risCorretta) { fumetto = new Fumetto(2); } else { fumetto = new Fumetto(22); } fumetto.ShowDialog(); this.Close(); } else if (pagina == 22) { fumetto = new Fumetto(2); fumetto.ShowDialog(); this.Close(); } else if (pagina == 2 && risUtente != risCorretta) { Globals.statoGioco = 3; fumetto = new Fumetto(3); fumetto.ShowDialog(); this.Close(); } else if (pagina == 2 && risUtente == risCorretta) { Globals.statoGioco = 3; fumetto = new Fumetto(4); fumetto.ShowDialog(); this.Close(); } else { Globals.statoGioco = 3; Negozio2.enabledClick = true; Globals.visualizzaDialogo = false; negozio = new Negozio2(); negozio.ShowDialog(); this.Close(); } break; } case "indietro": negozio1 = new Negozio1(); negozio1.ShowDialog(); this.Close(); break; case "menu": Globals.newGame = false; HomePage pagIniz = new HomePage(); this.Close(); pagIniz.ShowDialog(); break; case "esci": Application.Exit(); break; } } }
private void onClick(object sender, EventArgs e) { if(sender is Button) { System.Drawing.Color color = Color.FromName(Globals.BUTTON_BACKGROUND_OK); switch(((Button)sender).Name) { case "bOpt1": risUtente = 1; bOpt1.BackColor = color; bOpt2.BackColor = Color.FromName(Globals.BUTTON_BACKGROUND); bOpt3.BackColor = Color.FromName(Globals.BUTTON_BACKGROUND); break; case "bOpt2": risUtente = 2; bOpt2.BackColor = color; bOpt1.BackColor = Color.FromName(Globals.BUTTON_BACKGROUND); bOpt3.BackColor = Color.FromName(Globals.BUTTON_BACKGROUND); break; case "bOpt3": risUtente = 3; bOpt3.BackColor = color; bOpt1.BackColor = Color.FromName(Globals.BUTTON_BACKGROUND); bOpt2.BackColor = Color.FromName(Globals.BUTTON_BACKGROUND); break; case "ok": if(risUtente == risCorretta) { smile.Image = global::Negozio_di_Viola.Properties.Resources.SmileFelice; bOpt1.Click -= new System.EventHandler(this.onClick); bOpt2.Click -= new System.EventHandler(this.onClick); bOpt3.Click -= new System.EventHandler(this.onClick); this.avanti.Click += new System.EventHandler(this.onClick); } else { if(pagina == 1) this.avanti.Click -= new System.EventHandler(this.onClick); else if (pagina == 2) { bOpt1.Click -= new System.EventHandler(this.onClick); bOpt2.Click -= new System.EventHandler(this.onClick); bOpt3.Click -= new System.EventHandler(this.onClick); } smile.Image = global::Negozio_di_Viola.Properties.Resources.SmileTriste; } break; case "avanti": { this.Close(); if (pagina == 1) { if (risUtente == risCorretta) fumetto = new Fumetto(2); else fumetto = new Fumetto(22); fumetto.ShowDialog(); this.Close(); } else if (pagina == 22) { fumetto = new Fumetto(2); fumetto.ShowDialog(); this.Close(); } else if (pagina == 2 && risUtente != risCorretta) { Globals.statoGioco = 3; fumetto = new Fumetto(3); fumetto.ShowDialog(); this.Close(); } else if(pagina == 2 && risUtente == risCorretta) { Globals.statoGioco = 3; fumetto = new Fumetto(4); fumetto.ShowDialog(); this.Close(); } else { Globals.statoGioco = 3; Negozio2.enabledClick = true; Globals.visualizzaDialogo = false; negozio = new Negozio2(); negozio.ShowDialog(); this.Close(); } break; } case "indietro": negozio1 = new Negozio1(); negozio1.ShowDialog(); this.Close(); break; case "menu": Globals.newGame = false; HomePage pagIniz = new HomePage(); this.Close(); pagIniz.ShowDialog(); break; case "esci": Application.Exit(); break; } } }
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(); } }