Ejemplo n.º 1
0
        void buttonBuild(Form form)
        {
            allLocations = new AllLocations();
            List <Location> locations = allLocations.getAllLocations();

            foreach (Location location in locations)
            {
                Button button = new Button();
                button.Text  = location.name;
                button.Top   = buttonStartX;
                button.Left  = buttonStartY;
                button.Width = buttonWidth;

                labelBuild(button, form, location);

                if (locationEnabled(location))
                {
                    button.Enabled = true;
                }
                else
                {
                    button.Enabled = false;
                }

                button.Click += (object sender, EventArgs e) =>
                {
                    new MainMenu().changeLocationLabel(location);
                    form.Hide();
                    LocationForm locationForm = new LocationForm(location);
                    this.travel.travelTo(location);
                    locationForm.Show();
                };

                form.Controls.Add(button);

                buttonStartX += 30;
            }
        }
Ejemplo n.º 2
0
 public void ShowStartForm()
 {
     locationForm = new LocationForm();
     locationForm.Init(GetForm("LocationForm", guiCanvasTransform));
     locationForm.Show();
 }