Exemplo n.º 1
0
        public override void MouseUp(TileMouseState e)
        {
            if (!_rightClick)
            {
                return;
            }

            _rightClick = false;

            Tile curTile = _wvm.CurrentWorld.Tiles[e.Location.X, e.Location.Y];

            if (Tile.IsChest(curTile.Type))
            {
                Chest chest = _wvm.CurrentWorld.GetChestAtTile(e.Location.X, e.Location.Y);
                if (chest != null)
                {
                    _wvm.SelectedChest = chest.Copy();
                    return;
                }
            }
            else if (Tile.IsSign(curTile.Type))
            {
                Sign sign = _wvm.CurrentWorld.GetSignAtTile(e.Location.X, e.Location.Y);
                if (sign != null)
                {
                    _wvm.SelectedSign = sign.Copy();
                    return;
                }
            }
            else if (curTile.IsTileEntity())
            {
                TileEntity te = _wvm.CurrentWorld.GetTileEntityAtTile(e.Location.X, e.Location.Y);
                if (te != null)
                {
                    _wvm.SelectedTileEntity = te.Copy();
                }
            }
            else if (curTile.Type == (int)TileType.ChristmasTree)
            {
                Vector2Int32 XmasLocation = _wvm.CurrentWorld.GetXmas(e.Location.X, e.Location.Y);
                _wvm.SelectedXmasStar    = _wvm.CurrentWorld.Tiles[XmasLocation.X, XmasLocation.Y].V & 7;
                _wvm.SelectedXmasGarland = (_wvm.CurrentWorld.Tiles[XmasLocation.X, XmasLocation.Y].V >> 3) & 7;
                _wvm.SelectedXmasBulb    = (_wvm.CurrentWorld.Tiles[XmasLocation.X, XmasLocation.Y].V >> 6) & 0xf;
                _wvm.SelectedXmasLight   = (_wvm.CurrentWorld.Tiles[XmasLocation.X, XmasLocation.Y].V >> 10) & 0xf;
                _wvm.SelectedXmas        = XmasLocation;
            }
        }
Exemplo n.º 2
0
        public override void MouseUp(TileMouseState e)
        {
            if (!_rightClick)
            {
                return;
            }

            _rightClick = false;

            Tile curTile = _wvm.CurrentWorld.Tiles[e.Location.X, e.Location.Y];

            if (Tile.IsChest(curTile.Type))
            {
                Chest chest = _wvm.CurrentWorld.GetChestAtTile(e.Location.X, e.Location.Y);
                if (chest != null)
                {
                    _wvm.SelectedChest = chest.Copy();
                    return;
                }
            }
            else if (Tile.IsSign(curTile.Type))
            {
                Sign sign = _wvm.CurrentWorld.GetSignAtTile(e.Location.X, e.Location.Y);
                if (sign != null)
                {
                    _wvm.SelectedSign = sign.Copy();
                    return;
                }
            }
            else if (curTile.Type == (int)TileType.ItemFrame)
            {
                TileEntity frame = _wvm.CurrentWorld.GetTileEntityAtTile(e.Location.X, e.Location.Y);
                if (frame != null)
                {
                    _wvm.SelectedItemFrame = frame.Copy();
                    return;
                }
            }
            else if (curTile.Type == (int)TileType.Mannequin || curTile.Type == (int)TileType.Womannequin || curTile.Type == (int)TileType.DisplayDoll)
            {
                Vector2Int32 MannLocation = _wvm.CurrentWorld.GetMannequin(e.Location.X, e.Location.Y);
                _wvm.SelectedMannHead  = _wvm.CurrentWorld.Tiles[MannLocation.X, MannLocation.Y].U / 100;
                _wvm.SelectedMannBody  = _wvm.CurrentWorld.Tiles[MannLocation.X, MannLocation.Y + 1].U / 100;
                _wvm.SelectedMannLegs  = _wvm.CurrentWorld.Tiles[MannLocation.X, MannLocation.Y + 2].U / 100;
                _wvm.SelectedMannequin = MannLocation;
            }
            else if (curTile.Type == (int)TileType.WeaponRack || curTile.Type == (int)TileType.WeaponRack2)
            {
                Vector2Int32 RackLocation = _wvm.CurrentWorld.GetRack(e.Location.X, e.Location.Y);
                if (_wvm.CurrentWorld.Tiles[RackLocation.X, RackLocation.Y + 1].U >= 5000)
                {
                    _wvm.SelectedRackPrefix = (byte)(_wvm.CurrentWorld.Tiles[RackLocation.X + 1, RackLocation.Y + 1].U % 5000);
                    _wvm.SelectedRackNetId  = (_wvm.CurrentWorld.Tiles[RackLocation.X, RackLocation.Y + 1].U % 5000) - 100;
                }
                else
                {
                    _wvm.SelectedRackPrefix = 0;
                    _wvm.SelectedRackNetId  = 0;
                }
                _wvm.SelectedRack = RackLocation;
            }
            else if (curTile.Type == (int)TileType.ChristmasTree)
            {
                Vector2Int32 XmasLocation = _wvm.CurrentWorld.GetXmas(e.Location.X, e.Location.Y);
                _wvm.SelectedXmasStar    = _wvm.CurrentWorld.Tiles[XmasLocation.X, XmasLocation.Y].V & 7;
                _wvm.SelectedXmasGarland = (_wvm.CurrentWorld.Tiles[XmasLocation.X, XmasLocation.Y].V >> 3) & 7;
                _wvm.SelectedXmasBulb    = (_wvm.CurrentWorld.Tiles[XmasLocation.X, XmasLocation.Y].V >> 6) & 0xf;
                _wvm.SelectedXmasLight   = (_wvm.CurrentWorld.Tiles[XmasLocation.X, XmasLocation.Y].V >> 10) & 0xf;
                _wvm.SelectedXmas        = XmasLocation;
            }
        }
