Beispiel #1
0
 protected internal override void Draw(int x, int y)
 {
     if (this.m_Invalidated)
     {
         this.Refresh();
     }
     if (this.m_Draw)
     {
         if (this.m_bAlpha)
         {
             Renderer.SetAlphaEnable(true);
             Renderer.SetAlpha(this.m_fAlpha);
         }
         if (this.m_Clipper == null)
         {
             if (this.m_vCache == null)
             {
                 this.m_vCache = this.VCPool.GetInstance();
             }
             this.m_vCache.Draw(this.m_Image, x, y);
         }
         else
         {
             this.m_Image.DrawClipped(x, y, this.m_Clipper);
         }
         if (this.m_bAlpha)
         {
             Renderer.SetAlphaEnable(false);
         }
     }
 }
Beispiel #2
0
 public override void OnStop()
 {
     base.VCPool.ReleaseInstance(this.m_vCache);
     this.m_vCache = null;
     base.VCPool.ReleaseInstance(this.m_vCache);
     this.m_vCacheDouble = null;
 }
Beispiel #3
0
 public override void OnStop()
 {
     base.VCPool.ReleaseInstance(this.m_vCache);
     this.m_vCache = null;
     base.VCPool.ReleaseInstance(this.m_vCache);
     this.m_vCacheDouble = null;
 }
Beispiel #4
0
 public void ReleaseInstance(VertexCache vc)
 {
     if (vc != null)
     {
         this.m_Queue.Enqueue(vc);
     }
 }
Beispiel #5
0
 public void ReleaseInstance(VertexCache vc)
 {
     if (vc != null)
     {
         this.m_Queue.Enqueue(vc);
     }
 }
Beispiel #6
0
 protected internal override void Draw(int x, int y)
 {
     if (this.m_Draw)
     {
         bool flag = !(this.m_fAlpha == 1f);
         if (flag)
         {
             Renderer.SetAlpha(this.m_fAlpha);
             Renderer.SetAlphaEnable(true);
         }
         if (this.m_vCache == null)
         {
             this.m_vCache = this.VCPool.GetInstance();
         }
         this.m_vCache.Draw(this.m_Image, x, y);
         if (flag)
         {
             Renderer.SetAlphaEnable(false);
         }
         this.m_Item.MessageX     = x + this.m_xOffset;
         this.m_Item.MessageY     = y + this.m_yOffset;
         this.m_Item.BottomY      = y + this.m_yOffset;
         this.m_Item.MessageFrame = Renderer.m_ActFrames;
     }
 }
Beispiel #7
0
 protected internal override void OnDispose()
 {
     this.VCPool.ReleaseInstance(this.m_vCache);
     this.m_vCache = null;
     this.VCPool.ReleaseInstance(this.m_vCacheDouble);
     this.m_vCacheDouble = null;
 }
Beispiel #8
0
 public void Draw(int x, int y)
 {
     if (this.m_vCache == null)
     {
         this.m_vCache = this.VCPool.GetInstance();
     }
     this.m_vCache.Draw(this.m_Image, x, y);
 }
Beispiel #9
0
 public CursorEntry(int graphic, int type, int xOffset, int yOffset, Texture image)
 {
     this.m_Graphic = graphic;
     this.m_Type = type;
     this.m_xOffset = xOffset;
     this.m_yOffset = yOffset;
     this.m_Image = image;
     this.m_Draw = (this.m_Image != null) && !this.m_Image.IsEmpty();
     this.m_vCache = new VertexCache();
 }
Beispiel #10
0
 public CursorEntry(int graphic, int type, int xOffset, int yOffset, Texture image)
 {
     this.m_Graphic = graphic;
     this.m_Type    = type;
     this.m_xOffset = xOffset;
     this.m_yOffset = yOffset;
     this.m_Image   = image;
     this.m_Draw    = (this.m_Image != null) && !this.m_Image.IsEmpty();
     this.m_vCache  = new VertexCache();
 }
Beispiel #11
0
 public VertexCache GetInstance()
 {
     if (this.m_Queue.Count > 0)
     {
         VertexCache cache = (VertexCache)this.m_Queue.Dequeue();
         cache.Invalidate();
         return(cache);
     }
     return(new VertexCache());
 }
Beispiel #12
0
 public GDraggedItem(Client.Item item)
     : base(0, 0)
 {
     this.m_vCache = new VertexCache();
     this.m_Item = item;
     int index = this.m_Item.ID & 0x3fff;
     int amount = (ushort) this.m_Item.Amount;
     this.m_Double = Map.m_ItemFlags[index][TileFlag.Generic] && (amount > 1);
     if ((index >= 0xeea) && (index <= 0xef2))
     {
         int num3 = (index - 0xeea) / 3;
         num3 *= 3;
         num3 += 0xeea;
         this.m_Double = false;
         if (amount <= 1)
         {
             index = num3;
         }
         else if ((amount >= 2) && (amount <= 5))
         {
             index = num3 + 1;
         }
         else
         {
             index = num3 + 2;
         }
     }
     this.m_Hue = Hues.GetItemHue(index, this.m_Item.Hue);
     this.m_Image = this.m_Hue.GetItem(index);
     if ((this.m_Image != null) && !this.m_Image.IsEmpty())
     {
         this.m_Draw = true;
         this.m_Width = this.m_Image.Width;
         this.m_Height = this.m_Image.Height;
         int num4 = this.m_Double ? 6 : 1;
         this.m_xOffset = base.m_OffsetX = this.m_Image.xMin + (((this.m_Image.xMax - this.m_Image.xMin) + num4) / 2);
         this.m_yOffset = this.m_Image.yMin;
         base.m_OffsetY = this.m_yOffset + (((this.m_Image.yMax - this.m_Image.yMin) + num4) / 2);
         if (this.m_Double)
         {
             this.m_Width += 5;
             this.m_Height += 5;
         }
     }
     base.m_DragCursor = false;
     base.m_CanDrag = true;
     base.m_QuickDrag = true;
     base.m_IsDragging = true;
     Gumps.Drag = this;
     Gumps.LastOver = this;
     base.m_X = Engine.m_xMouse - base.m_OffsetX;
     base.m_Y = Engine.m_yMouse - base.m_OffsetY;
 }
