예제 #1
0
        private void btnVisualMapSelector_Click(object sender, EventArgs e)
        {
            var frmWarpSelection = new FrmWarpSelection();

            frmWarpSelection.SelectTile(
                MapList.OrderedMaps[cmbWarpMap.SelectedIndex].MapId, (int)nudWarpX.Value, (int)nudWarpY.Value
                );

            frmWarpSelection.ShowDialog();
            if (frmWarpSelection.GetResult())
            {
                cmbWarpMap.Items.Clear();
                for (var i = 0; i < MapList.OrderedMaps.Count; i++)
                {
                    cmbWarpMap.Items.Add(MapList.OrderedMaps[i].Name);
                }

                for (var i = 0; i < MapList.OrderedMaps.Count; i++)
                {
                    if (MapList.OrderedMaps[i].MapId == frmWarpSelection.GetMap())
                    {
                        cmbWarpMap.SelectedIndex = i;

                        break;
                    }
                }

                nudWarpX.Value = frmWarpSelection.GetX();
                nudWarpY.Value = frmWarpSelection.GetY();
            }
        }
예제 #2
0
        private void LinkMapItem_Click(object sender, EventArgs e)
        {
            var frmWarpSelection = new FrmWarpSelection();

            frmWarpSelection.InitForm(false, mLinkMaps);
            frmWarpSelection.ShowDialog();
            if (frmWarpSelection.GetResult())
            {
                //Make sure the selected tile is adjacent to a map
                var linkMapId     = frmWarpSelection.GetMap();
                var adjacentMapId = Guid.Empty;

                //Check Left
                if (mCurrentCellX > 1 && mCurrentCellY != 0 && mCurrentCellY - 1 < GridHeight)
                {
                    if (Grid[mCurrentCellX - 2, mCurrentCellY - 1].MapId != Guid.Empty)
                    {
                        adjacentMapId = Grid[mCurrentCellX - 2, mCurrentCellY - 1].MapId;
                    }
                }

                //Check Right
                if (mCurrentCellX < GridWidth && mCurrentCellY != 0 && mCurrentCellY - 1 < GridHeight)
                {
                    if (Grid[mCurrentCellX, mCurrentCellY - 1].MapId != Guid.Empty)
                    {
                        adjacentMapId = Grid[mCurrentCellX, mCurrentCellY - 1].MapId;
                    }
                }

                //Check Up
                if (mCurrentCellX != 0 && mCurrentCellY > 1 && mCurrentCellX - 1 < GridWidth)
                {
                    if (Grid[mCurrentCellX - 1, mCurrentCellY - 2].MapId != Guid.Empty)
                    {
                        adjacentMapId = Grid[mCurrentCellX - 1, mCurrentCellY - 2].MapId;
                    }
                }

                //Check Down
                if (mCurrentCellX != 0 && mCurrentCellY < GridHeight && mCurrentCellX - 1 < GridWidth)
                {
                    if (Grid[mCurrentCellX - 1, mCurrentCellY].MapId != Guid.Empty)
                    {
                        adjacentMapId = Grid[mCurrentCellX - 1, mCurrentCellY].MapId;
                    }
                }

                if (adjacentMapId != Guid.Empty)
                {
                    PacketSender.SendLinkMap(adjacentMapId, linkMapId, mCurrentCellX - 1, mCurrentCellY - 1);
                }
            }
        }
예제 #3
0
        private void btnSelectMap_Click(object sender, EventArgs e)
        {
            var frmWarpSelection = new FrmWarpSelection();

            frmWarpSelection.InitForm(false, null);
            frmWarpSelection.SelectTile((Guid)btnSelectMap.Tag, 0, 0);
            frmWarpSelection.TopMost = true;
            frmWarpSelection.ShowDialog();
            if (frmWarpSelection.GetResult())
            {
                btnSelectMap.Tag = frmWarpSelection.GetMap();
            }
        }
예제 #4
0
        private void btnVisual_Click(object sender, EventArgs e)
        {
            var frmWarpSelection = new FrmWarpSelection();

            frmWarpSelection.SelectTile(MapList.OrderedMaps[cmbMap.SelectedIndex].MapId, scrlX.Value, scrlY.Value);
            frmWarpSelection.ShowDialog();
            if (frmWarpSelection.GetResult())
            {
                for (var i = 0; i < MapList.OrderedMaps.Count; i++)
                {
                    if (MapList.OrderedMaps[i].MapId == frmWarpSelection.GetMap())
                    {
                        cmbMap.SelectedIndex = i;

                        break;
                    }
                }

                scrlX.Value = frmWarpSelection.GetX();
                scrlY.Value = frmWarpSelection.GetY();
                lblX.Text   = Strings.Warping.x.ToString(scrlX.Value);
                lblY.Text   = Strings.Warping.y.ToString(scrlY.Value);
            }
        }