Example #1
0
        public CollectionItem(Type type, int itemID, int tooltip, int hue, double points, bool questitem = false)
        {
            this.m_Type      = type;
            this.m_ItemID    = itemID;
            this.m_Tooltip   = tooltip;
            this.m_Hue       = hue;
            this.m_Points    = points;
            this.m_QuestItem = questitem;

            try
            {
                Rectangle2D rec = ItemBounds.Table[m_ItemID];
                m_X      = rec.X;
                m_Y      = rec.Y;
                m_Width  = rec.Width;
                m_Height = rec.Height;
            }
            catch
            {
                int mx, my;
                mx = my = 0;

                Item.Measure(Item.GetBitmap(this.m_ItemID), out this.m_X, out this.m_Y, out mx, out my);

                this.m_Width  = mx - this.m_X;
                this.m_Height = my - this.m_Y;
            }
        }
        public CollectionItem(Type type, int itemID, int tooltip, int hue, double points)
        {
            this.m_Type    = type;
            this.m_ItemID  = itemID;
            this.m_Tooltip = tooltip;
            this.m_Hue     = hue;
            this.m_Points  = points;

            int mx, my;

            mx = my = 0;

            Item.Measure(Item.GetBitmap(this.m_ItemID), out this.m_X, out this.m_Y, out mx, out my);

            this.m_Width  = mx - this.m_X;
            this.m_Height = my - this.m_Y;
        }
Example #3
0
        public CollectionItem(Type type, int itemID, TextDefinition tooltip, int hue, double points, bool questitem = false)
        {
            m_Type      = type;
            m_ItemID    = itemID;
            m_Tooltip   = tooltip;
            m_Hue       = hue;
            m_Points    = points;
            m_QuestItem = questitem;

            Rectangle2D rec;

            try
            {
                rec = ItemBounds.Table[m_ItemID];
            }
            catch (Exception e)
            {
                Diagnostics.ExceptionLogging.LogException(e);
                rec = new Rectangle2D(0, 0, 0, 0);
            }

            if (rec.X == 0 && rec.Y == 0 && rec.Width == 0 && rec.Height == 0)
            {
                int mx, my;
                mx = my = 0;

                Item.Measure(Item.GetBitmap(m_ItemID), out m_X, out m_Y, out mx, out my);

                m_Width  = mx - m_X;
                m_Height = my - m_Y;
            }
            else
            {
                m_X      = rec.X;
                m_Y      = rec.Y;
                m_Width  = rec.Width;
                m_Height = rec.Height;
            }
        }