Beispiel #13
0
        public GDraggedItem(Client.Item item) : base(0, 0)
        {
            this.m_vCache = new VertexCache();
            this.m_Item   = item;
            int index  = this.m_Item.ID & 0x3fff;
            int amount = (ushort)this.m_Item.Amount;

            this.m_Double = Map.m_ItemFlags[index][TileFlag.Generic] && (amount > 1);
            if ((index >= 0xeea) && (index <= 0xef2))
            {
                int num3 = (index - 0xeea) / 3;
                num3         *= 3;
                num3         += 0xeea;
                this.m_Double = false;
                if (amount <= 1)
                {
                    index = num3;
                }
                else if ((amount >= 2) && (amount <= 5))
                {
                    index = num3 + 1;
                }
                else
                {
                    index = num3 + 2;
                }
            }
            this.m_Hue   = Hues.GetItemHue(index, this.m_Item.Hue);
            this.m_Image = this.m_Hue.GetItem(index);
            if ((this.m_Image != null) && !this.m_Image.IsEmpty())
            {
                this.m_Draw   = true;
                this.m_Width  = this.m_Image.Width;
                this.m_Height = this.m_Image.Height;
                int num4 = this.m_Double ? 6 : 1;
                this.m_xOffset = base.m_OffsetX = this.m_Image.xMin + (((this.m_Image.xMax - this.m_Image.xMin) + num4) / 2);
                this.m_yOffset = this.m_Image.yMin;
                base.m_OffsetY = this.m_yOffset + (((this.m_Image.yMax - this.m_Image.yMin) + num4) / 2);
                if (this.m_Double)
                {
                    this.m_Width  += 5;
                    this.m_Height += 5;
                }
            }
            base.m_DragCursor = false;
            base.m_CanDrag    = true;
            base.m_QuickDrag  = true;
            base.m_IsDragging = true;
            Gumps.Drag        = this;
            Gumps.LastOver    = this;
            base.m_X          = Engine.m_xMouse - base.m_OffsetX;
            base.m_Y          = Engine.m_yMouse - base.m_OffsetY;
        }
Beispiel #14
0
 protected internal override void Draw(int X, int Y)
 {
     if (this.m_Invalidated)
     {
         this.Refresh();
     }
     if (this.m_Draw)
     {
         if (!this.m_Clip)
         {
             if (this.m_bAlpha)
             {
                 Renderer.SetAlpha(this.m_fAlpha);
                 Renderer.SetAlphaEnable(true);
             }
             if (this.m_vCache == null)
             {
                 this.m_vCache = this.VCPool.GetInstance();
             }
             this.m_vCache.Draw(this.m_Image, X, Y);
             if (this.m_bAlpha)
             {
                 Renderer.SetAlphaEnable(false);
             }
         }
         else if (!this.m_Relative)
         {
             if (!this.m_bAlpha)
             {
                 this.m_Image.DrawClipped(X, Y, this.m_Clipper);
             }
             else
             {
                 Renderer.SetAlphaEnable(true);
                 Renderer.SetAlpha(this.m_fAlpha);
                 this.m_Image.DrawClipped(X, Y, this.m_Clipper);
                 Renderer.SetAlphaEnable(false);
             }
         }
         else if (!this.m_bAlpha)
         {
             this.m_Image.DrawClipped(X, Y, Client.Clipper.TemporaryInstance(X + this.m_xClipOffset, Y + this.m_yClipOffset, this.m_xClipWidth, this.m_yClipHeight));
         }
         else
         {
             Renderer.SetAlphaEnable(true);
             Renderer.SetAlpha(this.m_fAlpha);
             this.m_Image.DrawClipped(X, Y, Client.Clipper.TemporaryInstance(X + this.m_xClipOffset, Y + this.m_yClipOffset, this.m_xClipWidth, this.m_yClipHeight));
             Renderer.SetAlphaEnable(false);
         }
     }
 }
Beispiel #15
0
 public GItemArt(int x, int y, int itemID, IHue hue) : base(x, y)
 {
     this.m_vCache = new VertexCache();
     this.m_Hue    = hue;
     this.m_ItemID = itemID;
     this.m_Image  = hue.GetItem(itemID);
     if ((this.m_Image != null) && !this.m_Image.IsEmpty())
     {
         this.m_Width  = this.m_Image.Width;
         this.m_Height = this.m_Image.Height;
         this.m_Draw   = true;
     }
 }
Beispiel #16
0
 public GMouseRouter(int GumpID, IHue Hue, int X, int Y, Gump Target) : base(X, Y)
 {
     this.m_vCache = new VertexCache();
     this.m_Target = Target;
     this.m_GumpID = GumpID;
     this.m_Gump   = Hue.GetGump(this.m_GumpID);
     if ((this.m_Gump != null) && !this.m_Gump.IsEmpty())
     {
         this.m_Width  = this.m_Gump.Width;
         this.m_Height = this.m_Gump.Height;
         this.m_Draw   = true;
     }
 }
Beispiel #17
0
 public void DrawGame(Texture t, int x, int y)
 {
     if (this.m_vCache == null)
     {
         this.m_vCache = new VertexCache();
     }
     if (this.m_tPool != t)
     {
         this.m_tPool = t;
         this.m_vCache.Invalidate();
     }
     this.m_vCache.DrawGame(t, x, y);
 }
Beispiel #18
0
 public GItemArt(int x, int y, int itemID, IHue hue)
     : base(x, y)
 {
     this.m_vCache = new VertexCache();
     this.m_Hue = hue;
     this.m_ItemID = itemID;
     this.m_Image = hue.GetItem(itemID);
     if ((this.m_Image != null) && !this.m_Image.IsEmpty())
     {
         this.m_Width = this.m_Image.Width;
         this.m_Height = this.m_Image.Height;
         this.m_Draw = true;
     }
 }
Beispiel #19
0
 protected internal override void Draw(int x, int y)
 {
     if (this.m_Invalidated)
     {
         this.Refresh();
     }
     if (this.m_Draw)
     {
         if (this.m_vCache == null)
         {
             this.m_vCache = this.VCPool.GetInstance();
         }
         this.m_vCache.Draw(this.m_Image, x, y);
     }
 }
