private void BuildPage() { this.RemoveAllChildren(); UIElement uiElement = new UIElement(); uiElement.Width.Set(0.0f, 0.8f); uiElement.MaxWidth.Set(800f, 0.0f); uiElement.MinWidth.Set(600f, 0.0f); uiElement.Top.Set(240f, 0.0f); uiElement.Height.Set(-240f, 1f); uiElement.HAlign = 0.5f; this.Append(uiElement); UIPanel uiPanel1 = new UIPanel(); uiPanel1.Width = StyleDimension.Fill; uiPanel1.Height = new StyleDimension(-110f, 1f); uiPanel1.BackgroundColor = new Color(33, 43, 79) * 0.8f; uiPanel1.PaddingRight = 0.0f; uiPanel1.PaddingLeft = 0.0f; UIPanel uiPanel2 = uiPanel1; uiElement.Append((UIElement)uiPanel2); int num1 = 35; int num2 = num1; int num3 = 30; UIElement element1 = new UIElement() { Width = StyleDimension.Fill, Height = StyleDimension.FromPixelsAndPercent((float)-(num3 + 4 + 5), 1f), VAlign = 1f }; element1.SetPadding(0.0f); uiPanel2.Append(element1); UIElement element2 = new UIElement() { Width = new StyleDimension(-20f, 0.5f), Height = new StyleDimension(0.0f, 1f), Left = new StyleDimension(10f, 0.0f) }; element2.SetPadding(0.0f); element1.Append(element2); UIElement element3 = new UIElement() { Width = new StyleDimension(-20f, 0.5f), Height = new StyleDimension(0.0f, 1f), Left = new StyleDimension(-10f, 0.0f), HAlign = 1f }; element3.SetPadding(0.0f); element1.Append(element3); UIList uiList1 = new UIList(); uiList1.Width = new StyleDimension(-25f, 1f); uiList1.Height = new StyleDimension(0.0f, 1f); uiList1.ListPadding = 5f; uiList1.HAlign = 1f; UIList uiList2 = uiList1; element2.Append((UIElement)uiList2); this._availablePacksList = uiList2; UIList uiList3 = new UIList(); uiList3.Width = new StyleDimension(-25f, 1f); uiList3.Height = new StyleDimension(0.0f, 1f); uiList3.ListPadding = 5f; uiList3.HAlign = 0.0f; uiList3.Left = new StyleDimension(0.0f, 0.0f); UIList uiList4 = uiList3; element3.Append((UIElement)uiList4); this._enabledPacksList = uiList4; UIText uiText1 = new UIText(Language.GetText("UI.AvailableResourcePacksTitle"), 1f, false); uiText1.HAlign = 0.0f; uiText1.Left = new StyleDimension(25f, 0.0f); uiText1.Width = new StyleDimension(-25f, 0.5f); uiText1.VAlign = 0.0f; uiText1.Top = new StyleDimension(10f, 0.0f); UIText uiText2 = uiText1; this._titleAvailable = uiText2; uiPanel2.Append((UIElement)uiText2); UIText uiText3 = new UIText(Language.GetText("UI.EnabledResourcePacksTitle"), 1f, false); uiText3.HAlign = 1f; uiText3.Left = new StyleDimension(-25f, 0.0f); uiText3.Width = new StyleDimension(-25f, 0.5f); uiText3.VAlign = 0.0f; uiText3.Top = new StyleDimension(10f, 0.0f); UIText uiText4 = uiText3; this._titleEnabled = uiText4; uiPanel2.Append((UIElement)uiText4); UITextPanel <LocalizedText> uiTextPanel1 = new UITextPanel <LocalizedText>(Language.GetText("UI.ResourcePacks"), 1f, true); uiTextPanel1.HAlign = 0.5f; uiTextPanel1.VAlign = 0.0f; uiTextPanel1.Top = new StyleDimension(-44f, 0.0f); uiTextPanel1.BackgroundColor = new Color(73, 94, 171); UITextPanel <LocalizedText> uiTextPanel2 = uiTextPanel1; uiTextPanel2.SetPadding(13f); uiElement.Append((UIElement)uiTextPanel2); UIScrollbar uiScrollbar1 = new UIScrollbar(); uiScrollbar1.Height = new StyleDimension(0.0f, 1f); uiScrollbar1.HAlign = 0.0f; uiScrollbar1.Left = new StyleDimension(0.0f, 0.0f); UIScrollbar scrollbar1 = uiScrollbar1; element2.Append((UIElement)scrollbar1); this._availablePacksList.SetScrollbar(scrollbar1); UIVerticalSeparator verticalSeparator1 = new UIVerticalSeparator(); verticalSeparator1.Height = new StyleDimension(-12f, 1f); verticalSeparator1.HAlign = 0.5f; verticalSeparator1.VAlign = 1f; verticalSeparator1.Color = new Color(89, 116, 213, (int)byte.MaxValue) * 0.9f; UIVerticalSeparator verticalSeparator2 = verticalSeparator1; uiPanel2.Append((UIElement)verticalSeparator2); UIHorizontalSeparator horizontalSeparator1 = new UIHorizontalSeparator(2, true); horizontalSeparator1.Width = new StyleDimension((float)-num2, 0.5f); horizontalSeparator1.VAlign = 0.0f; horizontalSeparator1.HAlign = 0.0f; horizontalSeparator1.Color = new Color(89, 116, 213, (int)byte.MaxValue) * 0.9f; horizontalSeparator1.Top = new StyleDimension((float)num3, 0.0f); horizontalSeparator1.Left = new StyleDimension((float)num1, 0.0f); UIHorizontalSeparator horizontalSeparator2 = new UIHorizontalSeparator(2, true); horizontalSeparator2.Width = new StyleDimension((float)-num2, 0.5f); horizontalSeparator2.VAlign = 0.0f; horizontalSeparator2.HAlign = 1f; horizontalSeparator2.Color = new Color(89, 116, 213, (int)byte.MaxValue) * 0.9f; horizontalSeparator2.Top = new StyleDimension((float)num3, 0.0f); horizontalSeparator2.Left = new StyleDimension((float)-num1, 0.0f); UIScrollbar uiScrollbar2 = new UIScrollbar(); uiScrollbar2.Height = new StyleDimension(0.0f, 1f); uiScrollbar2.HAlign = 1f; UIScrollbar scrollbar2 = uiScrollbar2; element3.Append((UIElement)scrollbar2); this._enabledPacksList.SetScrollbar(scrollbar2); this.AddBackAndFolderButtons(uiElement); }
private void BuildPage() { RemoveAllChildren(); UIElement uIElement = new UIElement(); uIElement.Width.Set(0f, 0.8f); uIElement.MaxWidth.Set(800f, 0f); uIElement.MinWidth.Set(600f, 0f); uIElement.Top.Set(240f, 0f); uIElement.Height.Set(-240f, 1f); uIElement.HAlign = 0.5f; Append(uIElement); UIPanel uIPanel = new UIPanel { Width = StyleDimension.Fill, Height = new StyleDimension(-110f, 1f), BackgroundColor = new Color(33, 43, 79) * 0.8f, PaddingRight = 0f, PaddingLeft = 0f }; uIElement.Append(uIPanel); int num = 35; int num2 = num; int num3 = 30; UIElement uIElement2 = new UIElement { Width = StyleDimension.Fill, Height = StyleDimension.FromPixelsAndPercent(-(num3 + 4 + 5), 1f), VAlign = 1f }; uIElement2.SetPadding(0f); uIPanel.Append(uIElement2); UIElement uIElement3 = new UIElement { Width = new StyleDimension(-20f, 0.5f), Height = new StyleDimension(0f, 1f), Left = new StyleDimension(10f, 0f) }; uIElement3.SetPadding(0f); uIElement2.Append(uIElement3); UIElement uIElement4 = new UIElement { Width = new StyleDimension(-20f, 0.5f), Height = new StyleDimension(0f, 1f), Left = new StyleDimension(-10f, 0f), HAlign = 1f }; uIElement4.SetPadding(0f); uIElement2.Append(uIElement4); UIList uIList = new UIList { Width = new StyleDimension(-25f, 1f), Height = new StyleDimension(0f, 1f), ListPadding = 5f, HAlign = 1f }; uIElement3.Append(uIList); _availablePacksList = uIList; UIList uIList2 = new UIList { Width = new StyleDimension(-25f, 1f), Height = new StyleDimension(0f, 1f), ListPadding = 5f, HAlign = 0f, Left = new StyleDimension(0f, 0f) }; uIElement4.Append(uIList2); _enabledPacksList = uIList2; uIPanel.Append(_titleAvailable = new UIText(Language.GetText("UI.AvailableResourcePacksTitle")) { HAlign = 0f, Left = new StyleDimension(25f, 0f), Width = new StyleDimension(-25f, 0.5f), VAlign = 0f, Top = new StyleDimension(10f, 0f) }); uIPanel.Append(_titleEnabled = new UIText(Language.GetText("UI.EnabledResourcePacksTitle")) { HAlign = 1f, Left = new StyleDimension(-25f, 0f), Width = new StyleDimension(-25f, 0.5f), VAlign = 0f, Top = new StyleDimension(10f, 0f) }); UITextPanel <LocalizedText> uITextPanel = new UITextPanel <LocalizedText>(Language.GetText("UI.ResourcePacks"), 1f, large: true) { HAlign = 0.5f, VAlign = 0f, Top = new StyleDimension(-44f, 0f), BackgroundColor = new Color(73, 94, 171) }; uITextPanel.SetPadding(13f); uIElement.Append(uITextPanel); UIScrollbar uIScrollbar = new UIScrollbar { Height = new StyleDimension(0f, 1f), HAlign = 0f, Left = new StyleDimension(0f, 0f) }; uIElement3.Append(uIScrollbar); _availablePacksList.SetScrollbar(uIScrollbar); UIVerticalSeparator element = new UIVerticalSeparator { Height = new StyleDimension(-12f, 1f), HAlign = 0.5f, VAlign = 1f, Color = new Color(89, 116, 213, 255) * 0.9f }; uIPanel.Append(element); new UIHorizontalSeparator { Width = new StyleDimension(-num2, 0.5f), VAlign = 0f, HAlign = 0f, Color = new Color(89, 116, 213, 255) * 0.9f, Top = new StyleDimension(num3, 0f), Left = new StyleDimension(num, 0f) }; new UIHorizontalSeparator { Width = new StyleDimension(-num2, 0.5f), VAlign = 0f, HAlign = 1f, Color = new Color(89, 116, 213, 255) * 0.9f, Top = new StyleDimension(num3, 0f), Left = new StyleDimension(-num, 0f) }; UIScrollbar uIScrollbar2 = new UIScrollbar { Height = new StyleDimension(0f, 1f), HAlign = 1f }; uIElement4.Append(uIScrollbar2); _enabledPacksList.SetScrollbar(uIScrollbar2); AddBackAndFolderButtons(uIElement); }