public override void Update(Microsoft.Xna.Framework.GameTime gameTime) { if (IsInitialized && m_text == null) { ResizePic resize; m_text = new HtmlGump(this, 0, 10, 10, 200, 200, 0, 0, m_msg); int width = m_text.Width + 20; AddControl(resize = new ResizePic(this, 0, 0, 0, 9200, width, m_text.Height + 45)); AddControl(m_text); // Add buttons switch (m_type) { case MsgBoxTypes.OkOnly: AddControl(new Button(this, 0, (m_text.Width + 20) / 2 - 23, m_text.Height + 15, 2074, 2075, ButtonTypes.Activate, 0, 0)); ((Button)LastControl).GumpOverID = 2076; break; case MsgBoxTypes.OkCancel: AddControl(new Button(this, 0, (width / 2) - 46 - 10, m_text.Height + 15, 0x817, 0x818, ButtonTypes.Activate, 0, 1)); ((Button)LastControl).GumpOverID = 0x819; AddControl(new Button(this, 0, (width / 2) + 10, m_text.Height + 15, 2074, 2075, ButtonTypes.Activate, 0, 0)); ((Button)LastControl).GumpOverID = 2076; break; } base.Update(gameTime); Center(); } base.Update(gameTime); }
void buildGumpling(int x, int y, int width, int index, int itemsVisible, string[] items, bool canBeNull) { Position = new Point(x, y); m_items = new List <string>(items); m_width = width; Index = index; m_visibleItems = itemsVisible; m_canBeNull = canBeNull; m_resize = new ResizePic(m_owner, Page, X, Y, 3000, m_width, UltimaData.FontsOld.ASCIIText.Fonts[1].Height + 8); m_resize.OnMouseClick = onClickClosedList; m_resize.OnMouseOver = onMouseOverClosedList; m_resize.OnMouseOut = onMouseOutClosedList; ((Gump)m_owner).AddControl(m_resize); m_label = new TextLabelAscii(m_owner, Page, X + 4, Y + 5, hue_Text, 1, string.Empty); ((Gump)m_owner).AddControl(m_label); ((Gump)m_owner).AddControl(new GumpPic(m_owner, Page, X + width - 22, Y + 5, 2086, 0)); }
void onClickClosedList(int x, int y, MouseButton button) { m_listOpen = true; m_openResizePic = new ResizePic(m_owner, Page, X, Y, 3000, m_width, ASCIIText.Fonts[1].Height * m_visibleItems + 8); m_openResizePic.OnMouseClick = onClickOpenList; m_openResizePic.OnMouseOver = onMouseOverOpenList; m_openResizePic.OnMouseOut = onMouseOutOpenList; ((Gump)m_owner).AddControl(m_openResizePic); // only show the scrollbar if we need to scroll if (m_visibleItems < m_items.Count) { m_openScrollBar = new ScrollBar(m_owner, Page, X + m_width - 20, Y + 4, ASCIIText.Fonts[1].Height * m_visibleItems, (m_canBeNull ? -1 : 0), m_items.Count - m_visibleItems, Index); ((Gump)m_owner).AddControl(m_openScrollBar); } m_openLabels = new TextLabelAscii[m_visibleItems]; for (int i = 0; i < m_visibleItems; i++) { m_openLabels[i] = new TextLabelAscii(m_owner, Page, X + 4, Y + 5 + ASCIIText.Fonts[1].Height * i, 1107, 1, string.Empty); ((Gump)m_owner).AddControl(m_openLabels[i]); } }
void buildGumpling(int x, int y, int width, int index, int itemsVisible, string[] items, bool canBeNull) { Position = new Point(x, y); m_items = new List<string>(items); m_width = width; Index = index; m_visibleItems = itemsVisible; m_canBeNull = canBeNull; m_resize = new ResizePic(m_owner, Page, X, Y, 3000, m_width, UltimaData.Fonts.ASCIIText.Fonts[1].Height + 8); m_resize.OnMouseClick = onClickClosedList; m_resize.OnMouseOver = onMouseOverClosedList; m_resize.OnMouseOut = onMouseOutClosedList; ((Gump)m_owner).AddControl(m_resize); m_label = new TextLabelAscii(m_owner, Page, X + 4, Y + 5, hue_Text, 1, string.Empty); ((Gump)m_owner).AddControl(m_label); ((Gump)m_owner).AddControl(new GumpPic(m_owner, Page, X + width - 22, Y + 5, 2086, 0)); }