Beispiel #20
0
 public GSlider(int SliderID, IHue Hue, int X, int Y, int Width, int Height, double Value, double Start, double End, double Increase) : base(X, Y)
 {
     this.m_vCache   = new VertexCache();
     this.m_Width    = Width;
     this.m_Height   = Height;
     this.m_Start    = Start;
     this.m_End      = End;
     this.m_Increase = Increase;
     this.m_Gump     = Hue.GetGump(SliderID);
     if ((this.m_Gump != null) && !this.m_Gump.IsEmpty())
     {
         this.m_HalfWidth = this.m_Gump.Width / 2;
         this.m_yOffset   = (this.m_Height - this.m_Gump.Height) / 2;
         this.m_Draw      = true;
     }
     this.SetValue(Value, false);
 }
Beispiel #21
0
 public GSlider(int SliderID, IHue Hue, int X, int Y, int Width, int Height, double Value, double Start, double End, double Increase)
     : base(X, Y)
 {
     this.m_vCache = new VertexCache();
     this.m_Width = Width;
     this.m_Height = Height;
     this.m_Start = Start;
     this.m_End = End;
     this.m_Increase = Increase;
     this.m_Gump = Hue.GetGump(SliderID);
     if ((this.m_Gump != null) && !this.m_Gump.IsEmpty())
     {
         this.m_HalfWidth = this.m_Gump.Width / 2;
         this.m_yOffset = (this.m_Height - this.m_Gump.Height) / 2;
         this.m_Draw = true;
     }
     this.SetValue(Value, false);
 }
Beispiel #22
0
 public GDragable(int GumpID, IHue Hue, int X, int Y) : base(X, Y)
 {
     this.m_CanClose  = true;
     this.m_fAlpha    = 1f;
     this.m_vCache    = new VertexCache();
     this.m_GumpID    = GumpID;
     this.m_Hue       = Hue;
     base.m_CanDrag   = true;
     base.m_QuickDrag = true;
     this.m_Dockers   = new ArrayList();
     this.m_Linked    = new ArrayList();
     this.m_Gump      = Hue.GetGump(GumpID);
     if ((this.m_Gump != null) && !this.m_Gump.IsEmpty())
     {
         this.m_Width  = this.m_Gump.Width;
         this.m_Height = this.m_Gump.Height;
         this.m_Draw   = true;
     }
 }
Beispiel #23
0
 protected internal override void Draw(int x, int y)
 {
     if (this.m_Draw)
     {
         this.m_vCache.Draw(this.m_Image, x, y);
         if (this.m_Double)
         {
             if (this.m_vCacheDouble == null)
             {
                 this.m_vCacheDouble = new VertexCache();
             }
             this.m_vCacheDouble.Draw(this.m_Image, x + 5, y + 5);
         }
         this.m_Item.MessageX     = this.X + this.m_xOffset;
         this.m_Item.MessageY     = this.Y + this.m_yOffset;
         this.m_Item.BottomY      = this.Y + this.m_Image.yMax;
         this.m_Item.MessageFrame = Renderer.m_ActFrames;
     }
 }
Beispiel #24
0
 protected internal override void Draw(int x, int y)
 {
     if (this.m_Draw[this.m_State])
     {
         if (this.m_bAlpha)
         {
             Renderer.SetAlpha(this.m_fAlpha);
             Renderer.SetAlphaEnable(true);
         }
         if (this.m_vCache == null)
         {
             this.m_vCache = this.VCPool.GetInstance();
         }
         this.m_vCache.Draw(this.m_Gump[this.m_State], x, y);
         if (this.m_bAlpha)
         {
             Renderer.SetAlphaEnable(false);
         }
     }
 }
Beispiel #25
0
 public GDragable(int GumpID, IHue Hue, int X, int Y)
     : base(X, Y)
 {
     this.m_CanClose = true;
     this.m_fAlpha = 1f;
     this.m_vCache = new VertexCache();
     this.m_GumpID = GumpID;
     this.m_Hue = Hue;
     base.m_CanDrag = true;
     base.m_QuickDrag = true;
     this.m_Dockers = new ArrayList();
     this.m_Linked = new ArrayList();
     this.m_Gump = Hue.GetGump(GumpID);
     if ((this.m_Gump != null) && !this.m_Gump.IsEmpty())
     {
         this.m_Width = this.m_Gump.Width;
         this.m_Height = this.m_Gump.Height;
         this.m_Draw = true;
     }
 }
Beispiel #26
0
 public void Draw(int x, int y)
 {
     if (this.m_Draw)
     {
         x += this.m_X;
         y += this.m_Y;
         if (this.m_Tile)
         {
             this.m_Image.Draw(x, y, this.m_Width, this.m_Height, 0xffffff);
         }
         else
         {
             if (this.m_vCache == null)
             {
                 this.m_vCache = new VertexCache();
             }
             this.m_vCache.Draw(this.m_Image, x, y);
         }
     }
 }
Beispiel #27
0
 protected internal override void Draw(int x, int y)
 {
     if (this.m_Draw[this.m_State])
     {
         Renderer.SetAlphaEnable(true);
         Renderer.SetAlpha(1f);
         if (this.m_Clipper != null)
         {
             this.m_Images[this.m_State].DrawClipped(x, y, this.m_Clipper);
         }
         else
         {
             if (this.m_vCache == null)
             {
                 this.m_vCache = this.VCPool.GetInstance();
             }
             this.m_vCache.Draw(this.m_Images[this.m_State], x, y);
         }
         Renderer.SetAlphaEnable(false);
     }
 }
Beispiel #28
0
 protected internal override void Draw(int X, int Y)
 {
     if (this.m_Draw)
     {
         if (this.m_vCache == null)
         {
             this.m_vCache = this.VCPool.GetInstance();
         }
         this.m_vCache.Draw(this.m_Image, X, Y);
         if (this.m_Double)
         {
             if (this.m_vCacheDouble == null)
             {
                 this.m_vCacheDouble = this.VCPool.GetInstance();
             }
             this.m_vCacheDouble.Draw(this.m_Image, X + 5, Y + 5);
         }
         this.m_Item.MessageX     = X + this.m_xOffset;
         this.m_Item.MessageY     = Y + this.m_yOffset;
         this.m_Item.BottomY      = Y + this.m_Image.yMax;
         this.m_Item.MessageFrame = Renderer.m_ActFrames;
     }
 }
