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); } } }
private void ProcessHtmlGump(int thisPage, int x, int y, int width, int height, string text, bool hasBack, bool hasScroll, int color) { UnicodeFont uniFont = Engine.GetUniFont(1); if (!hasScroll) { if (hasBack) { GServerBackground toAdd = new GServerBackground(this, x, y, width, height, 0xbbc, true); GHtmlLabel label = new GHtmlLabel(text, uniFont, color, toAdd.OffsetX - 2, toAdd.OffsetY - 1, toAdd.UseWidth); label.Scissor(0, 0, label.Width, toAdd.UseHeight); toAdd.Children.Add(label); this.Pages(thisPage).Add(toAdd); } else { GHtmlLabel label2 = new GHtmlLabel(text, uniFont, color, x - 2, y - 1, width); label2.Scissor(0, 0, label2.Width, height); this.Pages(thisPage).Add(label2); } } else { GHtmlLabel label3; int num; width -= 15; if (hasBack) { GServerBackground background2 = new GServerBackground(this, x, y, width, height, 0xbbc, true); label3 = new GHtmlLabel(text, uniFont, color, background2.OffsetX - 2, background2.OffsetY - 1, background2.UseWidth); label3.Scissor(0, 0, label3.Width, num = background2.UseHeight); background2.Children.Add(label3); this.Pages(thisPage).Add(background2); } else { label3 = new GHtmlLabel(text, uniFont, color, x - 2, y - 1, width); label3.Scissor(0, 0, label3.Width, num = height); this.Pages(thisPage).Add(label3); } if ((height >= 0x1b) && (label3.Height > num)) { this.Pages(thisPage).Add(new GImage(0x101, x + width, y)); this.Pages(thisPage).Add(new GImage(0xff, x + width, (y + height) - 0x20)); for (int i = y + 30; (i + 0x20) < (y + height); i += 30) { this.Pages(thisPage).Add(new GImage(0x100, x + width, i)); } GVSlider slider = new GVSlider(0xfe, (x + width) + 1, (y + 1) + 12, 13, (height - 2) - 0x18, 0.0, 0.0, (double)(label3.Height - num), 1.0); slider.SetTag("yBase", label3.Y); slider.SetTag("toScroll", label3); slider.SetTag("viewHeight", num); slider.OnValueChange = new OnValueChange(this.OnScroll); this.Pages(thisPage).Add(slider); this.Pages(thisPage).Add(new GHotspot(x + width, y, 15, height, slider)); } else { this.Pages(thisPage).Add(new GImage(0x101, x + width, y)); this.Pages(thisPage).Add(new GImage(0xff, x + width, (y + height) - 0x20)); for (int j = y + 30; (j + 0x20) < (y + height); j += 30) { this.Pages(thisPage).Add(new GImage(0x100, x + width, j)); } this.Pages(thisPage).Add(new GImage(0xfe, Hues.Grayscale, (x + width) + 1, y + 1)); } } }
private void ProcessHtmlGump(int thisPage, int x, int y, int width, int height, string text, bool hasBack, bool hasScroll, int color) { UnicodeFont uniFont = Engine.GetUniFont(1); if (!hasScroll) { if (hasBack) { GServerBackground toAdd = new GServerBackground(this, x, y, width, height, 0xbbc, true); GHtmlLabel label = new GHtmlLabel(text, uniFont, color, toAdd.OffsetX - 2, toAdd.OffsetY - 1, toAdd.UseWidth); label.Scissor(0, 0, label.Width, toAdd.UseHeight); toAdd.Children.Add(label); this.Pages(thisPage).Add(toAdd); } else { GHtmlLabel label2 = new GHtmlLabel(text, uniFont, color, x - 2, y - 1, width); label2.Scissor(0, 0, label2.Width, height); this.Pages(thisPage).Add(label2); } } else { GHtmlLabel label3; int num; width -= 15; if (hasBack) { GServerBackground background2 = new GServerBackground(this, x, y, width, height, 0xbbc, true); label3 = new GHtmlLabel(text, uniFont, color, background2.OffsetX - 2, background2.OffsetY - 1, background2.UseWidth); label3.Scissor(0, 0, label3.Width, num = background2.UseHeight); background2.Children.Add(label3); this.Pages(thisPage).Add(background2); } else { label3 = new GHtmlLabel(text, uniFont, color, x - 2, y - 1, width); label3.Scissor(0, 0, label3.Width, num = height); this.Pages(thisPage).Add(label3); } if ((height >= 0x1b) && (label3.Height > num)) { this.Pages(thisPage).Add(new GImage(0x101, x + width, y)); this.Pages(thisPage).Add(new GImage(0xff, x + width, (y + height) - 0x20)); for (int i = y + 30; (i + 0x20) < (y + height); i += 30) { this.Pages(thisPage).Add(new GImage(0x100, x + width, i)); } GVSlider slider = new GVSlider(0xfe, (x + width) + 1, (y + 1) + 12, 13, (height - 2) - 0x18, 0.0, 0.0, (double) (label3.Height - num), 1.0); slider.SetTag("yBase", label3.Y); slider.SetTag("toScroll", label3); slider.SetTag("viewHeight", num); slider.OnValueChange = new OnValueChange(this.OnScroll); this.Pages(thisPage).Add(slider); this.Pages(thisPage).Add(new GHotspot(x + width, y, 15, height, slider)); } else { this.Pages(thisPage).Add(new GImage(0x101, x + width, y)); this.Pages(thisPage).Add(new GImage(0xff, x + width, (y + height) - 0x20)); for (int j = y + 30; (j + 0x20) < (y + height); j += 30) { this.Pages(thisPage).Add(new GImage(0x100, x + width, j)); } this.Pages(thisPage).Add(new GImage(0xfe, Hues.Grayscale, (x + width) + 1, y + 1)); } } }