Ejemplo n.º 1
0
        public override void Update(double totalMS, double frameMS)
        {
            if (m_Item != null && m_Item.IsDisposed)
            {
                m_Item = null;
                m_ItemGraphic.Dispose();
                m_ItemGraphic = null;
            }

            if (m_Item != m_Entity.Equipment[(int)m_EquipLayer])
            {
                if (m_ItemGraphic != null)
                {
                    m_ItemGraphic.Dispose();
                    m_ItemGraphic = null;
                }

                m_Item = m_Entity.Equipment[(int)m_EquipLayer];
                if (m_Item != null)
                {
                    m_ItemGraphic = (StaticPic)AddControl(new StaticPic(this, 0, 0, m_Item.ItemID, m_Item.Hue));
                }
            }

            if (m_Item != null)
            {
                if (m_ClickedCanDrag && UltimaGame.TotalMS >= m_PickUpTime)
                {
                    m_ClickedCanDrag = false;
                    AttemptPickUp();
                }

                if (m_SendClickIfNoDoubleClick && UltimaGame.TotalMS >= m_SingleClickTime)
                {
                    m_SendClickIfNoDoubleClick = false;
                    m_World.Interaction.SingleClick(m_Item);
                }
            }

            base.Update(totalMS, frameMS);

            if (m_ItemGraphic != null)
            {
                m_ItemGraphic.Position = new Point(0 - 14, 0);
            }
        }
Ejemplo n.º 2
0
        public override void Update(double totalMS, double frameMS)
        {
            if (m_Item != null && m_Item.IsDisposed)
            {
                m_Item = null;
                m_ItemGraphic.Dispose();
                m_ItemGraphic = null;
            }

            if (m_Item != m_Entity.Equipment[(int)m_EquipLayer])
            {
                if (m_ItemGraphic != null)
                {
                    m_ItemGraphic.Dispose();
                    m_ItemGraphic = null;
                }

                m_Item = m_Entity.Equipment[(int)m_EquipLayer];
                if (m_Item != null)
                {
                    m_ItemGraphic = (StaticPic)AddControl(new StaticPic(this, 0, 0, m_Item.ItemID, m_Item.Hue));
                }
            }

            if (m_Item != null)
            {
                if (m_ClickedCanDrag && UltimaGame.TotalMS >= m_PickUpTime)
                {
                    m_ClickedCanDrag = false;
                    AttemptPickUp();
                }

                if (m_SendClickIfNoDoubleClick && UltimaGame.TotalMS >= m_SingleClickTime)
                {
                    m_SendClickIfNoDoubleClick = false;
                    m_World.Interaction.SingleClick(m_Item);
                }
            }

            base.Update(totalMS, frameMS);

            if (m_ItemGraphic != null)
                m_ItemGraphic.Position = new Point(0 - 14, 0);
        }