Beispiel #29
0
 protected internal override void Draw(int x, int y)
 {
     if (this.m_Draw)
     {
         this.m_vCache.Draw(this.m_Image, x, y);
         if (this.m_Double)
         {
             if (this.m_vCacheDouble == null)
             {
                 this.m_vCacheDouble = new VertexCache();
             }
             this.m_vCacheDouble.Draw(this.m_Image, x + 5, y + 5);
         }
         this.m_Item.MessageX = this.X + this.m_xOffset;
         this.m_Item.MessageY = this.Y + this.m_yOffset;
         this.m_Item.BottomY = this.Y + this.m_Image.yMax;
         this.m_Item.MessageFrame = Renderer.m_ActFrames;
     }
 }
Beispiel #30
0
 protected internal override void OnDispose()
 {
     this.VCPool.ReleaseInstance(this.m_vCache);
     this.m_vCache = null;
 }
Beispiel #31
0
 protected internal override void Draw(int x, int y)
 {
     if (this.m_Invalidated)
     {
         this.Refresh();
     }
     if (this.m_Draw)
     {
         if (this.m_bAlpha)
         {
             Renderer.SetAlphaEnable(true);
             Renderer.SetAlpha(this.m_fAlpha);
         }
         if (this.m_Clipper == null)
         {
             if (this.m_vCache == null)
             {
                 this.m_vCache = this.VCPool.GetInstance();
             }
             this.m_vCache.Draw(this.m_Image, x, y);
         }
         else
         {
             this.m_Image.DrawClipped(x, y, this.m_Clipper);
         }
         if (this.m_bAlpha)
         {
             Renderer.SetAlphaEnable(false);
         }
     }
 }
Beispiel #32
0
        public override bool Slice()
        {
            int xWorld  = Renderer.m_xWorld;
            int yWorld  = Renderer.m_yWorld;
            int zWorld  = Renderer.m_zWorld;
            int x       = 0;
            int y       = 0;
            int z       = 0;
            int xOffset = 0;
            int yOffset = 0;
            int fOffset = 0;

            base.GetSource(out x, out y, out z);
            x -= xWorld;
            y -= yWorld;
            z -= zWorld;
            int num10 = (Engine.GameWidth >> 1) + ((x - y) * 0x16);
            int num11 = (((Engine.GameHeight >> 1) + 0x16) + ((x + y) * 0x16)) - (z * 4);

            num10 += Engine.GameX;
            num11 += Engine.GameY;
            if ((base.m_Source != null) && (base.m_Source.GetType() == typeof(Mobile)))
            {
                Mobile source = (Mobile)base.m_Source;
                if (source.Walking.Count > 0)
                {
                    WalkAnimation animation = (WalkAnimation)source.Walking.Peek();
                    if (animation.Snapshot(ref xOffset, ref yOffset, ref fOffset))
                    {
                        num10 += xOffset;
                        num11 += yOffset;
                    }
                }
            }
            num10 -= Renderer.m_xScroll;
            num11 -= Renderer.m_yScroll;
            Texture t   = null;
            IHue    hue = Renderer.m_Dead ? Hues.Grayscale : this.m_Hue;

            if (this.m_Animated)
            {
                if ((Renderer.m_Frames - this.m_Start) >= this.m_Duration)
                {
                    return(false);
                }
                t = hue.GetItem(this.m_ItemID + this.m_Animation[((Renderer.m_Frames - this.m_Start) / this.m_Delay) % this.m_FrameCount]);
            }
            else
            {
                if ((Renderer.m_Frames - this.m_Start) >= this.m_Duration)
                {
                    return(false);
                }
                t = hue.GetItem(this.m_ItemID);
            }
            if (this.m_vCache == null)
            {
                this.m_vCache = base.VCPool.GetInstance();
            }
            switch (this.m_RenderMode)
            {
            case 2:
                Renderer.SetAlpha(1f);
                Renderer.SetAlphaEnable(true);
                Renderer.SetBlendType(DrawBlendType.Additive);
                break;

            case 3:
                Renderer.SetAlpha(1.5f);
                Renderer.SetAlphaEnable(true);
                Renderer.SetBlendType(DrawBlendType.Additive);
                break;

            case 4:
                Renderer.SetAlpha(0.5f);
                Renderer.SetAlphaEnable(true);
                Renderer.SetBlendType(DrawBlendType.Normal);
                break;
            }
            this.m_vCache.DrawGame(t, num10 - (t.Width / 2), num11 - t.Height);
            switch (this.m_RenderMode)
            {
            case 2:
            case 3:
            case 4:
                Renderer.SetAlphaEnable(false);
                Renderer.SetBlendType(DrawBlendType.Normal);
                break;
            }
            return(true);
        }
Beispiel #33
0
 protected internal override void Draw(int X, int Y)
 {
     if (this.m_Draw)
     {
         if (this.m_vCache == null)
         {
             this.m_vCache = this.VCPool.GetInstance();
         }
         this.m_vCache.Draw(this.m_Image, X, Y);
         if (this.m_Double)
         {
             if (this.m_vCacheDouble == null)
             {
                 this.m_vCacheDouble = this.VCPool.GetInstance();
             }
             this.m_vCacheDouble.Draw(this.m_Image, X + 5, Y + 5);
         }
         this.m_Item.MessageX = X + this.m_xOffset;
         this.m_Item.MessageY = Y + this.m_yOffset;
         this.m_Item.BottomY = Y + this.m_Image.yMax;
         this.m_Item.MessageFrame = Renderer.m_ActFrames;
     }
 }
Beispiel #34
0
 protected internal override void Draw(int x, int y)
 {
     if (this.m_Invalidated)
     {
         this.Refresh();
     }
     if (this.m_Draw)
     {
         if (this.m_vCache == null)
         {
             this.m_vCache = this.VCPool.GetInstance();
         }
         this.m_vCache.Draw(this.m_Image, x, y);
     }
 }
Beispiel #35
0
 public LightningEffect(IHue Hue)
 {
     this.m_vCache = new VertexCache();
     base.m_Children = new EffectList();
     this.m_Hue = Hue;
 }