Exemplo n.º 3
0
        public override void MouseUp(TileMouseState e)
        {
            if (!_rightClick)
            {
                return;
            }

            _rightClick = false;

            Tile curTile = _wvm.CurrentWorld.Tiles[e.Location.X, e.Location.Y];

            if (Tile.IsChest(curTile.Type))
            {
                Chest chest = _wvm.CurrentWorld.GetChestAtTile(e.Location.X, e.Location.Y);
                if (chest != null)
                {
                    _wvm.SelectedChest = chest.Copy();
                    return;
                }
            }
            else if (Tile.IsSign(curTile.Type))
            {
                Sign sign = _wvm.CurrentWorld.GetSignAtTile(e.Location.X, e.Location.Y);
                if (sign != null)
                {
                    _wvm.SelectedSign = sign.Copy();
                    return;
                }
            }
            else if (curTile.Type == 395)
            {
                TileEntity frame = _wvm.CurrentWorld.GetTileEntityAtTile(e.Location.X, e.Location.Y);
                if (frame != null)
                {
                    _wvm.SelectedItemFrame = frame.Copy();
                    return;
                }
            }
            else if (curTile.Type == 128 || curTile.Type == 269)
            {
                Vector2Int32 MannLocation = _wvm.CurrentWorld.GetMannequin(e.Location.X, e.Location.Y);
                _wvm.SelectedMannHead  = _wvm.CurrentWorld.Tiles[MannLocation.X, MannLocation.Y].U / 100;
                _wvm.SelectedMannBody  = _wvm.CurrentWorld.Tiles[MannLocation.X, MannLocation.Y + 1].U / 100;
                _wvm.SelectedMannLegs  = _wvm.CurrentWorld.Tiles[MannLocation.X, MannLocation.Y + 2].U / 100;
                _wvm.SelectedMannequin = MannLocation;
            }
            else if (curTile.Type == 334)
            {
                Vector2Int32 RackLocation = _wvm.CurrentWorld.GetRack(e.Location.X, e.Location.Y);
                if (_wvm.CurrentWorld.Tiles[RackLocation.X, RackLocation.Y + 1].U >= 5000)
                {
                    _wvm.SelectedRackPrefix = (byte)(_wvm.CurrentWorld.Tiles[RackLocation.X + 1, RackLocation.Y + 1].U % 5000);
                    _wvm.SelectedRackNetId  = (_wvm.CurrentWorld.Tiles[RackLocation.X, RackLocation.Y + 1].U % 5000) - 100;
                }
                else
                {
                    _wvm.SelectedRackPrefix = 0;
                    _wvm.SelectedRackNetId  = 0;
                }
                _wvm.SelectedRack = RackLocation;
            }
        }