示例#1
0
        public override void GetContextMenuEntries(Mobile from, List <ContextMenuEntry> list)
        {
            if (Addon is ISiegeWeapon)
            {
                ISiegeWeapon weapon = (ISiegeWeapon)Addon;

                ((BaseSiegeWeapon)Addon).OnSingleClick(from);

                if (!weapon.FixedFacing)
                {
                    list.Add(new RotateNextEntry(weapon));
                    list.Add(new RotatePreviousEntry(weapon));
                }

                if (weapon.IsPackable)
                {
                    list.Add(new BackpackEntry(from, weapon));
                }

                if (weapon.IsDraggable)
                {
                    // does it support dragging?
                    XmlDrag a = (XmlDrag)XmlAttach.FindAttachment(weapon, typeof(XmlDrag));
                    if (a != null)
                    {
                        // is it currently being dragged?
                        // only allow user to disconnect a siege wep
                        if (a.DraggedBy != null && !a.DraggedBy.Deleted && a.DraggedBy == from)
                        {
                            list.Add(new ReleaseEntry(from, a));
                        }
                        else
                        {
                            list.Add(new ConnectEntry(from, a));
                        }
                    }
                }
            }
            base.GetContextMenuEntries(from, list);
        }
        public override void GetContextMenuEntries(Mobile from, ArrayList list)
        {
            if (Addon is ISiegeWeapon)
            {
                ISiegeWeapon weapon = (ISiegeWeapon)Addon;

                if (!weapon.FixedFacing)
                {
                    list.Add(new RotateNextEntry(weapon));
                    list.Add(new RotatePreviousEntry(weapon));
                }

                if (weapon.IsPackable)
                {
                    list.Add(new BackpackEntry(from, weapon));
                }

                if (weapon.IsDraggable)
                {
                    // does it support dragging?
                    XmlDrag a = (XmlDrag)XmlAttach.FindAttachment(weapon, typeof(XmlDrag));
                    if (a != null)
                    {
                        // is it currently being dragged?
                        if (a.DraggedBy != null && !a.DraggedBy.Deleted)
                        {
                            list.Add(new ReleaseEntry(from, a));
                        }
                        else
                        {
                            list.Add(new ConnectEntry(from, a));
                        }
                    }
                }
            }
            base.GetContextMenuEntries(from, list);
        }
示例#3
0
 public DragTarget(XmlDrag attachment)
     : base(30, false, TargetFlags.None)
 {
     m_attachment = attachment;
 }
示例#4
0
 public ConnectEntry(Mobile from, XmlDrag drag)
     : base(5119)
 {
     m_from = from;
     m_drag = drag;
 }
示例#5
0
 public ReleaseEntry(Mobile from, XmlDrag drag)
     : base(6118)
 {
     m_from = from;
     m_drag = drag;
 }