Beispiel #36
0
 protected internal override void Draw(int x, int y)
 {
     if (this.m_Draw[this.m_State])
     {
         if (this.m_bAlpha)
         {
             Renderer.SetAlpha(this.m_fAlpha);
             Renderer.SetAlphaEnable(true);
         }
         if (this.m_vCache == null)
         {
             this.m_vCache = this.VCPool.GetInstance();
         }
         this.m_vCache.Draw(this.m_Gump[this.m_State], x, y);
         if (this.m_bAlpha)
         {
             Renderer.SetAlphaEnable(false);
         }
     }
 }
Beispiel #37
0
 public LightningEffect(IHue Hue)
 {
     this.m_vCache   = new VertexCache();
     base.m_Children = new EffectList();
     this.m_Hue      = Hue;
 }
Beispiel #38
0
 public void Draw(int x, int y)
 {
     if (this.m_Draw)
     {
         x += this.m_X;
         y += this.m_Y;
         if (this.m_Tile)
         {
             this.m_Image.Draw(x, y, this.m_Width, this.m_Height, 0xffffff);
         }
         else
         {
             if (this.m_vCache == null)
             {
                 this.m_vCache = new VertexCache();
             }
             this.m_vCache.Draw(this.m_Image, x, y);
         }
     }
 }
Beispiel #39
0
 public void DrawGame(Texture t, int x, int y)
 {
     if (this.m_vCache == null)
     {
         this.m_vCache = new VertexCache();
     }
     if (this.m_tPool != t)
     {
         this.m_tPool = t;
         this.m_vCache.Invalidate();
     }
     this.m_vCache.DrawGame(t, x, y);
 }
Beispiel #40
0
 protected internal override void Draw(int x, int y)
 {
     if (this.m_Draw[this.m_State])
     {
         Renderer.SetAlphaEnable(true);
         Renderer.SetAlpha(1f);
         if (this.m_Clipper != null)
         {
             this.m_Images[this.m_State].DrawClipped(x, y, this.m_Clipper);
         }
         else
         {
             if (this.m_vCache == null)
             {
                 this.m_vCache = this.VCPool.GetInstance();
             }
             this.m_vCache.Draw(this.m_Images[this.m_State], x, y);
         }
         Renderer.SetAlphaEnable(false);
     }
 }
Beispiel #41
0
 protected internal override void Draw(int x, int y)
 {
     if (this.m_Draw)
     {
         bool flag = !(this.m_fAlpha == 1f);
         if (flag)
         {
             Renderer.SetAlpha(this.m_fAlpha);
             Renderer.SetAlphaEnable(true);
         }
         if (this.m_vCache == null)
         {
             this.m_vCache = this.VCPool.GetInstance();
         }
         this.m_vCache.Draw(this.m_Image, x, y);
         if (flag)
         {
             Renderer.SetAlphaEnable(false);
         }
         this.m_Item.MessageX = x + this.m_xOffset;
         this.m_Item.MessageY = y + this.m_yOffset;
         this.m_Item.BottomY = y + this.m_yOffset;
         this.m_Item.MessageFrame = Renderer.m_ActFrames;
     }
 }
Beispiel #42
0
 public override bool Slice()
 {
     double normalized = base.m_Sync.Normalized;
     if (normalized >= 1.0)
     {
         return false;
     }
     int xWorld = Renderer.m_xWorld;
     int yWorld = Renderer.m_yWorld;
     int zWorld = Renderer.m_zWorld;
     int x = 0;
     int y = 0;
     int z = 0;
     int xOffset = 0;
     int yOffset = 0;
     int fOffset = 0;
     base.GetSource(out x, out y, out z);
     x -= xWorld;
     y -= yWorld;
     z -= zWorld;
     int num11 = (Engine.GameWidth >> 1) + ((x - y) * 0x16);
     int num12 = ((Engine.ScreenHeight >> 1) + ((x + y) * 0x16)) - (z * 4);
     num11 += Engine.GameX;
     num12 += Engine.GameY;
     num11 -= Renderer.m_xScroll;
     num12 -= Renderer.m_yScroll;
     if ((base.m_Source != null) && (base.m_Source.GetType() == typeof(Mobile)))
     {
         Mobile source = (Mobile) base.m_Source;
         if (source.Walking.Count > 0)
         {
             WalkAnimation animation = (WalkAnimation) source.Walking.Peek();
             if (animation.Snapshot(ref xOffset, ref yOffset, ref fOffset))
             {
                 num11 += xOffset;
                 num12 += yOffset;
             }
         }
         num12 -= 30;
     }
     base.GetTarget(out x, out y, out z);
     x -= xWorld;
     y -= yWorld;
     z -= zWorld;
     int num13 = (Engine.GameWidth >> 1) + ((x - y) * 0x16);
     int num14 = ((Engine.GameHeight >> 1) + ((x + y) * 0x16)) - (z * 4);
     num13 += Engine.GameX;
     num14 += Engine.GameY;
     num13 -= Renderer.m_xScroll;
     num14 -= Renderer.m_yScroll;
     if ((base.m_Target != null) && (base.m_Target.GetType() == typeof(Mobile)))
     {
         Mobile target = (Mobile) base.m_Target;
         if (target.Walking.Count > 0)
         {
             WalkAnimation animation2 = (WalkAnimation) target.Walking.Peek();
             if (animation2.Snapshot(ref xOffset, ref yOffset, ref fOffset))
             {
                 num13 += xOffset;
                 num14 += yOffset;
             }
         }
         num14 -= 30;
     }
     Texture t = null;
     if (base.m_Animated)
     {
         if (Renderer.m_Dead)
         {
             t = Hues.Grayscale.GetItem(base.m_ItemID + base.m_Animation[((Renderer.m_Frames - base.m_Start) / base.m_Delay) % base.m_FrameCount]);
         }
         else
         {
             t = base.m_Hue.GetItem(base.m_ItemID + base.m_Animation[((Renderer.m_Frames - base.m_Start) / base.m_Delay) % base.m_FrameCount]);
         }
     }
     else if (Renderer.m_Dead)
     {
         t = Hues.Grayscale.GetItem(base.m_ItemID);
     }
     else
     {
         t = base.m_Hue.GetItem(base.m_ItemID);
     }
     if (base.m_Source == null)
     {
         num11 -= t.Width / 2;
         num12 += 0x16 - t.Height;
     }
     else
     {
         num11 -= t.xMin + ((t.xMax - t.xMin) / 2);
         num12 -= t.yMin + ((t.yMax - t.yMin) / 2);
     }
     if (base.m_Target == null)
     {
         num13 -= t.Width / 2;
         num14 += 0x16 - t.Height;
     }
     else
     {
         num13 -= t.xMin + ((t.xMax - t.xMin) / 2);
         num14 -= t.yMin + ((t.yMax - t.yMin) / 2);
     }
     int num15 = num11 + ((int) ((num13 - num11) * normalized));
     int num16 = num12 + ((int) ((num14 - num12) * normalized));
     if (this.m_vCache == null)
     {
         this.m_vCache = base.VCPool.GetInstance();
     }
     this.m_vCache.DrawGame(t, num15, num16);
     if (this.m_Double)
     {
         if (this.m_vCacheDouble == null)
         {
             this.m_vCacheDouble = base.VCPool.GetInstance();
         }
         this.m_vCacheDouble.DrawGame(t, num15 + 5, num16 + 5);
     }
     return true;
 }
