public override void OnInitialize() { var area = new UIElement { Width = { Percent = 0.8f }, Top = { Pixels = 200 }, Height = { Pixels = -240, Percent = 1f }, HAlign = 0.5f }; message.Width.Percent = 1f; message.Height.Percent = 0.8f; message.HAlign = 0.5f; area.Append(message); var button = new UITextPanel <string>("Ignore", 0.7f, true) { Width = { Pixels = -10, Percent = 0.5f }, Height = { Pixels = 50 }, VAlign = 1f, Top = { Pixels = -30 } }; button.WithFadedMouseOver(); button.OnClick += IgnoreClick; area.Append(button); var button2 = new UITextPanel <string>("Download", 0.7f, true); button2.CopyStyle(button); button2.HAlign = 1f; button2.WithFadedMouseOver(); button2.OnClick += OpenURL; area.Append(button2); 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; message.Width.Set(0f, 1f); message.Height.Set(0f, 0.8f); message.HAlign = 0.5f; area.Append(message); UITextPanel button = new UITextPanel("Continue", 0.7f, true); button.Width.Set(-10f, 0.5f); button.Height.Set(50f, 0f); button.VAlign = 1f; button.Top.Set(-30f, 0f); button.OnMouseOver += new UIElement.MouseEvent(FadedMouseOver); button.OnMouseOut += new UIElement.MouseEvent(FadedMouseOut); button.OnClick += new UIElement.MouseEvent(ContinueClick); area.Append(button); UITextPanel button2 = new UITextPanel("Open Logs", 0.7f, true); button2.CopyStyle(button); button2.HAlign = 1f; button2.OnMouseOver += new UIElement.MouseEvent(FadedMouseOver); button2.OnMouseOut += new UIElement.MouseEvent(FadedMouseOut); button2.OnClick += new UIElement.MouseEvent(OpenFile); area.Append(button2); base.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; message.Width.Set(0f, 1f); message.Height.Set(0f, 0.8f); message.HAlign = 0.5f; area.Append(message); UITextPanel <string> button = new UITextPanel <string>("Ignore", 0.7f, true); button.Width.Set(-10f, 0.5f); button.Height.Set(50f, 0f); button.VAlign = 1f; button.Top.Set(-30f, 0f); button.OnMouseOver += UICommon.FadedMouseOver; button.OnMouseOut += UICommon.FadedMouseOut; button.OnClick += IgnoreClick; area.Append(button); UITextPanel <string> button2 = new UITextPanel <string>("Download", 0.7f, true); button2.CopyStyle(button); button2.HAlign = 1f; button2.OnMouseOver += UICommon.FadedMouseOver; button2.OnMouseOut += UICommon.FadedMouseOut; button2.OnClick += OpenURL; area.Append(button2); base.Append(area); }
public UIModSourceItem(string mod) { this.mod = mod; this.BorderColor = new Color(89, 116, 213) * 0.7f; this.dividerTexture = TextureManager.Load("Images/UI/Divider"); this.Height.Set(90f, 0f); this.Width.Set(0f, 1f); base.SetPadding(6f); this.modName = new UIText(Path.GetFileName(mod), 1f, false); this.modName.Left.Set(10f, 0f); this.modName.Top.Set(5f, 0f); base.Append(this.modName); UITextPanel button = new UITextPanel("Build", 1f, false); button.Width.Set(100f, 0f); button.Height.Set(30f, 0f); button.Left.Set(10f, 0f); button.Top.Set(40f, 0f); button.PaddingTop -= 2f; button.PaddingBottom -= 2f; button.OnMouseOver += new UIElement.MouseEvent(FadedMouseOver); button.OnMouseOut += new UIElement.MouseEvent(FadedMouseOut); button.OnClick += new UIElement.MouseEvent(this.BuildMod); base.Append(button); UITextPanel button2 = new UITextPanel("Build + Reload", 1f, false); button2.CopyStyle(button); button2.Width.Set(200f, 0f); button2.Left.Set(150f, 0f); button2.OnMouseOver += new UIElement.MouseEvent(FadedMouseOver); button2.OnMouseOut += new UIElement.MouseEvent(FadedMouseOut); button2.OnClick += new UIElement.MouseEvent(this.BuildAndReload); base.Append(button2); base.OnDoubleClick += new UIElement.MouseEvent(this.BuildAndReload); }
public override void OnInitialize() { var element = new UIElement(); element.Width.Set(0.0f, 0.8f); element.MaxWidth.Set(650f, 0.0f); element.Top.Set(220f, 0.0f); element.Height.Set(-220f, 1f); element.HAlign = 0.5f; var uiPanel = new UIPanel(); uiPanel.Width.Set(0.0f, 1f); uiPanel.Height.Set(-110f, 1f); uiPanel.BackgroundColor = new Color(33, 43, 79) * 0.8f; element.Append((UIElement)uiPanel); this._containerPanel = uiPanel; this._worldList = new UIList(); this._worldList.Width.Set(-25f, 1f); this._worldList.Height.Set(0.0f, 1f); this._worldList.ListPadding = 5f; uiPanel.Append((UIElement)this._worldList); var scrollbar = new UIScrollbar(); scrollbar.SetView(100f, 1000f); scrollbar.Height.Set(0.0f, 1f); scrollbar.HAlign = 1f; uiPanel.Append((UIElement)scrollbar); this._worldList.SetScrollbar(scrollbar); var uiTextPanel1 = new UITextPanel <LocalizedText>(Language.GetText("UI.SelectWorld"), 0.8f, true); uiTextPanel1.HAlign = 0.5f; uiTextPanel1.Top.Set(-35f, 0.0f); uiTextPanel1.SetPadding(15f); uiTextPanel1.BackgroundColor = new Color(73, 94, 171); element.Append((UIElement)uiTextPanel1); var uiTextPanel2 = new UITextPanel <LocalizedText>(Language.GetText("UI.Back"), 0.7f, true); uiTextPanel2.Width.Set(-10f, 0.5f); uiTextPanel2.Height.Set(50f, 0.0f); uiTextPanel2.VAlign = 1f; uiTextPanel2.Top.Set(-45f, 0.0f); uiTextPanel2.OnMouseOver += new UIElement.MouseEvent(this.FadedMouseOver); uiTextPanel2.OnMouseOut += new UIElement.MouseEvent(this.FadedMouseOut); uiTextPanel2.OnClick += new UIElement.MouseEvent(this.GoBackClick); element.Append((UIElement)uiTextPanel2); this._backPanel = uiTextPanel2; var uiTextPanel3 = new UITextPanel <LocalizedText>(Language.GetText("UI.New"), 0.7f, true); uiTextPanel3.CopyStyle((UIElement)uiTextPanel2); uiTextPanel3.HAlign = 1f; uiTextPanel3.OnMouseOver += new UIElement.MouseEvent(this.FadedMouseOver); uiTextPanel3.OnMouseOut += new UIElement.MouseEvent(this.FadedMouseOut); uiTextPanel3.OnClick += new UIElement.MouseEvent(this.NewWorldClick); element.Append((UIElement)uiTextPanel3); this._newPanel = uiTextPanel3; this.Append(element); }
public override void OnInitialize() { UIElement element = new UIElement(); element.Width.Set(0.0f, 0.8f); element.MaxWidth.Set(650f, 0.0f); element.Top.Set(220f, 0.0f); element.Height.Set(-220f, 1f); element.HAlign = 0.5f; UIPanel uiPanel = new UIPanel(); uiPanel.Width.Set(0.0f, 1f); uiPanel.Height.Set(-110f, 1f); uiPanel.BackgroundColor = Color.op_Multiply(new Color(33, 43, 79), 0.8f); this._containerPanel = uiPanel; element.Append((UIElement)uiPanel); this._playerList = new UIList(); this._playerList.Width.Set(-25f, 1f); this._playerList.Height.Set(0.0f, 1f); this._playerList.ListPadding = 5f; uiPanel.Append((UIElement)this._playerList); UIScrollbar scrollbar = new UIScrollbar(); scrollbar.SetView(100f, 1000f); scrollbar.Height.Set(0.0f, 1f); scrollbar.HAlign = 1f; uiPanel.Append((UIElement)scrollbar); this._playerList.SetScrollbar(scrollbar); UITextPanel <LocalizedText> uiTextPanel1 = new UITextPanel <LocalizedText>(Language.GetText("UI.SelectPlayer"), 0.8f, true); uiTextPanel1.HAlign = 0.5f; uiTextPanel1.Top.Set(-35f, 0.0f); uiTextPanel1.SetPadding(15f); uiTextPanel1.BackgroundColor = new Color(73, 94, 171); element.Append((UIElement)uiTextPanel1); UITextPanel <LocalizedText> uiTextPanel2 = new UITextPanel <LocalizedText>(Language.GetText("UI.Back"), 0.7f, true); uiTextPanel2.Width.Set(-10f, 0.5f); uiTextPanel2.Height.Set(50f, 0.0f); uiTextPanel2.VAlign = 1f; uiTextPanel2.Top.Set(-45f, 0.0f); uiTextPanel2.OnMouseOver += new UIElement.MouseEvent(this.FadedMouseOver); uiTextPanel2.OnMouseOut += new UIElement.MouseEvent(this.FadedMouseOut); uiTextPanel2.OnClick += new UIElement.MouseEvent(this.GoBackClick); uiTextPanel2.SetSnapPoint("Back", 0, new Vector2?(), new Vector2?()); element.Append((UIElement)uiTextPanel2); this._backPanel = uiTextPanel2; UITextPanel <LocalizedText> uiTextPanel3 = new UITextPanel <LocalizedText>(Language.GetText("UI.New"), 0.7f, true); uiTextPanel3.CopyStyle((UIElement)uiTextPanel2); uiTextPanel3.HAlign = 1f; uiTextPanel3.OnMouseOver += new UIElement.MouseEvent(this.FadedMouseOver); uiTextPanel3.OnMouseOut += new UIElement.MouseEvent(this.FadedMouseOut); uiTextPanel3.OnClick += new UIElement.MouseEvent(this.NewCharacterClick); element.Append((UIElement)uiTextPanel3); uiTextPanel2.SetSnapPoint("New", 0, new Vector2?(), new Vector2?()); this._newPanel = uiTextPanel3; this.Append(element); }
public override void OnInitialize() { UIElement 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 scrollPanel = new UIPanel(); scrollPanel.Width.Set(0f, 1f); scrollPanel.Height.Set(-65f, 1f); scrollPanel.BackgroundColor = new Color(33, 43, 79) * 0.8f; uIElement.Append(scrollPanel); settingsItemList = new UIList(); settingsItemList.Width.Set(-25f, 1f); settingsItemList.Height.Set(0f, 1f); settingsItemList.ListPadding = 5f; scrollPanel.Append(settingsItemList); UIScrollbar uIScrollbar = new UIScrollbar(); uIScrollbar.SetView(100f, 1000f); uIScrollbar.Height.Set(0f, 1f); uIScrollbar.HAlign = 1f; scrollPanel.Append(uIScrollbar); settingsItemList.SetScrollbar(uIScrollbar); UITextPanel <string> titleTextPanel = new UITextPanel <string>(TerraCustomUtils.TCText("SavedSetings"), 0.8f, true); titleTextPanel.HAlign = 0.5f; titleTextPanel.Top.Set(-35f, 0f); titleTextPanel.SetPadding(15f); titleTextPanel.BackgroundColor = new Color(73, 94, 171); uIElement.Append(titleTextPanel); UITextPanel <string> backButton = new UITextPanel <string>(Localization.Language.GetTextValue("UI.Back"), 1f, false).WithFadedMouseOver(); backButton.Width.Set(-10f, 1f / 2f); backButton.Height.Set(25f, 0f); backButton.VAlign = 1f; backButton.Top.Set(-20f, 0f); backButton.OnClick += new UIElement.MouseEvent(BackClick); uIElement.Append(backButton); UITextPanel <string> saveNewButton = new UITextPanel <string>(TerraCustomUtils.TCText("SaveCurrentSettingsAsNew"), 1f, false).WithFadedMouseOver(Color.Green, Color.Green * 0.7f);; saveNewButton.CopyStyle(backButton); saveNewButton.BackgroundColor = Color.Green * 0.7f; saveNewButton.HAlign = 1f; saveNewButton.OnClick += new UIElement.MouseEvent(SaveNewSettings); uIElement.Append(saveNewButton); base.Append(uIElement); }
public override void OnInitialize() { area = new UIElement { Width = { Percent = 0.8f }, Top = { Pixels = 200 }, Height = { Pixels = -210, Percent = 1f }, HAlign = 0.5f }; messageBox = new UIMessageBox("") { Width = { Percent = 1f }, Height = { Pixels = -110, Percent = 1f }, HAlign = 0.5f }; area.Append(messageBox); continueButton = new UITextPanel <string>("", 0.7f, true) { Width = { Pixels = -10, Percent = 0.5f }, Height = { Pixels = 50 }, Top = { Pixels = -108, Percent = 1f } }; continueButton.WithFadedMouseOver(); continueButton.OnClick += ContinueClick; area.Append(continueButton); var openLogsButton = new UITextPanel <string>(Language.GetTextValue("tModLoader.OpenLogs"), 0.7f, true); openLogsButton.CopyStyle(continueButton); openLogsButton.HAlign = 1f; openLogsButton.WithFadedMouseOver(); openLogsButton.OnClick += OpenFile; area.Append(openLogsButton); webHelpButton = new UITextPanel <string>(Language.GetTextValue("tModLoader.OpenWebHelp"), 0.7f, true); webHelpButton.CopyStyle(openLogsButton); webHelpButton.Top.Set(-55f, 1f); webHelpButton.WithFadedMouseOver(); webHelpButton.OnClick += VisitRegisterWebpage; area.Append(webHelpButton); skipLoadButton = new UITextPanel <string>(Language.GetTextValue("tModLoader.SkipToMainMenu"), 0.7f, true); skipLoadButton.CopyStyle(continueButton); skipLoadButton.Top.Set(-55f, 1f); skipLoadButton.WithFadedMouseOver(); skipLoadButton.OnClick += SkipLoad; area.Append(skipLoadButton); exitAndDisableAllButton = new UITextPanel <string>(Language.GetTextValue("tModLoader.ExitAndDisableAll"), 0.7f, true); exitAndDisableAllButton.CopyStyle(skipLoadButton); exitAndDisableAllButton.TextColor = Color.Red; exitAndDisableAllButton.WithFadedMouseOver(); exitAndDisableAllButton.OnClick += ExitAndDisableAll; Append(area); }
public override void OnInitialize() { UIElement uIElement = new UIElement(); uIElement.Width.Set(0f, 0.8f); uIElement.MaxWidth.Set(650f, 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; _containerPanel = uIPanel; uIElement.Append(uIPanel); _playerList = new UIList(); _playerList.Width.Set(0f, 1f); _playerList.Height.Set(0f, 1f); _playerList.ListPadding = 5f; uIPanel.Append(_playerList); _scrollbar = new UIScrollbar(); _scrollbar.SetView(100f, 1000f); _scrollbar.Height.Set(0f, 1f); _scrollbar.HAlign = 1f; _playerList.SetScrollbar(_scrollbar); UITextPanel <LocalizedText> uITextPanel = new UITextPanel <LocalizedText>(Language.GetText("UI.SelectPlayer"), 0.8f, large: true); uITextPanel.HAlign = 0.5f; uITextPanel.Top.Set(-40f, 0f); uITextPanel.SetPadding(15f); uITextPanel.BackgroundColor = new Color(73, 94, 171); uIElement.Append(uITextPanel); UITextPanel <LocalizedText> uITextPanel2 = new UITextPanel <LocalizedText>(Language.GetText("UI.Back"), 0.7f, large: true); uITextPanel2.Width.Set(-10f, 0.5f); uITextPanel2.Height.Set(50f, 0f); uITextPanel2.VAlign = 1f; uITextPanel2.Top.Set(-45f, 0f); uITextPanel2.OnMouseOver += FadedMouseOver; uITextPanel2.OnMouseOut += FadedMouseOut; uITextPanel2.OnClick += GoBackClick; uITextPanel2.SetSnapPoint("Back", 0); uIElement.Append(uITextPanel2); _backPanel = uITextPanel2; UITextPanel <LocalizedText> uITextPanel3 = new UITextPanel <LocalizedText>(Language.GetText("UI.New"), 0.7f, large: true); uITextPanel3.CopyStyle(uITextPanel2); uITextPanel3.HAlign = 1f; uITextPanel3.OnMouseOver += FadedMouseOver; uITextPanel3.OnMouseOut += FadedMouseOut; uITextPanel3.OnClick += NewCharacterClick; uIElement.Append(uITextPanel3); uITextPanel2.SetSnapPoint("New", 0); _newPanel = uITextPanel3; Append(uIElement); }
public override void OnInitialize() { UIElement element = new UIElement(); element.Width.Set(0.0f, 0.8f); element.MaxWidth.Set(600f, 0.0f); element.Top.Set(220f, 0.0f); element.Height.Set(-220f, 1f); element.HAlign = 0.5f; UIPanel uiPanel = new UIPanel(); uiPanel.Width.Set(0.0f, 1f); uiPanel.Height.Set(-110f, 1f); uiPanel.BackgroundColor = new Color(33, 43, 79) * 0.8f; element.Append(uiPanel); _worldList = new UIList(); _worldList.Width.Set(-25f, 1f); _worldList.Height.Set(0.0f, 1f); _worldList.ListPadding = 5f; uiPanel.Append(_worldList); UIScrollbar scrollbar = new UIScrollbar(); scrollbar.SetView(100f, 1000f); scrollbar.Height.Set(0.0f, 1f); scrollbar.HAlign = 1f; uiPanel.Append(scrollbar); _worldList.SetScrollbar(scrollbar); UITextPanel uiTextPanel1 = new UITextPanel("Select World", 0.8f, true); uiTextPanel1.HAlign = 0.5f; uiTextPanel1.Top.Set(-35f, 0.0f); uiTextPanel1.SetPadding(15f); uiTextPanel1.BackgroundColor = new Color(73, 94, 171); element.Append(uiTextPanel1); UITextPanel uiTextPanel2 = new UITextPanel("Back", 0.7f, true); uiTextPanel2.Width.Set(-10f, 0.5f); uiTextPanel2.Height.Set(50f, 0.0f); uiTextPanel2.VAlign = 1f; uiTextPanel2.Top.Set(-45f, 0.0f); uiTextPanel2.OnMouseOver += new UIElement.MouseEvent(FadedMouseOver); uiTextPanel2.OnMouseOut += new UIElement.MouseEvent(FadedMouseOut); uiTextPanel2.OnClick += new UIElement.MouseEvent(GoBackClick); element.Append(uiTextPanel2); UITextPanel uiTextPanel3 = new UITextPanel("New", 0.7f, true); uiTextPanel3.CopyStyle(uiTextPanel2); uiTextPanel3.HAlign = 1f; uiTextPanel3.OnMouseOver += new UIElement.MouseEvent(FadedMouseOver); uiTextPanel3.OnMouseOut += new UIElement.MouseEvent(FadedMouseOut); uiTextPanel3.OnClick += new UIElement.MouseEvent(NewWorldClick); element.Append(uiTextPanel3); Append(element); }
public override void OnInitialize() { area = new UIElement(); area.Width.Set(0f, 0.8f); area.Top.Set(200f, 0f); area.Height.Set(-210f, 1f); area.HAlign = 0.5f; message.Width.Set(0f, 1f); message.Height.Set(-110f, 1f); message.HAlign = 0.5f; area.Append(message); continueButton.Width.Set(-10f, 0.5f); continueButton.Height.Set(50f, 0f); continueButton.Top.Set(-108f, 1f); continueButton.OnMouseOver += UICommon.FadedMouseOver; continueButton.OnMouseOut += UICommon.FadedMouseOut; continueButton.OnClick += ContinueClick; area.Append(continueButton); UITextPanel <string> openLogsButton = new UITextPanel <string>(Language.GetTextValue("tModLoader.OpenLogs"), 0.7f, true); openLogsButton.CopyStyle(continueButton); openLogsButton.HAlign = 1f; openLogsButton.OnMouseOver += UICommon.FadedMouseOver; openLogsButton.OnMouseOut += UICommon.FadedMouseOut; openLogsButton.OnClick += OpenFile; area.Append(openLogsButton); webHelpButton = new UITextPanel <string>(Language.GetTextValue("tModLoader.OpenWebHelp"), 0.7f, true); webHelpButton.CopyStyle(openLogsButton); webHelpButton.Top.Set(-55f, 1f); webHelpButton.OnMouseOver += UICommon.FadedMouseOver; webHelpButton.OnMouseOut += UICommon.FadedMouseOut; webHelpButton.OnClick += VisitRegisterWebpage; area.Append(webHelpButton); skipLoadButton = new UITextPanel <string>(Language.GetTextValue("tModLoader.SkipToMainMenu"), 0.7f, true); skipLoadButton.CopyStyle(continueButton); skipLoadButton.Top.Set(-55f, 1f); skipLoadButton.OnMouseOver += UICommon.FadedMouseOver; skipLoadButton.OnMouseOut += UICommon.FadedMouseOut; skipLoadButton.OnClick += SkipLoad; area.Append(skipLoadButton); exitAndDisableAllButton = new UITextPanel <string>(Language.GetTextValue("tModLoader.ExitAndDisableAll"), 0.7f, true); exitAndDisableAllButton.CopyStyle(skipLoadButton); exitAndDisableAllButton.TextColor = Color.Red; exitAndDisableAllButton.OnMouseOver += UICommon.FadedMouseOver; exitAndDisableAllButton.OnMouseOut += UICommon.FadedMouseOut; exitAndDisableAllButton.OnClick += ExitAndDisableAll; Append(area); }
public override void OnInitialize() { UIElement 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); _playerList = new UIList(); _playerList.Width.Set(-25f, 1f); _playerList.Height.Set(0f, 1f); _playerList.ListPadding = 5f; uIPanel.Append(_playerList); UIScrollbar uIScrollbar = new UIScrollbar(); uIScrollbar.SetView(100f, 1000f); uIScrollbar.Height.Set(0f, 1f); uIScrollbar.HAlign = 1f; uIPanel.Append(uIScrollbar); _playerList.SetScrollbar(uIScrollbar); UITextPanel uITextPanel = new UITextPanel("Select Player", 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); UITextPanel uITextPanel2 = new UITextPanel("Back", 0.7f, true); uITextPanel2.Width.Set(-10f, 0.5f); uITextPanel2.Height.Set(50f, 0f); uITextPanel2.VAlign = 1f; uITextPanel2.Top.Set(-45f, 0f); uITextPanel2.OnMouseOver += FadedMouseOver; uITextPanel2.OnMouseOut += FadedMouseOut; uITextPanel2.OnClick += GoBackClick; uIElement.Append(uITextPanel2); UITextPanel uITextPanel3 = new UITextPanel("New", 0.7f, true); uITextPanel3.CopyStyle(uITextPanel2); uITextPanel3.HAlign = 1f; uITextPanel3.OnMouseOver += FadedMouseOver; uITextPanel3.OnMouseOut += FadedMouseOut; uITextPanel3.OnClick += NewCharacterClick; uIElement.Append(uITextPanel3); Append(uIElement); }
public UIModSourceItem(string mod) { this.mod = mod; this.BorderColor = new Color(89, 116, 213) * 0.7f; this.dividerTexture = TextureManager.Load("Images/UI/Divider"); this.Height.Set(90f, 0f); this.Width.Set(0f, 1f); base.SetPadding(6f); this.modName = new UIText(Path.GetFileName(mod), 1f, false); this.modName.Left.Set(10f, 0f); this.modName.Top.Set(5f, 0f); base.Append(this.modName); UITextPanel button = new UITextPanel("Build", 1f, false); button.Width.Set(100f, 0f); button.Height.Set(30f, 0f); button.Left.Set(10f, 0f); button.Top.Set(40f, 0f); button.PaddingTop -= 2f; button.PaddingBottom -= 2f; button.OnMouseOver += new UIElement.MouseEvent(FadedMouseOver); button.OnMouseOut += new UIElement.MouseEvent(FadedMouseOut); button.OnClick += new UIElement.MouseEvent(this.BuildMod); base.Append(button); UITextPanel button2 = new UITextPanel("Build + Reload", 1f, false); button2.CopyStyle(button); button2.Width.Set(200f, 0f); button2.Left.Set(150f, 0f); button2.OnMouseOver += new UIElement.MouseEvent(FadedMouseOver); button2.OnMouseOut += new UIElement.MouseEvent(FadedMouseOut); button2.OnClick += new UIElement.MouseEvent(this.BuildAndReload); base.Append(button2); TmodFile[] modFiles = ModLoader.FindMods(); foreach (TmodFile file in modFiles) { if (Path.GetFileNameWithoutExtension(file.Name).Equals(Path.GetFileName(mod))) { UITextPanel button3 = new UITextPanel("Publish", 1f, false); button3.CopyStyle(button2); button3.Width.Set(100f, 0f); button3.Left.Set(390f, 0f); button3.OnMouseOver += new UIElement.MouseEvent(FadedMouseOver); button3.OnMouseOut += new UIElement.MouseEvent(FadedMouseOut); button3.OnClick += new UIElement.MouseEvent(this.Publish); base.Append(button3); } } base.OnDoubleClick += new UIElement.MouseEvent(this.BuildAndReload); }
public UIModDownloadItem(string displayname, string name, string version, string author, string description, string homepage, string download, int downloads, string timeStamp, bool update, bool exists) { this.displayname = displayname; this.mod = name; this.version = version; this.author = author; this.description = description; this.homepage = homepage; this.download = download; this.downloads = downloads; this.timeStamp = timeStamp; this.update = update; this.exists = exists; this.BorderColor = new Color(89, 116, 213) * 0.7f; this.dividerTexture = TextureManager.Load("Images/UI/Divider"); this.Height.Set(90f, 0f); this.Width.Set(0f, 1f); base.SetPadding(6f); string text = displayname + " " + version + " - by " + author; this.modName = new UIText(text, 1f, false); this.modName.Left.Set(10f, 0f); this.modName.Top.Set(5f, 0f); base.Append(this.modName); UITextPanel button = new UITextPanel("More info", 1f, false); button.Width.Set(100f, 0f); button.Height.Set(30f, 0f); button.Left.Set(10f, 0f); button.Top.Set(40f, 0f); button.PaddingTop -= 2f; button.PaddingBottom -= 2f; button.OnMouseOver += new UIElement.MouseEvent(FadedMouseOver); button.OnMouseOut += new UIElement.MouseEvent(FadedMouseOut); button.OnClick += new UIElement.MouseEvent(this.Moreinfo); base.Append(button); if (update || !exists) { button2 = new UITextPanel(this.update ? "Update" : "Download", 1f, false); button2.CopyStyle(button); button2.Width.Set(200f, 0f); button2.Left.Set(150f, 0f); button2.OnMouseOver += new UIElement.MouseEvent(FadedMouseOver); button2.OnMouseOut += new UIElement.MouseEvent(FadedMouseOut); button2.OnClick += new UIElement.MouseEvent(this.DownloadMod); base.Append(button2); } base.OnDoubleClick += new UIElement.MouseEvent(this.Moreinfo); }
public UIModSourceItem(string mod, LocalMod builtMod) { this.mod = mod; this.BorderColor = new Color(89, 116, 213) * 0.7f; this.dividerTexture = TextureManager.Load("Images/UI/Divider"); this.Height.Set(90f, 0f); this.Width.Set(0f, 1f); base.SetPadding(6f); string addendum = Path.GetFileName(mod).Contains(" ") ? " [c/FF0000:(Mod Sources folders can't have spaces)]" : ""; this.modName = new UIText(Path.GetFileName(mod) + addendum, 1f, false); this.modName.Left.Set(10f, 0f); this.modName.Top.Set(5f, 0f); base.Append(this.modName); UITextPanel <string> button = new UITextPanel <string>(Language.GetTextValue("tModLoader.MSBuild"), 1f, false); button.Width.Set(100f, 0f); button.Height.Set(30f, 0f); button.Left.Set(10f, 0f); button.Top.Set(40f, 0f); button.PaddingTop -= 2f; button.PaddingBottom -= 2f; button.OnMouseOver += UICommon.FadedMouseOver; button.OnMouseOut += UICommon.FadedMouseOut; button.OnClick += this.BuildMod; base.Append(button); UITextPanel <string> button2 = new UITextPanel <string>(Language.GetTextValue("tModLoader.MSBuildReload"), 1f, false); button2.CopyStyle(button); button2.Width.Set(200f, 0f); button2.Left.Set(150f, 0f); button2.OnMouseOver += UICommon.FadedMouseOver; button2.OnMouseOut += UICommon.FadedMouseOut; button2.OnClick += this.BuildAndReload; base.Append(button2); this.builtMod = builtMod; if (builtMod != null) { UITextPanel <string> button3 = new UITextPanel <string>(Language.GetTextValue("tModLoader.MSPublish"), 1f, false); button3.CopyStyle(button2); button3.Width.Set(100f, 0f); button3.Left.Set(390f, 0f); button3.OnMouseOver += UICommon.FadedMouseOver; button3.OnMouseOut += UICommon.FadedMouseOut; button3.OnClick += this.Publish; base.Append(button3); } base.OnDoubleClick += this.BuildAndReload; }
public UIModSourceItem(string mod, bool publishable, DateTime lastBuildTime) { this.mod = mod; this.lastBuildTime = lastBuildTime; this.BorderColor = new Color(89, 116, 213) * 0.7f; this.dividerTexture = TextureManager.Load("Images/UI/Divider"); this.Height.Set(90f, 0f); this.Width.Set(0f, 1f); base.SetPadding(6f); this.modName = new UIText(Path.GetFileName(mod), 1f, false); this.modName.Left.Set(10f, 0f); this.modName.Top.Set(5f, 0f); base.Append(this.modName); UITextPanel <string> button = new UITextPanel <string>("Build", 1f, false); button.Width.Set(100f, 0f); button.Height.Set(30f, 0f); button.Left.Set(10f, 0f); button.Top.Set(40f, 0f); button.PaddingTop -= 2f; button.PaddingBottom -= 2f; button.OnMouseOver += UICommon.FadedMouseOver; button.OnMouseOut += UICommon.FadedMouseOut; button.OnClick += this.BuildMod; base.Append(button); UITextPanel <string> button2 = new UITextPanel <string>("Build + Reload", 1f, false); button2.CopyStyle(button); button2.Width.Set(200f, 0f); button2.Left.Set(150f, 0f); button2.OnMouseOver += UICommon.FadedMouseOver; button2.OnMouseOut += UICommon.FadedMouseOut; button2.OnClick += this.BuildAndReload; base.Append(button2); if (publishable) { UITextPanel <string> button3 = new UITextPanel <string>("Publish", 1f, false); button3.CopyStyle(button2); button3.Width.Set(100f, 0f); button3.Left.Set(390f, 0f); button3.OnMouseOver += UICommon.FadedMouseOver; button3.OnMouseOut += UICommon.FadedMouseOut; button3.OnClick += this.Publish; base.Append(button3); } base.OnDoubleClick += this.BuildAndReload; }
public UIModManageItem(string displayname, string name, string version, string author, string downloads, string downloadsversion, string modloaderversion) { this.displayname = displayname; this.version = version; this.author = author; this.name = name; BorderColor = new Color(89, 116, 213) * 0.7f; dividerTexture = TextureManager.Load("Images/UI/Divider"); Height.Pixels = 90; Width.Percent = 1f; SetPadding(6f); string text = displayname + " " + version + " - by " + author + " - " + modloaderversion; modName = new UIText(text) { Left = { Pixels = 10 }, Top = { Pixels = 5 } }; Append(modName); var button = new UITextPanel <string>(Language.GetTextValue("tModLoader.MBMyPublishedModsStats", downloads, downloadsversion)) { Width = { Pixels = 260 }, Height = { Pixels = 30 }, Left = { Pixels = 10 }, Top = { Pixels = 40 } }; button.PaddingTop -= 2f; button.PaddingBottom -= 2f; // button.OnMouseOver += UICommon.FadedMouseOver; // button.OnMouseOut += UICommon.FadedMouseOut; Append(button); button2 = new UITextPanel <string>(Language.GetTextValue("tModLoader.MBUnpublish")); button2.CopyStyle(button); button2.Width.Pixels = 150; button2.Left.Pixels = 360; button2.WithFadedMouseOver(); button2.OnClick += Unpublish; Append(button2); }
public override void OnInitialize() { area = new UIElement(); area.Width.Set(0f, 0.8f); area.Top.Set(200f, 0f); area.Height.Set(-210f, 1f); area.HAlign = 0.5f; message.Width.Set(0f, 1f); message.Height.Set(-110f, 1f); message.HAlign = 0.5f; area.Append(message); UITextPanel <string> button = new UITextPanel <string>("Continue", 0.7f, true); button.Width.Set(-10f, 0.5f); button.Height.Set(50f, 0f); button.Top.Set(-108f, 1f); button.OnMouseOver += UICommon.FadedMouseOver; button.OnMouseOut += UICommon.FadedMouseOut; button.OnClick += ContinueClick; area.Append(button); UITextPanel <string> button2 = new UITextPanel <string>("Open Logs", 0.7f, true); button2.CopyStyle(button); button2.HAlign = 1f; button2.OnMouseOver += UICommon.FadedMouseOver; button2.OnMouseOut += UICommon.FadedMouseOut; button2.OnClick += OpenFile; area.Append(button2); webHelpButton = new UITextPanel <string>("Open Web Help", 0.7f, true); webHelpButton.CopyStyle(button2); webHelpButton.Top.Set(-55f, 1f); webHelpButton.OnMouseOver += UICommon.FadedMouseOver; webHelpButton.OnMouseOut += UICommon.FadedMouseOut; webHelpButton.OnClick += VisitRegisterWebpage; area.Append(webHelpButton); Append(area); }
public UIModManageItem(string displayname, string name, string version, string author, int downloads, int downloadsversion, string modloaderversion) { Displayname = displayname; Version = version; Author = author; Name = name; BorderColor = new Color(89, 116, 213) * 0.7f; _dividerTexture = UICommon.DividerTexture; Height.Pixels = 128; Width.Percent = 1f; SetPadding(6f); string text = displayname + " " + version + " - by " + author + " - " + modloaderversion; _modName = new UIText(text) { Left = { Pixels = 10 }, Top = { Pixels = 5 } }; Append(_modName); var button = new UITextPanel <string>(Language.GetTextValue("tModLoader.MBMyPublishedModsStats", downloads, downloadsversion)) { Width = { Percent = 1f }, Height = { Pixels = 30 }, Top = { Pixels = 40 } }.WithFadedMouseOver(); button.PaddingTop -= 2f; button.PaddingBottom -= 2f; Append(button); _unpublishButton = new UITextPanel <string>(Language.GetTextValue("tModLoader.MBUnpublish")); _unpublishButton.CopyStyle(button); _unpublishButton.Width.Set(150, 0f); _unpublishButton.Top.Pixels = 80; _unpublishButton.HAlign = 1f; _unpublishButton.WithFadedMouseOver(); _unpublishButton.OnClick += UnpublishMod; Append(_unpublishButton); }
public UIModSourceItem(string mod) { this.mod = mod; BorderColor = new Color(89, 116, 213) * 0.7f; dividerTexture = Main.Assets.Request <Texture2D>("Images/UI/Divider").Value; Height.Set(90f, 0f); Width.Set(0f, 1f); SetPadding(6f); modName = new UIText(Path.GetFileName(mod), 1f, false); modName.Left.Set(10f, 0f); modName.Top.Set(5f, 0f); Append(modName); UITextPanel <string> button = new UITextPanel <string>("Build", 1f, false); button.Width.Set(100f, 0f); button.Height.Set(30f, 0f); button.Left.Set(10f, 0f); button.Top.Set(40f, 0f); button.PaddingTop -= 2f; button.PaddingBottom -= 2f; button.OnMouseOver += new MouseEvent(FadedMouseOver); button.OnMouseOut += new MouseEvent(FadedMouseOut); button.OnClick += new MouseEvent(BuildMod); Append(button); UITextPanel <string> button2 = new UITextPanel <string>("Build + Reload", 1f, false); button2.CopyStyle(button); button2.Width.Set(200f, 0f); button2.Left.Set(150f, 0f); button2.OnMouseOver += new MouseEvent(FadedMouseOver); button2.OnMouseOut += new MouseEvent(FadedMouseOut); button2.OnClick += new MouseEvent(BuildAndReload); Append(button2); OnDoubleClick += new MouseEvent(BuildAndReload); }
public UIModManageItem(string displayname, string name, string version, string author, string downloads, string downloadsversion, string modloaderversion) { this.displayname = displayname; this.version = version; this.author = author; this.name = name; this.BorderColor = new Color(89, 116, 213) * 0.7f; this.dividerTexture = TextureManager.Load("Images/UI/Divider"); this.Height.Set(90f, 0f); this.Width.Set(0f, 1f); base.SetPadding(6f); string text = displayname + " " + version + " - by " + author + " - " + modloaderversion; this.modName = new UIText(text, 1f, false); this.modName.Left.Set(10f, 0f); this.modName.Top.Set(5f, 0f); base.Append(this.modName); UITextPanel <string> button = new UITextPanel <string>(Language.GetTextValue("tModLoader.MBMyPublishedModsStats", downloads, downloadsversion), 1f, false); button.Width.Set(260f, 0f); button.Height.Set(30f, 0f); button.Left.Set(10f, 0f); button.Top.Set(40f, 0f); button.PaddingTop -= 2f; button.PaddingBottom -= 2f; // button.OnMouseOver += UICommon.FadedMouseOver; // button.OnMouseOut += UICommon.FadedMouseOut; base.Append(button); button2 = new UITextPanel <string>(Language.GetTextValue("tModLoader.MBUnpublish"), 1f, false); button2.CopyStyle(button); button2.Width.Set(150f, 0f); button2.Left.Set(360f, 0f); button2.OnMouseOver += UICommon.FadedMouseOver; button2.OnMouseOut += UICommon.FadedMouseOut; button2.OnClick += this.Unpublish; base.Append(button2); }
public UIModManageItem(string displayname, string name, string version, string author, string downloads, string downloadsversion, string modloaderversion) { this.displayname = displayname; this.version = version; this.author = author; this.name = name; this.BorderColor = new Color(89, 116, 213) * 0.7f; this.dividerTexture = TextureManager.Load("Images/UI/Divider"); this.Height.Set(90f, 0f); this.Width.Set(0f, 1f); base.SetPadding(6f); string text = displayname + " " + version + " - by " + author + " - " + modloaderversion; this.modName = new UIText(text, 1f, false); this.modName.Left.Set(10f, 0f); this.modName.Top.Set(5f, 0f); base.Append(this.modName); UITextPanel button = new UITextPanel(downloads + " downloads (" + downloadsversion + " latest version)", 1f, false); button.Width.Set(260f, 0f); button.Height.Set(30f, 0f); button.Left.Set(10f, 0f); button.Top.Set(40f, 0f); button.PaddingTop -= 2f; button.PaddingBottom -= 2f; // button.OnMouseOver += new UIElement.MouseEvent(FadedMouseOver); // button.OnMouseOut += new UIElement.MouseEvent(FadedMouseOut); base.Append(button); button2 = new UITextPanel("Unpublish", 1f, false); button2.CopyStyle(button); button2.Width.Set(150f, 0f); button2.Left.Set(360f, 0f); button2.OnMouseOver += new UIElement.MouseEvent(FadedMouseOver); button2.OnMouseOut += new UIElement.MouseEvent(FadedMouseOut); button2.OnClick += new UIElement.MouseEvent(this.Unpublish); base.Append(button2); }
public override void OnInitialize() { uIElement = new UIElement(); uIElement.Width.Set(0f, 0.8f); uIElement.MaxWidth.Set(600f, 0f); uIElement.Top.Set(160f, 0f); uIElement.Height.Set(-180f, 1f); uIElement.HAlign = 0.5f; uIPanel = new UIPanel(); uIPanel.Width.Set(0f, 1f); uIPanel.Height.Set(-140f, 1f); uIPanel.Top.Set(30f, 0f); uIPanel.BackgroundColor = UICommon.MainPanelBackground; uIElement.Append(uIPanel); UIPanel textBoxBackground = new UIPanel(); textBoxBackground.SetPadding(0); filterTextField = new UIFocusInputTextField("Filter Options"); textBoxBackground.Top.Set(2f, 0f); textBoxBackground.Left.Set(-190, 1f); textBoxBackground.Width.Set(180, 0f); textBoxBackground.Height.Set(30, 0f); uIElement.Append(textBoxBackground); filterTextField.SetText(""); filterTextField.Top.Set(5, 0f); filterTextField.Left.Set(10, 0f); filterTextField.Width.Set(-20, 1f); filterTextField.Height.Set(20, 0); filterTextField.OnTextChange += (a, b) => { updateNeeded = true; }; filterTextField.OnRightClick += (a, b) => { filterTextField.SetText(""); }; textBoxBackground.Append(filterTextField); // TODO: ModConfig Localization support message = new UITextPanel <string>("Notification: "); message.Width.Set(-80f, 1f); message.Height.Set(20f, 0f); message.HAlign = 0.5f; message.VAlign = 1f; message.Top.Set(-65f, 0f); uIElement.Append(message); mainConfigList = new UIList(); mainConfigList.Width.Set(-25f, 1f); mainConfigList.Height.Set(0f, 1f); //mainConfigList.Top.Set(40f, 0f); mainConfigList.ListPadding = 5f; uIPanel.Append(mainConfigList); configPanelStack.Push(uIPanel); //currentConfigList = mainConfigList; uIScrollbar = new UIScrollbar(); uIScrollbar.SetView(100f, 1000f); uIScrollbar.Height.Set(0f, 1f); uIScrollbar.HAlign = 1f; uIPanel.Append(uIScrollbar); mainConfigList.SetScrollbar(uIScrollbar); headerTextPanel = new UITextPanel <string>("Mod Config", 0.8f, true); headerTextPanel.HAlign = 0.5f; headerTextPanel.Top.Set(-50f, 0f); headerTextPanel.SetPadding(15f); headerTextPanel.BackgroundColor = UICommon.DefaultUIBlue; uIElement.Append(headerTextPanel); previousConfigButton = new UITextPanel <string>("<", 1f, false); previousConfigButton.Width.Set(25f, 0); previousConfigButton.Height.Set(25f, 0f); previousConfigButton.VAlign = 1f; previousConfigButton.Top.Set(-65f, 0f); previousConfigButton.HAlign = 0f; previousConfigButton.WithFadedMouseOver(); previousConfigButton.OnClick += PreviousConfig; //uIElement.Append(previousConfigButton); nextConfigButton = new UITextPanel <string>(">", 1f, false); nextConfigButton.CopyStyle(previousConfigButton); nextConfigButton.WithFadedMouseOver(); nextConfigButton.HAlign = 1f; nextConfigButton.OnClick += NextConfig; //uIElement.Append(nextConfigButton); saveConfigButton = new UITextPanel <string>("Save Config", 1f, false); saveConfigButton.Width.Set(-10f, 1f / 4f); saveConfigButton.Height.Set(25f, 0f); saveConfigButton.Top.Set(-20f, 0f); saveConfigButton.WithFadedMouseOver(); saveConfigButton.HAlign = 0.33f; saveConfigButton.VAlign = 1f; saveConfigButton.OnClick += SaveConfig; //uIElement.Append(saveConfigButton); backButton = new UITextPanel <string>("Back", 1f, false); backButton.CopyStyle(saveConfigButton); backButton.HAlign = 0; backButton.WithFadedMouseOver(); backButton.OnMouseOver += (a, b) => { if (pendingChanges) { backButton.BackgroundColor = Color.Red; } }; backButton.OnMouseOut += (a, b) => { if (pendingChanges) { backButton.BackgroundColor = Color.Red * 0.7f; } }; backButton.OnClick += BackClick; uIElement.Append(backButton); revertConfigButton = new UITextPanel <string>("Revert Changes", 1f, false); revertConfigButton.CopyStyle(saveConfigButton); revertConfigButton.WithFadedMouseOver(); revertConfigButton.HAlign = 0.66f; revertConfigButton.OnClick += RevertConfig; //uIElement.Append(revertConfigButton); //float scale = Math.Min(1f, 130f/Main.fontMouseText.MeasureString("Restore Defaults").X); restoreDefaultsConfigButton = new UITextPanel <string>("Restore Defaults", 1f, false); restoreDefaultsConfigButton.CopyStyle(saveConfigButton); restoreDefaultsConfigButton.WithFadedMouseOver(); restoreDefaultsConfigButton.HAlign = 1f; restoreDefaultsConfigButton.OnClick += RestoreDefaults; uIElement.Append(restoreDefaultsConfigButton); uIPanel.BackgroundColor = UICommon.MainPanelBackground; Append(uIElement); }
public override void OnInitialize() { UIElement 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); modList = new UIList(); modList.Width.Set(-25f, 1f); modList.Height.Set(0f, 1f); modList.ListPadding = 5f; uIPanel.Append(modList); UIScrollbar uIScrollbar = new UIScrollbar(); uIScrollbar.SetView(100f, 1000f); uIScrollbar.Height.Set(0f, 1f); uIScrollbar.HAlign = 1f; uIPanel.Append(uIScrollbar); modList.SetScrollbar(uIScrollbar); UITextPanel uITextPanel = new UITextPanel("Mod Sources", 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); UITextPanel button = new UITextPanel("Build All", 1f, false); button.Width.Set(-10f, 0.5f); button.Height.Set(25f, 0f); button.VAlign = 1f; button.Top.Set(-65f, 0f); button.OnMouseOver += new UIElement.MouseEvent(FadedMouseOver); button.OnMouseOut += new UIElement.MouseEvent(FadedMouseOut); button.OnClick += new UIElement.MouseEvent(BuildMods); uIElement.Append(button); UITextPanel button2 = new UITextPanel("Build + Reload All", 1f, false); button2.CopyStyle(button); button2.HAlign = 1f; button2.OnMouseOver += new UIElement.MouseEvent(FadedMouseOver); button2.OnMouseOut += new UIElement.MouseEvent(FadedMouseOut); button2.OnClick += new UIElement.MouseEvent(BuildAndReload); uIElement.Append(button2); UITextPanel button3 = new UITextPanel("Back", 1f, false); button3.CopyStyle(button); button3.Width.Set(-10f, 1f / 3f); button3.Top.Set(-20f, 0f); button3.OnMouseOver += new UIElement.MouseEvent(FadedMouseOver); button3.OnMouseOut += new UIElement.MouseEvent(FadedMouseOut); button3.OnClick += new UIElement.MouseEvent(BackClick); uIElement.Append(button3); UITextPanel button4 = new UITextPanel("Open Sources", 1f, false); button4.CopyStyle(button3); button4.HAlign = .5f; button4.OnMouseOver += new UIElement.MouseEvent(FadedMouseOver); button4.OnMouseOut += new UIElement.MouseEvent(FadedMouseOut); button4.OnClick += new UIElement.MouseEvent(OpenSources); uIElement.Append(button4); UITextPanel button5 = new UITextPanel("Manage Published", 1f, false); button5.CopyStyle(button3); button5.HAlign = 1f; button5.OnMouseOver += new UIElement.MouseEvent(FadedMouseOver); button5.OnMouseOut += new UIElement.MouseEvent(FadedMouseOut); button5.OnClick += new UIElement.MouseEvent(ManagePublished); uIElement.Append(button5); base.Append(uIElement); }
public override void OnInitialize() { UIElement 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; uIPanel.PaddingTop = 0f; uIElement.Append(uIPanel); uITextPanel = new UITextPanel <string>(Language.GetTextValue("tModLoader.EnterSteamID"), 0.8f, true) { HAlign = 0.5f }; uITextPanel.Top.Set(-35f, 0f); uITextPanel.SetPadding(15f); uITextPanel.BackgroundColor = new Color(73, 94, 171); uIElement.Append(uITextPanel); UITextPanel <string> button = new UITextPanel <string>(Language.GetTextValue("UI.Back"), 1f, false); button.Width.Set(-10f, 0.5f); button.Height.Set(25f, 0f); button.VAlign = 1f; button.Top.Set(-65f, 0f); button.OnMouseOver += UICommon.FadedMouseOver; button.OnMouseOut += UICommon.FadedMouseOut; button.OnClick += BackClick; uIElement.Append(button); UITextPanel <string> button2 = new UITextPanel <string>(Language.GetTextValue("UI.Submit"), 1f, false); button2.CopyStyle(button); button2.HAlign = 1f; button2.OnMouseOver += UICommon.FadedMouseOver; button2.OnMouseOut += UICommon.FadedMouseOut; button2.OnClick += OKClick; uIElement.Append(button2); //UITextPanel<string> button3 = new UITextPanel<string>("Visit Website to Generate Passphrase", 1f, false); //button3.CopyStyle(button); //button3.Width.Set(0f, 1f); //button3.Top.Set(-20f, 0f); //button3.OnMouseOver += UICommon.FadedMouseOver; //button3.OnMouseOut += UICommon.FadedMouseOut; //button3.OnClick += VisitRegisterWebpage; //uIElement.Append(button3); steamIDTextField = new UIInputTextField(Language.GetTextValue("tModLoader.PasteSteamID")) { HAlign = 0.5f, VAlign = 0.5f }; steamIDTextField.Left.Set(-100, 0); steamIDTextField.OnTextChange += new UIInputTextField.EventHandler(OnTextChange); uIPanel.Append(steamIDTextField); base.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 = new UIPanel(); uIPanel.Width.Set(0f, 1f); uIPanel.Height.Set(-110f, 1f); uIPanel.BackgroundColor = new Color(33, 43, 79) * 0.8f; uIPanel.PaddingTop = 0f; uIElement.Append(uIPanel); uiLoader = new UILoaderAnimatedImage(0.5f, 0.5f, 1f); modListAll = new List <UIModItem>(); modList = new UIList(); modList.Width.Set(-25f, 1f); modList.Height.Set(-50f, 1f); modList.Top.Set(50f, 0f); modList.ListPadding = 5f; uIPanel.Append(modList); UIScrollbar uIScrollbar = new UIScrollbar(); uIScrollbar.SetView(100f, 1000f); uIScrollbar.Height.Set(-50f, 1f); uIScrollbar.Top.Set(50f, 0f); uIScrollbar.HAlign = 1f; uIPanel.Append(uIScrollbar); modList.SetScrollbar(uIScrollbar); UITextPanel <string> uIHeaderTexTPanel = new UITextPanel <string>("Mods List", 0.8f, true); uIHeaderTexTPanel.HAlign = 0.5f; uIHeaderTexTPanel.Top.Set(-35f, 0f); uIHeaderTexTPanel.SetPadding(15f); uIHeaderTexTPanel.BackgroundColor = new Color(73, 94, 171); uIElement.Append(uIHeaderTexTPanel); buttonEA = new UIColorTextPanel("Enable All", Color.Green, 1f, false); buttonEA.Width.Set(-10f, 1f / 3f); buttonEA.Height.Set(25f, 0f); buttonEA.VAlign = 1f; buttonEA.Top.Set(-65f, 0f); buttonEA.OnMouseOver += UICommon.FadedMouseOver; buttonEA.OnMouseOut += UICommon.FadedMouseOut; buttonEA.OnClick += this.EnableAll; uIElement.Append(buttonEA); buttonDA = new UIColorTextPanel("Disable All", Color.Red, 1f, false); buttonDA.CopyStyle(buttonEA); buttonDA.HAlign = 0.5f; buttonDA.OnMouseOver += UICommon.FadedMouseOver; buttonDA.OnMouseOut += UICommon.FadedMouseOut; buttonDA.OnClick += this.DisableAll; uIElement.Append(buttonDA); buttonRM = new UITextPanel <string>("Reload Mods", 1f, false); buttonRM.CopyStyle(buttonEA); buttonRM.HAlign = 1f; buttonRM.OnMouseOver += UICommon.FadedMouseOver; buttonRM.OnMouseOut += UICommon.FadedMouseOut; buttonRM.OnClick += ReloadMods; uIElement.Append(buttonRM); buttonB = new UITextPanel <string>("Back", 1f, false); buttonB.CopyStyle(buttonEA); buttonB.Top.Set(-20f, 0f); buttonB.OnMouseOver += UICommon.FadedMouseOver; buttonB.OnMouseOut += UICommon.FadedMouseOut; buttonB.OnClick += BackClick; uIElement.Append(buttonB); buttonOMF = new UITextPanel <string>("Open Mods Folder", 1f, false); buttonOMF.CopyStyle(buttonB); buttonOMF.HAlign = 0.5f; buttonOMF.OnMouseOver += UICommon.FadedMouseOver; buttonOMF.OnMouseOut += UICommon.FadedMouseOut; buttonOMF.OnClick += OpenModsFolder; uIElement.Append(buttonOMF); Texture2D texture = Texture2D.FromStream(Main.instance.GraphicsDevice, Assembly.GetExecutingAssembly().GetManifestResourceStream("Terraria.ModLoader.UI.UIModBrowserIcons.png")); UIElement upperMenuContainer = new UIElement(); upperMenuContainer.Width.Set(0f, 1f); upperMenuContainer.Height.Set(32f, 0f); upperMenuContainer.Top.Set(10f, 0f); UICycleImage toggleImage; for (int j = 0; j < 2; j++) { if (j == 0) { toggleImage = new UICycleImage(texture, 3, 32, 32, 34 * 3, 0); toggleImage.setCurrentState((int)sortMode); toggleImage.OnClick += (a, b) => { sortMode = sortMode.NextEnum(); updateNeeded = true; }; toggleImage.OnRightClick += (a, b) => { sortMode = sortMode.PreviousEnum(); updateNeeded = true; }; } else { toggleImage = new UICycleImage(texture, 3, 32, 32, 34 * 4, 0); toggleImage.setCurrentState((int)enabledFilterMode); toggleImage.OnClick += (a, b) => { enabledFilterMode = enabledFilterMode.NextEnum(); updateNeeded = true; }; toggleImage.OnRightClick += (a, b) => { enabledFilterMode = enabledFilterMode.PreviousEnum(); updateNeeded = true; }; } toggleImage.Left.Set((float)(j * 36 + 8), 0f); _categoryButtons.Add(toggleImage); upperMenuContainer.Append(toggleImage); } UIPanel filterTextBoxBackground = new UIPanel(); filterTextBoxBackground.Top.Set(0f, 0f); filterTextBoxBackground.Left.Set(-170f, 1f); filterTextBoxBackground.Width.Set(135f, 0f); filterTextBoxBackground.Height.Set(40f, 0f); upperMenuContainer.Append(filterTextBoxBackground); filterTextBox = new UIInputTextField("Type to search"); filterTextBox.Top.Set(5f, 0f); filterTextBox.Left.Set(-160f, 1f); filterTextBox.OnTextChange += (a, b) => { updateNeeded = true; }; upperMenuContainer.Append(filterTextBox); SearchFilterToggle = new UICycleImage(texture, 2, 32, 32, 34 * 2, 0); SearchFilterToggle.setCurrentState((int)searchFilterMode); SearchFilterToggle.OnClick += (a, b) => { searchFilterMode = searchFilterMode.NextEnum(); updateNeeded = true; }; SearchFilterToggle.OnRightClick += (a, b) => { searchFilterMode = searchFilterMode.PreviousEnum(); updateNeeded = true; }; SearchFilterToggle.Left.Set(545f, 0f); _categoryButtons.Add(SearchFilterToggle); upperMenuContainer.Append(SearchFilterToggle); buttonMP = new UITextPanel <string>("Mod Packs", 1f, false); buttonMP.CopyStyle(buttonOMF); buttonMP.HAlign = 1f; buttonMP.OnMouseOver += UICommon.FadedMouseOver; buttonMP.OnMouseOut += UICommon.FadedMouseOut; buttonMP.OnClick += GotoModPacksMenu; uIElement.Append(buttonMP); uIPanel.Append(upperMenuContainer); 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 = new UIPanel(); uIPanel.Width.Set(0f, 1f); uIPanel.Height.Set(-110f, 1f); uIPanel.BackgroundColor = new Color(33, 43, 79) * 0.8f; uIElement.Append(uIPanel); uiLoader = new UILoaderAnimatedImage(0.5f, 0.5f, 1f); modList = new UIList(); modList.Width.Set(-25f, 1f); modList.Height.Set(0f, 1f); modList.ListPadding = 5f; uIPanel.Append(modList); UIScrollbar uIScrollbar = new UIScrollbar(); uIScrollbar.SetView(100f, 1000f); uIScrollbar.Height.Set(0f, 1f); uIScrollbar.HAlign = 1f; uIPanel.Append(uIScrollbar); modList.SetScrollbar(uIScrollbar); UITextPanel <string> uIHeaderTextPanel = new UITextPanel <string>(Language.GetTextValue("tModLoader.MenuModSources"), 0.8f, true); uIHeaderTextPanel.HAlign = 0.5f; uIHeaderTextPanel.Top.Set(-35f, 0f); uIHeaderTextPanel.SetPadding(15f); uIHeaderTextPanel.BackgroundColor = new Color(73, 94, 171); uIElement.Append(uIHeaderTextPanel); UITextPanel <string> buttonBA = new UITextPanel <string>(Language.GetTextValue("tModLoader.MSBuildAll"), 1f, false); buttonBA.Width.Set(-10f, 0.5f); buttonBA.Height.Set(25f, 0f); buttonBA.VAlign = 1f; buttonBA.Top.Set(-65f, 0f); buttonBA.OnMouseOver += UICommon.FadedMouseOver; buttonBA.OnMouseOut += UICommon.FadedMouseOut; buttonBA.OnClick += BuildMods; uIElement.Append(buttonBA); UITextPanel <string> buttonBRA = new UITextPanel <string>(Language.GetTextValue("tModLoader.MSBuildReloadAll"), 1f, false); buttonBRA.CopyStyle(buttonBA); buttonBRA.HAlign = 1f; buttonBRA.OnMouseOver += UICommon.FadedMouseOver; buttonBRA.OnMouseOut += UICommon.FadedMouseOut; buttonBRA.OnClick += BuildAndReload; uIElement.Append(buttonBRA); UITextPanel <string> buttonB = new UITextPanel <string>(Language.GetTextValue("UI.Back"), 1f, false); buttonB.CopyStyle(buttonBA); buttonB.Width.Set(-10f, 1f / 3f); buttonB.Top.Set(-20f, 0f); buttonB.OnMouseOver += UICommon.FadedMouseOver; buttonB.OnMouseOut += UICommon.FadedMouseOut; buttonB.OnClick += BackClick; uIElement.Append(buttonB); UITextPanel <string> buttonOS = new UITextPanel <string>(Language.GetTextValue("tModLoader.MSOpenSources"), 1f, false); buttonOS.CopyStyle(buttonB); buttonOS.HAlign = .5f; buttonOS.OnMouseOver += UICommon.FadedMouseOver; buttonOS.OnMouseOut += UICommon.FadedMouseOut; buttonOS.OnClick += OpenSources; uIElement.Append(buttonOS); UITextPanel <string> buttonMP = new UITextPanel <string>(Language.GetTextValue("tModLoader.MSManagePublished"), 1f, false); buttonMP.CopyStyle(buttonB); buttonMP.HAlign = 1f; buttonMP.OnMouseOver += UICommon.FadedMouseOver; buttonMP.OnMouseOut += UICommon.FadedMouseOut; buttonMP.OnClick += ManagePublished; uIElement.Append(buttonMP); base.Append(uIElement); }
public override void OnInitialize() { var 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, PaddingTop = 0f }; uIElement.Append(uIPanel); UITextPanel = new UITextPanel <string>(Language.GetTextValue("tModLoader.MBPublishEnterPassphrase"), 0.8f, true) { HAlign = 0.5f, Top = { Pixels = -35 }, BackgroundColor = UICommon.DefaultUIBlue }.WithPadding(15); uIElement.Append(UITextPanel); var buttonBack = new UITextPanel <string>(Language.GetTextValue("UI.Back")) { Width = { Pixels = -10, Percent = 0.5f }, Height = { Pixels = 25 }, VAlign = 1f, Top = { Pixels = -65 } }.WithFadedMouseOver(); buttonBack.OnClick += BackClick; uIElement.Append(buttonBack); var buttonSubmit = new UITextPanel <string>(Language.GetTextValue("UI.Submit")); buttonSubmit.CopyStyle(buttonBack); buttonSubmit.HAlign = 1f; buttonSubmit.WithFadedMouseOver(); buttonSubmit.OnClick += SubmitPassphrase; uIElement.Append(buttonSubmit); var buttonVisitWebsite = new UITextPanel <string>(Language.GetTextValue("tModLoader.MBPublishVisitWebsiteForPassphrase")); buttonVisitWebsite.CopyStyle(buttonBack); buttonVisitWebsite.Width.Percent = 1f; buttonVisitWebsite.Top.Pixels = -20; buttonVisitWebsite.WithFadedMouseOver(); buttonVisitWebsite.OnClick += VisitRegisterWebpage; uIElement.Append(buttonVisitWebsite); PasscodeTextField = new UIInputTextField(Language.GetTextValue("tModLoader.MBPublishPastePassphrase")) { HAlign = 0.5f, VAlign = 0.5f, Left = { Pixels = -100, Percent = 0 } }; PasscodeTextField.OnTextChange += OnTextChange; uIPanel.Append(PasscodeTextField); Append(uIElement); }
public UIModDownloadItem(string displayname, string name, string version, string author, string modreferences, ModSide modside, string download, int downloads, int hot, string timeStamp, bool update, bool updateIsDowngrade, bool exists) { this.displayname = displayname; this.mod = name; this.version = version; this.author = author; this.modreferences = modreferences; this.modside = modside; this.download = download; this.downloads = downloads; this.hot = hot; this.timeStamp = timeStamp; this.update = update; this.updateIsDowngrade = updateIsDowngrade; this.exists = exists; this.BorderColor = new Color(89, 116, 213) * 0.7f; this.dividerTexture = TextureManager.Load("Images/UI/Divider"); this.innerPanelTexture = TextureManager.Load("Images/UI/InnerPanelBackground"); this.Height.Set(90f, 0f); this.Width.Set(0f, 1f); base.SetPadding(6f); string text = displayname + " " + version; this.modName = new UIText(text, 1f, false); this.modName.Left.Set(10f, 0f); this.modName.Top.Set(5f, 0f); base.Append(this.modName); UITextPanel <string> button = new UITextPanel <string>("More info", 1f, false); button.Width.Set(100f, 0f); button.Height.Set(30f, 0f); button.Left.Set(5f, 0f); button.Top.Set(40f, 0f); button.PaddingTop -= 2f; button.PaddingBottom -= 2f; button.OnMouseOver += UICommon.FadedMouseOver; button.OnMouseOut += UICommon.FadedMouseOut; button.OnClick += RequestMoreinfo; base.Append(button); if (update || !exists) { updateButton = new UITextPanel <string>(this.update ? (updateIsDowngrade ? "Downgrade" : "Update") : "Download", 1f, false); updateButton.CopyStyle(button); updateButton.Width.Set(200f, 0f); updateButton.Left.Set(button.Width.Pixels + button.Left.Pixels * 2f + 5f, 0f); updateButton.OnMouseOver += UICommon.FadedMouseOver; updateButton.OnMouseOut += UICommon.FadedMouseOut; updateButton.OnClick += this.DownloadMod; base.Append(updateButton); } if (modreferences.Length > 0) { UIHoverImage modReferenceIcon = new UIHoverImage(Main.quicksIconTexture, "This mod depends on: " + modreferences); modReferenceIcon.Left.Set(-135f, 1f); modReferenceIcon.Top.Set(50f, 0f); modReferenceIcon.OnClick += (s, e) => { UIModDownloadItem modListItem = (UIModDownloadItem)e.Parent; Interface.modBrowser.SpecialModPackFilter = modListItem.modreferences.Split(',').ToList(); Interface.modBrowser.SpecialModPackFilterTitle = "Dependencies"; // Toolong of \n" + modListItem.modName.Text; Interface.modBrowser.filterTextBox.currentString = ""; Interface.modBrowser.SortList(); Main.PlaySound(SoundID.MenuOpen); }; Append(modReferenceIcon); } base.OnDoubleClick += RequestMoreinfo; }
public UIModDownloadItem(string displayname, string name, string version, string author, string modreferences, ModSide modside, string modIconURL, string download, int downloads, int hot, string timeStamp, bool update, bool updateIsDowngrade, LocalMod installed) { this.displayname = displayname; this.mod = name; this.version = version; this.author = author; this.modreferences = modreferences; this.modside = modside; this.modIconURL = modIconURL; this.download = download; this.downloads = downloads; this.hot = hot; this.timeStamp = timeStamp; this.update = update; this.updateIsDowngrade = updateIsDowngrade; this.installed = installed; this.BorderColor = new Color(89, 116, 213) * 0.7f; this.dividerTexture = TextureManager.Load("Images/UI/Divider"); this.innerPanelTexture = TextureManager.Load("Images/UI/InnerPanelBackground"); this.Height.Set(90f, 0f); this.Width.Set(0f, 1f); base.SetPadding(6f); this.left = HasModIcon ? 85f : 0f; string text = displayname + " " + version; this.modName = new UIText(text, 1f, false); this.modName.Left.Set(this.left + 5, 0f); this.modName.Top.Set(5f, 0f); base.Append(this.modName); moreInfoButton = new UITextPanel <string>(Language.GetTextValue("tModLoader.ModsMoreInfo"), 1f, false); moreInfoButton.Width.Set(100f, 0f); moreInfoButton.Height.Set(30f, 0f); moreInfoButton.Left.Set(this.left, 0f); moreInfoButton.Top.Set(40f, 0f); moreInfoButton.PaddingTop -= 2f; moreInfoButton.PaddingBottom -= 2f; moreInfoButton.OnMouseOver += UICommon.FadedMouseOver; moreInfoButton.OnMouseOut += UICommon.FadedMouseOut; moreInfoButton.OnClick += RequestMoreinfo; Append(moreInfoButton); if (update || installed == null) { updateButton = new UITextPanel <string>(this.update ? (updateIsDowngrade ? Language.GetTextValue("tModLoader.MBDowngrade") : Language.GetTextValue("tModLoader.MBUpdate")) : Language.GetTextValue("tModLoader.MBDownload"), 1f, false); updateButton.CopyStyle(moreInfoButton); updateButton.Width.Set(HasModIcon ? 120f : 200f, 0f); updateButton.Left.Set(moreInfoButton.Width.Pixels + moreInfoButton.Left.Pixels + 5f, 0f); updateButton.OnMouseOver += UICommon.FadedMouseOver; updateButton.OnMouseOut += UICommon.FadedMouseOut; updateButton.OnClick += this.DownloadMod; Append(updateButton); } if (modreferences.Length > 0) { Texture2D icon = Texture2D.FromStream(Main.instance.GraphicsDevice, Assembly.GetExecutingAssembly().GetManifestResourceStream("Terraria.ModLoader.UI.ButtonExclamation.png")); UIHoverImage modReferenceIcon = new UIHoverImage(icon, Language.GetTextValue("tModLoader.MBClickToViewDependencyMods", string.Join("\n", modreferences.Split(',').Select(x => x.Trim())))); modReferenceIcon.Left.Set(-149f, 1f); modReferenceIcon.Top.Set(48f, 0f); modReferenceIcon.OnClick += (s, e) => { UIModDownloadItem modListItem = (UIModDownloadItem)e.Parent; Interface.modBrowser.SpecialModPackFilter = modListItem.modreferences.Split(',').Select(x => x.Trim()).ToList(); Interface.modBrowser.SpecialModPackFilterTitle = Language.GetTextValue("tModLoader.MBFilterDependencies"); // Toolong of \n" + modListItem.modName.Text; Interface.modBrowser.filterTextBox.currentString = ""; Interface.modBrowser.updateNeeded = true; Main.PlaySound(SoundID.MenuOpen); }; Append(modReferenceIcon); } OnDoubleClick += RequestMoreinfo; }