public override void OnInitialize() { uIElement = new UIElement(); uIElement.Width.Set(0f, 0.8f); uIElement.MaxWidth.Set(600f, 0f); uIElement.Top.Set(220f, 0f); uIElement.Height.Set(-220f, 1f); uIElement.HAlign = 0.5f; UIPanel uIPanel = new UIPanel(); uIPanel.Width.Set(0f, 1f); uIPanel.Height.Set(-110f, 1f); uIPanel.BackgroundColor = new Color(33, 43, 79) * 0.8f; uIElement.Append(uIPanel); modInfo = new UIMessageBox("This is a test of mod info here."); modInfo.Width.Set(-25f, 1f); modInfo.Height.Set(0f, 1f); uIPanel.Append(modInfo); UIScrollbar uIScrollbar = new UIScrollbar(); uIScrollbar.SetView(100f, 1000f); uIScrollbar.Height.Set(-20, 1f); uIScrollbar.VAlign = 0.5f; uIScrollbar.HAlign = 1f; uIPanel.Append(uIScrollbar); modInfo.SetScrollbar(uIScrollbar); uITextPanel = new UITextPanel <string>("Mod Info", 0.8f, true); uITextPanel.HAlign = 0.5f; uITextPanel.Top.Set(-35f, 0f); uITextPanel.SetPadding(15f); uITextPanel.BackgroundColor = new Color(73, 94, 171); uIElement.Append(uITextPanel); modHomepageButton = new UITextPanel <string>("Visit the Mod's Homepage for even more info", 1f, false); modHomepageButton.Width.Set(-10f, 1f); modHomepageButton.Height.Set(25f, 0f); modHomepageButton.VAlign = 1f; modHomepageButton.Top.Set(-65f, 0f); modHomepageButton.OnMouseOver += UICommon.FadedMouseOver; modHomepageButton.OnMouseOut += UICommon.FadedMouseOut; modHomepageButton.OnClick += VisitModHomePage; uIElement.Append(modHomepageButton); UITextPanel <string> backButton = new UITextPanel <string>("Back", 1f, false); backButton.Width.Set(-10f, 0.5f); backButton.Height.Set(25f, 0f); backButton.VAlign = 1f; backButton.Top.Set(-20f, 0f); backButton.OnMouseOver += UICommon.FadedMouseOver; backButton.OnMouseOut += UICommon.FadedMouseOut; backButton.OnClick += BackClick; uIElement.Append(backButton); Append(uIElement); }
public override void OnInitialize() { var area = new UIElement { Width = { Percent = 0.8f }, Top = { Pixels = 200 }, Height = { Pixels = -240, Percent = 1f }, HAlign = 0.5f }; var uIPanel = new UIPanel { Width = { Percent = 1f }, Height = { Pixels = -110, Percent = 1f }, BackgroundColor = UICommon.mainPanelBackground }; area.Append(uIPanel); messageBox = new UIMessageBox("") { Width = { Pixels = -25, Percent = 1f }, Height = { Percent = 1f } }; uIPanel.Append(messageBox); var uIScrollbar = new UIScrollbar { Height = { Pixels = -20, Percent = 1f }, VAlign = 0.5f, HAlign = 1f }.WithView(100f, 1000f); uIPanel.Append(uIScrollbar); messageBox.SetScrollbar(uIScrollbar); var buttonOk = new UITextPanel <string>(Language.GetTextValue("tModLoader.OK"), 0.7f, true) { Width = { Pixels = -10, Percent = 0.5f }, Height = { Pixels = 50 }, Left = { Percent = 0f }, VAlign = 1f, Top = { Pixels = -30 } }.WithFadedMouseOver(); buttonOk.OnClick += OKClick; area.Append(buttonOk); buttonAlt = new UITextPanel <string>("???", 0.7f, true) { Width = { Pixels = -10, Percent = 0.5f }, Height = { Pixels = 50 }, Left = { Percent = .5f }, VAlign = 1f, Top = { Pixels = -30 } }.WithFadedMouseOver(); buttonAlt.OnClick += AltClick; area.Append(buttonAlt); Append(area); }
public override void OnInitialize() { UIElement area = new UIElement(); area.Width.Set(0f, 0.8f); area.Top.Set(200f, 0f); area.Height.Set(-240f, 1f); area.HAlign = 0.5f; UIPanel uIPanel = new UIPanel(); uIPanel.Width.Set(0f, 1f); uIPanel.Height.Set(-110f, 1f); uIPanel.BackgroundColor = new Color(33, 43, 79) * 0.8f; area.Append(uIPanel); message.Width.Set(-25f, 1f); message.Height.Set(0f, 1f); uIPanel.Append(message); UIScrollbar uIScrollbar = new UIScrollbar(); uIScrollbar.SetView(100f, 1000f); uIScrollbar.Height.Set(-20, 1f); uIScrollbar.VAlign = 0.5f; uIScrollbar.HAlign = 1f; uIPanel.Append(uIScrollbar); message.SetScrollbar(uIScrollbar); UITextPanel <string> button1 = new UITextPanel <string>("OK", 0.7f, true); button1.Width.Set(-10f, 0.5f); button1.Height.Set(50f, 0f); button1.Left.Set(0, 0f); button1.VAlign = 1f; button1.Top.Set(-30f, 0f); button1.OnMouseOver += UICommon.FadedMouseOver; button1.OnMouseOut += UICommon.FadedMouseOut; button1.OnClick += OKClick; area.Append(button1); button2 = new UITextPanel <string>("???", 0.7f, true); button2.Width.Set(-10f, 0.5f); button2.Height.Set(50f, 0f); button2.Left.Set(0, .5f); button2.VAlign = 1f; button2.Top.Set(-30f, 0f); button2.OnMouseOver += UICommon.FadedMouseOver; button2.OnMouseOut += UICommon.FadedMouseOut; button2.OnClick += AltClick; area.Append(button2); Append(area); }
private void ShowOfflineTroubleshootingMessage() { var message = new UIMessageBox(Language.GetTextValue("tModLoader.MBOfflineTroubleshooting")); message.Width.Set(0, 1); message.Height.Set(400, 0); message.OnDoubleClick += (a, b) => { System.Diagnostics.Process.Start("http://javid.ddns.net/tModLoader/DirectModDownloadListing.php"); }; modList.Add(message); message.SetScrollbar(new UIScrollbar()); uIPanel.RemoveChild(uILoader); }
public override void OnInitialize() { uIElement = new UIElement(); uIElement.Width.Set(0f, 0.8f); uIElement.MaxWidth.Set(600f, 0f); uIElement.Top.Set(220f, 0f); uIElement.Height.Set(-220f, 1f); uIElement.HAlign = 0.5f; UIPanel uIPanel = new UIPanel(); uIPanel.Width.Set(0f, 1f); uIPanel.Height.Set(-110f, 1f); uIPanel.BackgroundColor = new Color(33, 43, 79) * 0.8f; uIElement.Append(uIPanel); modInfo = new UIMessageBox("This is a test of mod info here."); modInfo.Width.Set(-25f, 1f); modInfo.Height.Set(0f, 1f); uIPanel.Append(modInfo); UIScrollbar uIScrollbar = new UIScrollbar(); uIScrollbar.SetView(100f, 1000f); uIScrollbar.Height.Set(0f, 1f); uIScrollbar.HAlign = 1f; uIPanel.Append(uIScrollbar); modInfo.SetScrollbar(uIScrollbar); uITextPanel = new UITextPanel("Mod Info", 0.8f, true); uITextPanel.HAlign = 0.5f; uITextPanel.Top.Set(-35f, 0f); uITextPanel.SetPadding(15f); uITextPanel.BackgroundColor = new Color(73, 94, 171); uIElement.Append(uITextPanel); modHomepageButton = new UITextPanel("Visit the Mod's Homepage for even more info", 1f, false); modHomepageButton.Width.Set(-10f, 1f); modHomepageButton.Height.Set(25f, 0f); modHomepageButton.VAlign = 1f; modHomepageButton.Top.Set(-65f, 0f); modHomepageButton.OnMouseOver += new UIElement.MouseEvent(FadedMouseOver); modHomepageButton.OnMouseOut += new UIElement.MouseEvent(FadedMouseOut); modHomepageButton.OnClick += new UIElement.MouseEvent(VisitModHomePage); uIElement.Append(modHomepageButton); UITextPanel backButton = new UITextPanel("Back", 1f, false); backButton.Width.Set(-10f, 0.5f); backButton.Height.Set(25f, 0f); backButton.VAlign = 1f; backButton.Top.Set(-20f, 0f); backButton.OnMouseOver += new UIElement.MouseEvent(FadedMouseOver); backButton.OnMouseOut += new UIElement.MouseEvent(FadedMouseOut); backButton.OnClick += new UIElement.MouseEvent(BackClick); uIElement.Append(backButton); base.Append(uIElement); }
public override void OnInitialize() { UIElement area = new UIElement(); area.Width.Set(0f, 0.8f); area.Top.Set(200f, 0f); area.Height.Set(-240f, 1f); area.HAlign = 0.5f; UIPanel uIPanel = new UIPanel(); uIPanel.Width.Set(0f, 1f); uIPanel.Height.Set(-110f, 1f); uIPanel.BackgroundColor = new Color(33, 43, 79) * 0.8f; area.Append(uIPanel); message.Width.Set(-25f, 1f); message.Height.Set(0f, 1f); uIPanel.Append(message); UIScrollbar uIScrollbar = new UIScrollbar(); uIScrollbar.SetView(100f, 1000f); uIScrollbar.Height.Set(-20, 1f); uIScrollbar.VAlign = 0.5f; uIScrollbar.HAlign = 1f; uIPanel.Append(uIScrollbar); message.SetScrollbar(uIScrollbar); UITextPanel <string> button = new UITextPanel <string>(Language.GetTextValue("tModLoader.OK"), 0.7f, true); button.Width.Set(-10f, 0.5f); button.Height.Set(50f, 0f); button.Left.Set(0, .25f); button.VAlign = 1f; button.Top.Set(-30f, 0f); button.OnMouseOver += UICommon.FadedMouseOver; button.OnMouseOut += UICommon.FadedMouseOut; button.OnClick += OKClick; area.Append(button); Append(area); }
public override void OnInitialize() { _uIElement = new UIElement { Width = { Percent = 0.8f }, MaxWidth = UICommon.MaxPanelWidth, Top = { Pixels = 220 }, Height = { Pixels = -220, Percent = 1f }, HAlign = 0.5f }; var uIPanel = new UIPanel { Width = { Percent = 1f }, Height = { Pixels = -110, Percent = 1f }, BackgroundColor = UICommon.MainPanelBackground }; _uIElement.Append(uIPanel); _modInfo = new UIMessageBox(string.Empty) { Width = { Pixels = -25, Percent = 1f }, Height = { Percent = 1f } }; uIPanel.Append(_modInfo); var uIScrollbar = new UIScrollbar { Height = { Pixels = -20, Percent = 1f }, VAlign = 0.5f, HAlign = 1f }.WithView(100f, 1000f); uIPanel.Append(uIScrollbar); _modInfo.SetScrollbar(uIScrollbar); _uITextPanel = new UITextPanel <string>(Language.GetTextValue("tModLoader.ModInfoHeader"), 0.8f, true) { HAlign = 0.5f, Top = { Pixels = -35 }, BackgroundColor = UICommon.DefaultUIBlue }.WithPadding(15f); _uIElement.Append(_uITextPanel); _modHomepageButton = new UIAutoScaleTextTextPanel <string>(Language.GetTextValue("tModLoader.ModInfoVisitHomepage")) { Width = { Percent = 1f }, Height = { Pixels = 40 }, VAlign = 1f, Top = { Pixels = -65 } }.WithFadedMouseOver(); _modHomepageButton.OnClick += VisitModHomePage; var backButton = new UIAutoScaleTextTextPanel <string>(Language.GetTextValue("UI.Back")) { Width = { Pixels = -10, Percent = 0.333f }, Height = { Pixels = 40 }, VAlign = 1f, Top = { Pixels = -20 } }.WithFadedMouseOver(); backButton.OnClick += BackClick; _uIElement.Append(backButton); _extractButton = new UIAutoScaleTextTextPanel <string>(Language.GetTextValue("tModLoader.ModInfoExtract")) { Width = { Pixels = -10, Percent = 0.333f }, Height = { Pixels = 40 }, VAlign = 1f, HAlign = 0.5f, Top = { Pixels = -20 } }.WithFadedMouseOver(); _extractButton.OnClick += ExtractMod; _deleteButton = new UIAutoScaleTextTextPanel <string>(Language.GetTextValue("UI.Delete")) { Width = { Pixels = -10, Percent = 0.333f }, Height = { Pixels = 40 }, VAlign = 1f, HAlign = 1f, Top = { Pixels = -20 } }.WithFadedMouseOver(); _deleteButton.OnClick += DeleteMod; _fakeDeleteButton = new UIAutoScaleTextTextPanel <string>(Language.GetTextValue("UI.Delete")) { Width = { Pixels = -10, Percent = 0.333f }, Height = { Pixels = 40 }, VAlign = 1f, HAlign = 1f, Top = { Pixels = -20 } }; _fakeDeleteButton.BackgroundColor = Color.Gray; Append(_uIElement); }
public override void OnInitialize() { uIElement = new UIElement(); uIElement.Width.Set(0f, 0.8f); uIElement.MaxWidth.Set(600f, 0f); uIElement.Top.Set(220f, 0f); uIElement.Height.Set(-220f, 1f); uIElement.HAlign = 0.5f; UIPanel uIPanel = new UIPanel(); uIPanel.Width.Set(0f, 1f); uIPanel.Height.Set(-110f, 1f); uIPanel.BackgroundColor = new Color(33, 43, 79) * 0.8f; uIElement.Append(uIPanel); modInfo = new UIMessageBox("This is a test of mod info here."); modInfo.Width.Set(-25f, 1f); modInfo.Height.Set(0f, 1f); uIPanel.Append(modInfo); UIScrollbar uIScrollbar = new UIScrollbar(); uIScrollbar.SetView(100f, 1000f); uIScrollbar.Height.Set(-20, 1f); uIScrollbar.VAlign = 0.5f; uIScrollbar.HAlign = 1f; uIPanel.Append(uIScrollbar); modInfo.SetScrollbar(uIScrollbar); uITextPanel = new UITextPanel <string>(Language.GetTextValue("tModLoader.ModInfoHeader"), 0.8f, true) { HAlign = 0.5f }; uITextPanel.Top.Set(-35f, 0f); uITextPanel.SetPadding(15f); uITextPanel.BackgroundColor = new Color(73, 94, 171); uIElement.Append(uITextPanel); modHomepageButton = new UIAutoScaleTextTextPanel <string>(Language.GetTextValue("tModLoader.ModInfoVisitHomepage"), 1f, false); modHomepageButton.Width.Set(0f, 1f); modHomepageButton.Height.Set(40f, 0f); modHomepageButton.VAlign = 1f; modHomepageButton.Top.Set(-65f, 0f); modHomepageButton.OnMouseOver += UICommon.FadedMouseOver; modHomepageButton.OnMouseOut += UICommon.FadedMouseOut; modHomepageButton.OnClick += VisitModHomePage; uIElement.Append(modHomepageButton); UIAutoScaleTextTextPanel <string> backButton = new UIAutoScaleTextTextPanel <string>(Language.GetTextValue("UI.Back"), 1f, false); backButton.Width.Set(-10f, 0.333f); backButton.Height.Set(40f, 0f); backButton.VAlign = 1f; backButton.Top.Set(-20f, 0f); backButton.OnMouseOver += UICommon.FadedMouseOver; backButton.OnMouseOut += UICommon.FadedMouseOut; backButton.OnClick += BackClick; uIElement.Append(backButton); extractButton = new UIAutoScaleTextTextPanel <string>(Language.GetTextValue("tModLoader.ModInfoExtract"), 1f, false); extractButton.Width.Set(-10f, 0.333f); extractButton.Height.Set(40f, 0f); extractButton.VAlign = 1f; extractButton.HAlign = 0.5f; extractButton.Top.Set(-20f, 0f); extractButton.OnMouseOver += UICommon.FadedMouseOver; extractButton.OnMouseOut += UICommon.FadedMouseOut; extractButton.OnClick += ExtractClick; uIElement.Append(extractButton); deleteButton = new UIAutoScaleTextTextPanel <string>(Language.GetTextValue("UI.Delete"), 1f, false); deleteButton.Width.Set(-10f, 0.333f); deleteButton.Height.Set(40f, 0f); deleteButton.VAlign = 1f; deleteButton.HAlign = 1f; deleteButton.Top.Set(-20f, 0f); deleteButton.OnMouseOver += UICommon.FadedMouseOver; deleteButton.OnMouseOut += UICommon.FadedMouseOut; deleteButton.OnClick += DeleteClick; uIElement.Append(deleteButton); Append(uIElement); }