示例#1
0
        //选择或变更图层
        private void OnSelectGrid(Grid SelectGrid, MapFloor floor)
        {
            if (!SelectGrid.floors.Contains(floor))
            {
                //添加到图层
                SelectGrid.floors.Add(floor);
                floor.grids.Add(SelectGrid);
            }
            if (floor.belongArea is MonsterPursuitArea)
            {
                SelectGrid.areaId = floor.ID;
                //给怪物区加上areaid
                foreach (var mz in DataHelper.Instance.AllMonsterZoneData.floors.Values)
                {
                    if (mz.X == SelectGrid.gridX && mz.Y == nImageGridNumY - SelectGrid.gridY)
                    {
                        (mz as MonsterFloor).PursuitId = floor.ID;
                    }
                }
            }

            if (floor is Path)
            {
                Path _path = floor as Path;
                _path.OnDrawKeyPoint(SelectGrid);
            }
        }
示例#2
0
 //取消选择图层
 private void CancelGrid(Grid SelectGrid, MapFloor floor)
 {
     if (SelectGrid.floors.Contains(floor))
     {
         //取消选择
         floor.grids.Remove(SelectGrid);
         SelectGrid.floors.Remove(floor);
     }
 }
示例#3
0
 //选择或变更图层
 private void OnSelectGrid(Grid SelectGrid, MapFloor floor)
 {
     if (!SelectGrid.floors.Contains(floor))
     {
         //添加到图层
         SelectGrid.floors.Add(floor);
         floor.grids.Add(SelectGrid);
     }
 }
示例#4
0
        public override MapFloor AddMapFloor()
        {
            var floor = new MapFloor(this)
            {
                ID = AutoID,
            };

            floor.Text = Text + floor.ID.ToString();

            floors.Add(floor.ID, floor);
            return(floor);
        }
示例#5
0
 private void checkTrigger_CheckedChanged(object sender, EventArgs e)
 {
     if (checkTrigger.Checked)
     {
         checkObs.Checked = false;
         CurrentMapFloor  = TriggerFloor;
     }
     else
     {
         checkObs.Checked = true;
         CurrentMapFloor  = ObstructionFloor;
     }
 }
示例#6
0
        MapFloor FindMapFloor(TreeNode node)
        {
            var area = FindMapArea(node.Parent);

            if (area != null)
            {
                MapFloor floor = null;
                if (area.floors.TryGetValue(int.Parse(node.Name), out floor))
                {
                    return(floor);
                }
            }
            return(null);
        }
示例#7
0
        private void 打开图片ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DlgFileOpen.Filter = "png|*.png|jpg|*.jpg|bmp|*.bmp|所有文件|*.*";
            DialogResult r = DlgFileOpen.ShowDialog();

            if (r == DialogResult.OK)
            {
                if (File.Exists(DlgFileOpen.FileName))
                {
                    TheImage = Image.FromFile(DlgFileOpen.FileName);
                    if (TheImage.Size != DisplayArea.Size)
                    {
                        MessageBox.Show($"导入图片必须是[{DisplayArea.Width}x{DisplayArea.Height}]像素大小!");
                        return;
                    }
                    //CurrentMapFloor = new MapFloor(CurrentMapArea);
                    CurrentMapFloor = ObstructionFloor;
                    XmlHelper.Instance.ImageFileName = DlgFileOpen.FileName;
                }
            }
            Invalidate();
        }
示例#8
0
 public void AddMapFloor(MapFloor floor)
 {
     floors.Add(floor.ID, floor);
     _autoid = Math.Max(_autoid, floor.ID) + 1;
 }