private Gump CreateLabel(string text, bool scroll) { text = text.Replace('\r', '\n'); GBackground gbackground = new GBackground(3004, 200, 100, true); GWrappedLabel gwrappedLabel = new GWrappedLabel(text, (IFont)Engine.GetFont(1), Hues.Load(1109), gbackground.OffsetX, gbackground.OffsetY, gbackground.UseWidth); gbackground.Height = gwrappedLabel.Height + (gbackground.Height - gbackground.UseHeight); gbackground.Children.Add((Gump)gwrappedLabel); gwrappedLabel.Center(); gbackground.SetMouseOverride((Gump)this); return((Gump)gbackground); }
public virtual Gump GetGump() { if (this.m_Gump != null) { return(this.m_Gump); } if (this.m_Text == null || this.m_Text.Length <= 0) { return(this.m_Gump = (Gump)null); } this.m_Gump = (Gump) new GAlphaBackground(0, 0, 100, 100); GWrappedLabel gwrappedLabel = new GWrappedLabel(this.m_Text, (IFont)Engine.GetUniFont(1), Hues.Load(1153), 4, 4, this.m_WrapWidth); gwrappedLabel.X -= gwrappedLabel.Image.xMin; gwrappedLabel.Y -= gwrappedLabel.Image.yMin; this.m_Gump.Width = gwrappedLabel.Image.xMax - gwrappedLabel.Image.xMin + 9; this.m_Gump.Height = gwrappedLabel.Image.yMax - gwrappedLabel.Image.yMin + 9; this.m_Gump.Children.Add((Gump)gwrappedLabel); return(this.m_Gump); }
public GUpdateScroll(string text) : base(5058, 100, 100, 40, 30, true) { GLabel glabel = new GLabel("Updates", Engine.DefaultFont, Hues.Load(496), this.OffsetX, this.OffsetY); GBackground gbackground = new GBackground(3004, 100, 100, this.OffsetX, glabel.Y + glabel.Height + 4, true); GWrappedLabel gwrappedLabel = new GWrappedLabel(text, (IFont)Engine.GetFont(1), Hues.Load(1109), gbackground.OffsetX + 2, gbackground.OffsetY + 2, 250); gbackground.Width = gbackground.Width - gbackground.UseWidth + gwrappedLabel.Width + 6; gbackground.Height = gbackground.Height - gbackground.UseHeight + gwrappedLabel.Height + 2; gbackground.Children.Add((Gump)gwrappedLabel); this.Width = this.Width - this.UseWidth + gbackground.Width; this.Height = this.Height - this.UseHeight + glabel.Height + 4 + gbackground.Height; glabel.X += (this.UseWidth - glabel.Width) / 2; this.m_CanDrag = true; this.m_QuickDrag = true; this.CanClose = true; gbackground.SetMouseOverride((Gump)this); this.m_Children.Add((Gump)glabel); this.m_Children.Add((Gump)gbackground); }