Пример #1
0
 protected internal override void Render(int X, int Y)
 {
     if (this.m_AlphaRegions.Count == 0)
     {
         base.Render(X, Y);
     }
     else if (base.m_Visible)
     {
         int x = X + this.X;
         int y = Y + this.Y;
         this.Draw(x, y);
         Gump[]        gumpArray = base.m_Children.ToArray();
         RectangleList list      = new RectangleList();
         RectangleList list2     = new RectangleList();
         int           num3      = 0;
         for (int i = 0; i < gumpArray.Length; i++)
         {
             Gump gump = gumpArray[i];
             if (gump is GTransparentRegion)
             {
                 num3++;
                 continue;
             }
             if (num3 >= this.m_AlphaRegions.Count)
             {
                 gump.Render(x, y);
                 continue;
             }
             Rectangle rect = new Rectangle(gump.X, gump.Y, gump.Width, gump.Height);
             list.Add(rect);
             for (int j = num3; j < this.m_AlphaRegions.Count; j++)
             {
                 Gump gump2 = (Gump)this.m_AlphaRegions[j];
                 if (gump2 is GTransparentRegion)
                 {
                     Rectangle a          = new Rectangle(gump2.X, gump2.Y, gump2.Width, gump2.Height);
                     Rectangle rectangle3 = Rectangle.Intersect(a, rect);
                     list.Remove(rectangle3);
                     list2.Add(rectangle3);
                 }
             }
             if (list2.Count > 0)
             {
                 for (int k = i + 1; k < gumpArray.Length; k++)
                 {
                     Gump gump3 = gumpArray[k];
                     if (gump3 is GServerBackground)
                     {
                         GServerBackground background = (GServerBackground)gump3;
                         Rectangle         rectangle4 = new Rectangle(background.X + background.OffsetX, background.Y + background.OffsetY, background.UseWidth, background.UseHeight);
                         list.Remove(rectangle4);
                         list2.Remove(rectangle4);
                     }
                     else if (gump3 == this.m_AlphaRegions[this.m_AlphaRegions.Count - 1])
                     {
                         break;
                     }
                 }
                 if ((list2.Count == 1) && (list.Count == 0))
                 {
                     Renderer.SetAlphaEnable(true);
                     Renderer.SetAlpha(0.5f);
                     gump.Render(x, y);
                     Renderer.SetAlphaEnable(false);
                 }
                 else
                 {
                     for (int m = 0; m < list.Count; m++)
                     {
                         Rectangle rectangle5 = list[m];
                         if (Renderer.SetViewport(x + rectangle5.X, y + rectangle5.Y, rectangle5.Width, rectangle5.Height))
                         {
                             gump.Render(x, y);
                         }
                     }
                     for (int n = 0; n < list2.Count; n++)
                     {
                         Rectangle rectangle6 = list2[n];
                         if (Renderer.SetViewport(x + rectangle6.X, y + rectangle6.Y, rectangle6.Width, rectangle6.Height))
                         {
                             Renderer.SetAlphaEnable(true);
                             Renderer.SetAlpha(0.5f);
                             gump.Render(x, y);
                             Renderer.SetAlphaEnable(false);
                         }
                     }
                     if ((list.Count > 0) || (list2.Count > 0))
                     {
                         Renderer.SetViewport(0, 0, Engine.ScreenWidth, Engine.ScreenHeight);
                     }
                 }
                 list.Clear();
                 list2.Clear();
                 continue;
             }
             gump.Render(x, y);
         }
     }
 }
Пример #2
0
 protected internal override void Render(int X, int Y)
 {
     if (this.m_AlphaRegions.Count == 0)
     {
         base.Render(X, Y);
     }
     else if (base.m_Visible)
     {
         int x = X + this.X;
         int y = Y + this.Y;
         this.Draw(x, y);
         Gump[] gumpArray = base.m_Children.ToArray();
         RectangleList list = new RectangleList();
         RectangleList list2 = new RectangleList();
         int num3 = 0;
         for (int i = 0; i < gumpArray.Length; i++)
         {
             Gump gump = gumpArray[i];
             if (gump is GTransparentRegion)
             {
                 num3++;
                 continue;
             }
             if (num3 >= this.m_AlphaRegions.Count)
             {
                 gump.Render(x, y);
                 continue;
             }
             Rectangle rect = new Rectangle(gump.X, gump.Y, gump.Width, gump.Height);
             list.Add(rect);
             for (int j = num3; j < this.m_AlphaRegions.Count; j++)
             {
                 Gump gump2 = (Gump) this.m_AlphaRegions[j];
                 if (gump2 is GTransparentRegion)
                 {
                     Rectangle a = new Rectangle(gump2.X, gump2.Y, gump2.Width, gump2.Height);
                     Rectangle rectangle3 = Rectangle.Intersect(a, rect);
                     list.Remove(rectangle3);
                     list2.Add(rectangle3);
                 }
             }
             if (list2.Count > 0)
             {
                 for (int k = i + 1; k < gumpArray.Length; k++)
                 {
                     Gump gump3 = gumpArray[k];
                     if (gump3 is GServerBackground)
                     {
                         GServerBackground background = (GServerBackground) gump3;
                         Rectangle rectangle4 = new Rectangle(background.X + background.OffsetX, background.Y + background.OffsetY, background.UseWidth, background.UseHeight);
                         list.Remove(rectangle4);
                         list2.Remove(rectangle4);
                     }
                     else if (gump3 == this.m_AlphaRegions[this.m_AlphaRegions.Count - 1])
                     {
                         break;
                     }
                 }
                 if ((list2.Count == 1) && (list.Count == 0))
                 {
                     Renderer.SetAlphaEnable(true);
                     Renderer.SetAlpha(0.5f);
                     gump.Render(x, y);
                     Renderer.SetAlphaEnable(false);
                 }
                 else
                 {
                     for (int m = 0; m < list.Count; m++)
                     {
                         Rectangle rectangle5 = list[m];
                         if (Renderer.SetViewport(x + rectangle5.X, y + rectangle5.Y, rectangle5.Width, rectangle5.Height))
                         {
                             gump.Render(x, y);
                         }
                     }
                     for (int n = 0; n < list2.Count; n++)
                     {
                         Rectangle rectangle6 = list2[n];
                         if (Renderer.SetViewport(x + rectangle6.X, y + rectangle6.Y, rectangle6.Width, rectangle6.Height))
                         {
                             Renderer.SetAlphaEnable(true);
                             Renderer.SetAlpha(0.5f);
                             gump.Render(x, y);
                             Renderer.SetAlphaEnable(false);
                         }
                     }
                     if ((list.Count > 0) || (list2.Count > 0))
                     {
                         Renderer.SetViewport(0, 0, Engine.ScreenWidth, Engine.ScreenHeight);
                     }
                 }
                 list.Clear();
                 list2.Clear();
                 continue;
             }
             gump.Render(x, y);
         }
     }
 }