Beispiel #43
0
 public void OnRemove()
 {
     this.VCPool.ReleaseInstance(this.m_vCache);
     this.m_vCache = null;
 }
Beispiel #44
0
        public override bool Slice()
        {
            int xWorld = Renderer.m_xWorld;
            int yWorld = Renderer.m_yWorld;
            int zWorld = Renderer.m_zWorld;
            int x = 0;
            int y = 0;
            int z = 0;
            int xOffset = 0;
            int yOffset = 0;
            int fOffset = 0;
            base.GetSource(out x, out y, out z);
            x -= xWorld;
            y -= yWorld;
            z -= zWorld;
            int num10 = (Engine.GameWidth >> 1) + ((x - y) * 0x16);
            int num11 = (((Engine.GameHeight >> 1) + 0x16) + ((x + y) * 0x16)) - (z * 4);
            num10 += Engine.GameX;
            num11 += Engine.GameY;
            if ((base.m_Source != null) && (base.m_Source.GetType() == typeof(Mobile)))
            {
                Mobile source = (Mobile) base.m_Source;
                if (source.Walking.Count > 0)
                {
                    WalkAnimation animation = (WalkAnimation) source.Walking.Peek();
                    if (animation.Snapshot(ref xOffset, ref yOffset, ref fOffset))
                    {
                        num10 += xOffset;
                        num11 += yOffset;
                    }
                }
            }
            num10 -= Renderer.m_xScroll;
            num11 -= Renderer.m_yScroll;
            Texture t = null;
            IHue hue = Renderer.m_Dead ? Hues.Grayscale : this.m_Hue;
            if (this.m_Animated)
            {
                if ((Renderer.m_Frames - this.m_Start) >= this.m_Duration)
                {
                    return false;
                }
                t = hue.GetItem(this.m_ItemID + this.m_Animation[((Renderer.m_Frames - this.m_Start) / this.m_Delay) % this.m_FrameCount]);
            }
            else
            {
                if ((Renderer.m_Frames - this.m_Start) >= this.m_Duration)
                {
                    return false;
                }
                t = hue.GetItem(this.m_ItemID);
            }
            if (this.m_vCache == null)
            {
                this.m_vCache = base.VCPool.GetInstance();
            }
            switch (this.m_RenderMode)
            {
                case 2:
                    Renderer.SetAlpha(1f);
                    Renderer.SetAlphaEnable(true);
                    Renderer.SetBlendType(DrawBlendType.Additive);
                    break;

                case 3:
                    Renderer.SetAlpha(1.5f);
                    Renderer.SetAlphaEnable(true);
                    Renderer.SetBlendType(DrawBlendType.Additive);
                    break;

                case 4:
                    Renderer.SetAlpha(0.5f);
                    Renderer.SetAlphaEnable(true);
                    Renderer.SetBlendType(DrawBlendType.Normal);
                    break;
            }
            this.m_vCache.DrawGame(t, num10 - (t.Width / 2), num11 - t.Height);
            switch (this.m_RenderMode)
            {
                case 2:
                case 3:
                case 4:
                    Renderer.SetAlphaEnable(false);
                    Renderer.SetBlendType(DrawBlendType.Normal);
                    break;
            }
            return true;
        }
Beispiel #45
0
        public override bool Slice()
        {
            double normalized = base.m_Sync.Normalized;

            if (normalized >= 1.0)
            {
                return(false);
            }
            int xWorld  = Renderer.m_xWorld;
            int yWorld  = Renderer.m_yWorld;
            int zWorld  = Renderer.m_zWorld;
            int x       = 0;
            int y       = 0;
            int z       = 0;
            int xOffset = 0;
            int yOffset = 0;
            int fOffset = 0;

            base.GetSource(out x, out y, out z);
            x -= xWorld;
            y -= yWorld;
            z -= zWorld;
            int num11 = (Engine.GameWidth >> 1) + ((x - y) * 0x16);
            int num12 = ((Engine.ScreenHeight >> 1) + ((x + y) * 0x16)) - (z * 4);

            num11 += Engine.GameX;
            num12 += Engine.GameY;
            num11 -= Renderer.m_xScroll;
            num12 -= Renderer.m_yScroll;
            if ((base.m_Source != null) && (base.m_Source.GetType() == typeof(Mobile)))
            {
                Mobile source = (Mobile)base.m_Source;
                if (source.Walking.Count > 0)
                {
                    WalkAnimation animation = (WalkAnimation)source.Walking.Peek();
                    if (animation.Snapshot(ref xOffset, ref yOffset, ref fOffset))
                    {
                        num11 += xOffset;
                        num12 += yOffset;
                    }
                }
                num12 -= 30;
            }
            base.GetTarget(out x, out y, out z);
            x -= xWorld;
            y -= yWorld;
            z -= zWorld;
            int num13 = (Engine.GameWidth >> 1) + ((x - y) * 0x16);
            int num14 = ((Engine.GameHeight >> 1) + ((x + y) * 0x16)) - (z * 4);

            num13 += Engine.GameX;
            num14 += Engine.GameY;
            num13 -= Renderer.m_xScroll;
            num14 -= Renderer.m_yScroll;
            if ((base.m_Target != null) && (base.m_Target.GetType() == typeof(Mobile)))
            {
                Mobile target = (Mobile)base.m_Target;
                if (target.Walking.Count > 0)
                {
                    WalkAnimation animation2 = (WalkAnimation)target.Walking.Peek();
                    if (animation2.Snapshot(ref xOffset, ref yOffset, ref fOffset))
                    {
                        num13 += xOffset;
                        num14 += yOffset;
                    }
                }
                num14 -= 30;
            }
            Texture t = null;

            if (base.m_Animated)
            {
                if (Renderer.m_Dead)
                {
                    t = Hues.Grayscale.GetItem(base.m_ItemID + base.m_Animation[((Renderer.m_Frames - base.m_Start) / base.m_Delay) % base.m_FrameCount]);
                }
                else
                {
                    t = base.m_Hue.GetItem(base.m_ItemID + base.m_Animation[((Renderer.m_Frames - base.m_Start) / base.m_Delay) % base.m_FrameCount]);
                }
            }
            else if (Renderer.m_Dead)
            {
                t = Hues.Grayscale.GetItem(base.m_ItemID);
            }
            else
            {
                t = base.m_Hue.GetItem(base.m_ItemID);
            }
            if (base.m_Source == null)
            {
                num11 -= t.Width / 2;
                num12 += 0x16 - t.Height;
            }
            else
            {
                num11 -= t.xMin + ((t.xMax - t.xMin) / 2);
                num12 -= t.yMin + ((t.yMax - t.yMin) / 2);
            }
            if (base.m_Target == null)
            {
                num13 -= t.Width / 2;
                num14 += 0x16 - t.Height;
            }
            else
            {
                num13 -= t.xMin + ((t.xMax - t.xMin) / 2);
                num14 -= t.yMin + ((t.yMax - t.yMin) / 2);
            }
            int num15 = num11 + ((int)((num13 - num11) * normalized));
            int num16 = num12 + ((int)((num14 - num12) * normalized));

            if (this.m_vCache == null)
            {
                this.m_vCache = base.VCPool.GetInstance();
            }
            this.m_vCache.DrawGame(t, num15, num16);
            if (this.m_Double)
            {
                if (this.m_vCacheDouble == null)
                {
                    this.m_vCacheDouble = base.VCPool.GetInstance();
                }
                this.m_vCacheDouble.DrawGame(t, num15 + 5, num16 + 5);
            }
            return(true);
        }
