Example #1
0
 public MapAreaSelectForm(Guid map_id, Guid map_area_id)
 {
     this.InitializeComponent();
     Application.Idle       += new EventHandler(this.Application_Idle);
     this.UseTileBtn.Visible = this.map_tiles_exist();
     this.MapBox.Items.Add("(no map)");
     foreach (Masterplan.Data.Map map in Session.Project.Maps)
     {
         this.MapBox.Items.Add(map);
     }
     Masterplan.Data.Map map1 = Session.Project.FindTacticalMap(map_id);
     if (map1 == null)
     {
         this.MapBox.SelectedIndex = 0;
         this.AreaBox.Items.Add("(no map)");
         this.AreaBox.SelectedIndex = 0;
         return;
     }
     this.MapBox.SelectedItem = map1;
     Masterplan.Data.MapArea mapArea = map1.FindArea(map_area_id);
     if (mapArea != null)
     {
         this.AreaBox.SelectedItem = mapArea;
         return;
     }
     this.AreaBox.SelectedIndex = 0;
 }
Example #2
0
        /// <summary>
        /// Gets the tactical map and map area associated with the point, if any.
        /// </summary>
        /// <param name="map">The map associated with the point.</param>
        /// <param name="map_area">The map area associated with the point.</param>
        public void GetTacticalMapArea(ref Map map, ref MapArea map_area)
        {
            Guid map_id      = Guid.Empty;
            Guid map_area_id = Guid.Empty;

            Encounter enc = fElement as Encounter;

            if (enc != null)
            {
                map_id      = enc.MapID;
                map_area_id = enc.MapAreaID;
            }

            SkillChallenge sc = fElement as SkillChallenge;

            if (sc != null)
            {
                map_id      = sc.MapID;
                map_area_id = sc.MapAreaID;
            }

            TrapElement te = fElement as TrapElement;

            if (te != null)
            {
                map_id      = te.MapID;
                map_area_id = te.MapAreaID;
            }

            MapElement me = fElement as MapElement;

            if (me != null)
            {
                map_id      = me.MapID;
                map_area_id = me.MapAreaID;
            }

            if ((map_id != Guid.Empty) && (map_area_id != Guid.Empty))
            {
                map = Session.Project.FindTacticalMap(map_id);
                if (map != null)
                {
                    map_area = map.FindArea(map_area_id);
                }
            }
        }
Example #3
0
        public void GetTacticalMapArea(ref Map map, ref MapArea map_area)
        {
            Guid      empty     = Guid.Empty;
            Guid      mapAreaID = Guid.Empty;
            Encounter encounter = this.fElement as Encounter;

            if (encounter != null)
            {
                empty     = encounter.MapID;
                mapAreaID = encounter.MapAreaID;
            }
            SkillChallenge skillChallenge = this.fElement as SkillChallenge;

            if (skillChallenge != null)
            {
                empty     = skillChallenge.MapID;
                mapAreaID = skillChallenge.MapAreaID;
            }
            TrapElement trapElement = this.fElement as TrapElement;

            if (trapElement != null)
            {
                empty     = trapElement.MapID;
                mapAreaID = trapElement.MapAreaID;
            }
            MapElement mapElement = this.fElement as MapElement;

            if (mapElement != null)
            {
                empty     = mapElement.MapID;
                mapAreaID = mapElement.MapAreaID;
            }
            if (empty != Guid.Empty && mapAreaID != Guid.Empty)
            {
                map = Session.Project.FindTacticalMap(empty);
                if (map != null)
                {
                    map_area = map.FindArea(mapAreaID);
                }
            }
        }