public MapLocationSelectForm(Guid map_id, Guid map_location_id)
        {
            this.InitializeComponent();
            Application.Idle += new EventHandler(this.Application_Idle);
            this.MapBox.Items.Add("(no map)");
            foreach (RegionalMap regionalMap in Session.Project.RegionalMaps)
            {
                this.MapBox.Items.Add(regionalMap);
            }
            RegionalMap regionalMap1 = Session.Project.FindRegionalMap(map_id);

            if (regionalMap1 == null)
            {
                this.MapBox.SelectedIndex = 0;
                this.LocationBox.Items.Add("(no map)");
                this.LocationBox.SelectedIndex = 0;
                return;
            }
            this.MapBox.SelectedItem = regionalMap1;
            Masterplan.Data.MapLocation mapLocation = regionalMap1.FindLocation(map_location_id);
            if (mapLocation != null)
            {
                this.LocationBox.SelectedItem = mapLocation;
                return;
            }
            this.LocationBox.SelectedIndex = 0;
        }
Example #2
0
 public MapLocationForm(Masterplan.Data.MapLocation loc)
 {
     this.InitializeComponent();
     this.CatBox.Items.Add("City");
     this.CatBox.Items.Add("Town");
     this.CatBox.Items.Add("Lake");
     this.CatBox.Items.Add("Port");
     this.CatBox.Items.Add("Mountain");
     this.CatBox.Items.Add("Volcano");
     this.CatBox.Items.Add("Chasm");
     this.CatBox.Items.Add("Sinkhole");
     this.CatBox.Items.Add("Cavern");
     this.CatBox.Items.Add("Marsh");
     this.CatBox.Items.Add("Swamp");
     this.CatBox.Items.Add("Fen");
     this.CatBox.Items.Add("Desert");
     this.CatBox.Items.Add("River");
     this.CatBox.Items.Add("Waterfall");
     this.CatBox.Items.Add("Ruin");
     this.CatBox.Items.Add("Outpost");
     this.CatBox.Items.Add("Inn");
     this.CatBox.Items.Add("Tower");
     this.CatBox.Items.Add("Barracks");
     this.CatBox.Items.Add("Hall");
     this.CatBox.Items.Add("Shop");
     this.CatBox.Items.Add("Market");
     this.CatBox.Items.Add("Gate");
     this.CatBox.Items.Add("Stables");
     this.CatBox.Items.Add("Warehouse");
     this.CatBox.Items.Add("Temple");
     this.fLocation    = loc;
     this.NameBox.Text = this.fLocation.Name;
     this.CatBox.Text  = this.fLocation.Category;
 }
        private void show_map()
        {
            RegionalMap selectedItem = this.MapBox.SelectedItem as RegionalMap;

            if (selectedItem == null)
            {
                this.MapPanel.Map = null;
                return;
            }
            this.MapPanel.Map = selectedItem;
            Masterplan.Data.MapLocation mapLocation = this.LocationBox.SelectedItem as Masterplan.Data.MapLocation;
            this.MapPanel.HighlightedLocation = mapLocation;
        }