Beispiel #46
0
        protected internal override void Draw(int x, int y)
        {
            Renderer.SetTexture(null);
            int num = 0;

            switch (this.m_Style)
            {
            case WindowsButtonStyle.Normal:
                switch (this.m_State)
                {
                case 0:
                    GumpPaint.DrawRaised3D(x, y, this.m_Width, this.m_Height);
                    this.CaptionDown = false;
                    goto Label_0143;

                case 1:
                    GumpPaint.DrawRaised3D(x, y, this.m_Width, this.m_Height);
                    this.CaptionDown = false;
                    goto Label_0143;

                case 2:
                    GumpPaint.DrawFlat(x, y, this.m_Width, this.m_Height, GumpColors.ControlDark, GumpColors.Control);
                    this.CaptionDown = true;
                    num = 1;
                    goto Label_0143;
                }
                break;

            case WindowsButtonStyle.Flat:
                switch (this.m_State)
                {
                case 0:
                    GumpPaint.DrawFlat(x, y, this.m_Width, this.m_Height, GumpColors.ControlDarkDark, GumpColors.Control);
                    this.CaptionDown = false;
                    goto Label_0143;

                case 1:
                    GumpPaint.DrawFlat(x, y, this.m_Width, this.m_Height, GumpColors.ControlDarkDark, GumpColors.ControlAlternate);
                    this.CaptionDown = false;
                    goto Label_0143;

                case 2:
                    GumpPaint.DrawFlat(x, y, this.m_Width, this.m_Height, GumpColors.ControlDarkDark, GumpPaint.Blend(GumpColors.ControlAlternate, GumpColors.ControlLightLight, 0x80));
                    this.CaptionDown = false;
                    goto Label_0143;
                }
                break;
            }
Label_0143:
            if (this.m_Image != null)
            {
                if (this.m_vCache == null)
                {
                    this.m_vCache = new VertexCache();
                }
                if (this.m_ImageColor == -1)
                {
                    this.m_vCache.Draw(this.m_Image, ((num + x) + ((this.m_Width - ((this.m_Image.xMax - this.m_Image.xMin) + 1)) / 2)) - this.m_Image.xMin, ((num + y) + ((this.m_Height - ((this.m_Image.yMax - this.m_Image.yMin) + 1)) / 2)) - this.m_Image.yMin);
                }
                else
                {
                    Renderer.SetAlphaEnable(true);
                    Renderer.SetAlpha(1f);
                    this.m_vCache.Draw(this.m_Image, ((num + x) + ((this.m_Width - ((this.m_Image.xMax - this.m_Image.xMin) + 1)) / 2)) - this.m_Image.xMin, ((num + y) + ((this.m_Height - ((this.m_Image.yMax - this.m_Image.yMin) + 1)) / 2)) - this.m_Image.yMin, this.m_ImageColor);
                    Renderer.SetAlphaEnable(false);
                }
            }
        }
Beispiel #47
0
 public void Draw(int x, int y)
 {
     if (this.m_vCache == null)
     {
         this.m_vCache = this.VCPool.GetInstance();
     }
     this.m_vCache.Draw(this.m_Image, x, y);
 }
Beispiel #48
0
 protected internal override void Draw(int X, int Y)
 {
     if (this.m_Invalidated)
     {
         this.Refresh();
     }
     if (this.m_Draw)
     {
         if (!this.m_Clip)
         {
             if (this.m_bAlpha)
             {
                 Renderer.SetAlpha(this.m_fAlpha);
                 Renderer.SetAlphaEnable(true);
             }
             if (this.m_vCache == null)
             {
                 this.m_vCache = this.VCPool.GetInstance();
             }
             this.m_vCache.Draw(this.m_Image, X, Y);
             if (this.m_bAlpha)
             {
                 Renderer.SetAlphaEnable(false);
             }
         }
         else if (!this.m_Relative)
         {
             if (!this.m_bAlpha)
             {
                 this.m_Image.DrawClipped(X, Y, this.m_Clipper);
             }
             else
             {
                 Renderer.SetAlphaEnable(true);
                 Renderer.SetAlpha(this.m_fAlpha);
                 this.m_Image.DrawClipped(X, Y, this.m_Clipper);
                 Renderer.SetAlphaEnable(false);
             }
         }
         else if (!this.m_bAlpha)
         {
             this.m_Image.DrawClipped(X, Y, Client.Clipper.TemporaryInstance(X + this.m_xClipOffset, Y + this.m_yClipOffset, this.m_xClipWidth, this.m_yClipHeight));
         }
         else
         {
             Renderer.SetAlphaEnable(true);
             Renderer.SetAlpha(this.m_fAlpha);
             this.m_Image.DrawClipped(X, Y, Client.Clipper.TemporaryInstance(X + this.m_xClipOffset, Y + this.m_yClipOffset, this.m_xClipWidth, this.m_yClipHeight));
             Renderer.SetAlphaEnable(false);
         }
     }
 }
