Exemple #1
0
        private void button12_Click(object sender, EventArgs e)
        {
            if (mission != null && comboBox1.SelectedItem != null)

                if (Mapview == null && mission.Teams.Count >= 2)
                {
                    mission.currrentteam = 1;
                    Global.Item = "Hedge2a";
                    var Hog = mission.Teams[mission.currrentteam].Hogs[0];
                    if (comboBox15.SelectedItem != null)
                        Hog.AssignHogData(textBox18.Text, comboBox15.SelectedItem.ToString().Split('.')[0], (int)numericUpDown27.Value, (int)numericUpDown26.Value);
                    else
                        Hog.AssignHogData(textBox18.Text, "4gsuif", (int)numericUpDown27.Value, (int)numericUpDown26.Value);
                    Mapview = new Map(mapbigfile, mission);
                    Mapview.LoadMapImage(mapbigfile);
                    Mapview.Show();
                    timer1.Start();
                    //MessageBox.Show(Hog.Id + "," + Hog.Name + "," + Hog.Health + "," + Hog.Hat);
                }

                else if (mission == null)
                    MessageBox.Show("No mission has been created");

                else if (mission.Terrain == null)
                    MessageBox.Show("No map has been created");

                else if (mission.teamscount == 0)

                    MessageBox.Show("The mission has no teams");

                else if (Mapview != null)
                {

                    mission.currrentteam = 1;
                    Global.Item = "Hedge2a";
                    var Hog = mission.Teams[mission.currrentteam].Hogs[0];
                    if (comboBox15.SelectedItem != null)
                        Hog.AssignHogData(textBox18.Text, comboBox15.SelectedItem.ToString().Split('.')[0], (int)numericUpDown27.Value, (int)numericUpDown26.Value);
                    else
                        Hog.AssignHogData(textBox18.Text, "4gsuif", (int)numericUpDown27.Value, (int)numericUpDown26.Value);
                    Mapview.LoadMapImage(mapbigfile);
                    Mapview.Show();
                    timer1.Start();
                }

                else
                    MessageBox.Show("No terrain image selected");
        }
Exemple #2
0
 private void button6_Click(object sender, EventArgs e)
 {
     if (Mapview == null)
     Mapview = new Map(mapbigfile, mission);
     Mapview.LoadMapImage(mapbigfile);
     //Mapview.Background = (Bitmap)Bitmap.FromFile(mapbigfile);
     Mapview.Show();
     Global.Item = "";
 }