Beispiel #49
0
        protected internal override void Draw(int x, int y)
        {
            Renderer.SetTexture(null);
            int num = 0;
            switch (this.m_Style)
            {
                case WindowsButtonStyle.Normal:
                    switch (this.m_State)
                    {
                        case 0:
                            GumpPaint.DrawRaised3D(x, y, this.m_Width, this.m_Height);
                            this.CaptionDown = false;
                            goto Label_0143;

                        case 1:
                            GumpPaint.DrawRaised3D(x, y, this.m_Width, this.m_Height);
                            this.CaptionDown = false;
                            goto Label_0143;

                        case 2:
                            GumpPaint.DrawFlat(x, y, this.m_Width, this.m_Height, GumpColors.ControlDark, GumpColors.Control);
                            this.CaptionDown = true;
                            num = 1;
                            goto Label_0143;
                    }
                    break;

                case WindowsButtonStyle.Flat:
                    switch (this.m_State)
                    {
                        case 0:
                            GumpPaint.DrawFlat(x, y, this.m_Width, this.m_Height, GumpColors.ControlDarkDark, GumpColors.Control);
                            this.CaptionDown = false;
                            goto Label_0143;

                        case 1:
                            GumpPaint.DrawFlat(x, y, this.m_Width, this.m_Height, GumpColors.ControlDarkDark, GumpColors.ControlAlternate);
                            this.CaptionDown = false;
                            goto Label_0143;

                        case 2:
                            GumpPaint.DrawFlat(x, y, this.m_Width, this.m_Height, GumpColors.ControlDarkDark, GumpPaint.Blend(GumpColors.ControlAlternate, GumpColors.ControlLightLight, 0x80));
                            this.CaptionDown = false;
                            goto Label_0143;
                    }
                    break;
            }
            Label_0143:
            if (this.m_Image != null)
            {
                if (this.m_vCache == null)
                {
                    this.m_vCache = new VertexCache();
                }
                if (this.m_ImageColor == -1)
                {
                    this.m_vCache.Draw(this.m_Image, ((num + x) + ((this.m_Width - ((this.m_Image.xMax - this.m_Image.xMin) + 1)) / 2)) - this.m_Image.xMin, ((num + y) + ((this.m_Height - ((this.m_Image.yMax - this.m_Image.yMin) + 1)) / 2)) - this.m_Image.yMin);
                }
                else
                {
                    Renderer.SetAlphaEnable(true);
                    Renderer.SetAlpha(1f);
                    this.m_vCache.Draw(this.m_Image, ((num + x) + ((this.m_Width - ((this.m_Image.xMax - this.m_Image.xMin) + 1)) / 2)) - this.m_Image.xMin, ((num + y) + ((this.m_Height - ((this.m_Image.yMax - this.m_Image.yMin) + 1)) / 2)) - this.m_Image.yMin, this.m_ImageColor);
                    Renderer.SetAlphaEnable(false);
                }
            }
        }
Beispiel #50
0
 public void OnRemove()
 {
     this.VCPool.ReleaseInstance(this.m_vCache);
     this.m_vCache = null;
 }
Beispiel #51
0
 public static void SetText(string text)
 {
     int emoteHue;
     text = Engine.Encode(text);
     if (text.StartsWith("--") && UOAM.Connected)
     {
         text = "Chat: " + text.Substring(2) + "_";
         emoteHue = 0x59;
     }
     else if (text.StartsWith(": "))
     {
         text = "Emote: " + text.Substring(2) + "_";
         emoteHue = World.CharData.EmoteHue;
     }
     else if (text.StartsWith("; "))
     {
         text = "Whisper: " + text.Substring(2) + "_";
         emoteHue = World.CharData.WhisperHue;
     }
     else if (text.StartsWith("! "))
     {
         text = "Yell: " + text.Substring(2) + "_";
         emoteHue = World.CharData.YellHue;
     }
     else if (text.StartsWith(". "))
     {
         text = "Command: " + text.Substring(". ".Length) + "_";
         emoteHue = World.CharData.TextHue;
     }
     else if (text.StartsWith(@"\ "))
     {
         text = "<OOC> " + text.Substring(2) + "_";
         emoteHue = World.CharData.TextHue;
     }
     else if (text.StartsWith("/"))
     {
         string s = text;
         text = null;
         emoteHue = World.CharData.TextHue;
         if (((Party.State == PartyState.Joined) && (s.Length >= 2)) && char.IsDigit(s, 1))
         {
             try
             {
                 int index = Convert.ToInt32(s.Substring(1, 1)) - 1;
                 if (((index >= 0) && (index < Party.Members.Length)) && (index != Party.Index))
                 {
                     string str2;
                     Mobile mobile = Party.Members[index];
                     if (((mobile == null) || ((str2 = mobile.Name) == null)) || ((str2 = str2.Trim()).Length <= 0))
                     {
                         str2 = "Someone";
                     }
                     text = str2 + ": " + s.Substring(2);
                     emoteHue = World.CharData.WhisperHue;
                 }
             }
             catch
             {
             }
         }
         if (text == null)
         {
             text = "Party: " + s.Substring(1) + "_";
         }
     }
     else
     {
         text = text + "_";
         emoteHue = World.CharData.TextHue;
     }
     if (m_vTextCache == null)
     {
         m_vTextCache = new VertexCache();
     }
     else
     {
         m_vTextCache.Invalidate();
     }
     m_TextSurface = Engine.GetUniFont(3).GetString(text, Hues.Load(emoteHue));
 }