private void AddInfoToList(BestiaryEntry entry, ExtraBestiaryInfoPageInformation extraInfo) { BestiaryUICollectionInfo uiCollectionInfo = this.GetUICollectionInfo(entry, extraInfo); IOrderedEnumerable <IGrouping <UIBestiaryEntryInfoPage.BestiaryInfoCategory, IBestiaryInfoElement> > orderedEnumerable = new List <IBestiaryInfoElement>((IEnumerable <IBestiaryInfoElement>)entry.Info).GroupBy <IBestiaryInfoElement, UIBestiaryEntryInfoPage.BestiaryInfoCategory>(new Func <IBestiaryInfoElement, UIBestiaryEntryInfoPage.BestiaryInfoCategory>(this.GetBestiaryInfoCategory)).OrderBy <IGrouping <UIBestiaryEntryInfoPage.BestiaryInfoCategory, IBestiaryInfoElement>, UIBestiaryEntryInfoPage.BestiaryInfoCategory>((Func <IGrouping <UIBestiaryEntryInfoPage.BestiaryInfoCategory, IBestiaryInfoElement>, UIBestiaryEntryInfoPage.BestiaryInfoCategory>)(x => x.Key)); UIElement uiElement1 = (UIElement)null; foreach (IGrouping <UIBestiaryEntryInfoPage.BestiaryInfoCategory, IBestiaryInfoElement> source in (IEnumerable <IGrouping <UIBestiaryEntryInfoPage.BestiaryInfoCategory, IBestiaryInfoElement> >)orderedEnumerable) { if (source.Count <IBestiaryInfoElement>() != 0) { bool flag = false; foreach (IBestiaryInfoElement bestiaryInfoElement in (IEnumerable <IBestiaryInfoElement>)source) { UIElement uiElement2 = bestiaryInfoElement.ProvideUIElement(uiCollectionInfo); if (uiElement2 != null) { this._list.Add(uiElement2); flag = true; } } if (flag) { UIHorizontalSeparator horizontalSeparator1 = new UIHorizontalSeparator(2, true); horizontalSeparator1.Width = StyleDimension.FromPixelsAndPercent(0.0f, 1f); horizontalSeparator1.Color = new Color(89, 116, 213, (int)byte.MaxValue) * 0.9f; UIHorizontalSeparator horizontalSeparator2 = horizontalSeparator1; this._list.Add((UIElement)horizontalSeparator2); uiElement1 = (UIElement)horizontalSeparator2; } } } this._list.Remove(uiElement1); }
public UIElement ProvideUIElement(BestiaryUICollectionInfo info) { if (info.UnlockState < BestiaryEntryUnlockState.CanShowStats_2) { return((UIElement)null); } UIPanel uiPanel = new UIPanel((Asset <Texture2D>)Main.Assets.Request <Texture2D>("Images/UI/Bestiary/Stat_Panel", (AssetRequestMode)1), (Asset <Texture2D>)null, 12, 7); uiPanel.Width = new StyleDimension(-11f, 1f); uiPanel.Height = new StyleDimension(109f, 0.0f); uiPanel.BackgroundColor = new Color(43, 56, 101); uiPanel.BorderColor = Color.Transparent; uiPanel.Left = new StyleDimension(3f, 0.0f); uiPanel.PaddingLeft = 4f; uiPanel.PaddingRight = 4f; UIText uiText = new UIText(Language.GetText(this._key), 0.8f, false); uiText.HAlign = 0.0f; uiText.VAlign = 0.0f; uiText.Width = StyleDimension.FromPixelsAndPercent(0.0f, 1f); uiText.Height = StyleDimension.FromPixelsAndPercent(0.0f, 1f); uiText.IsWrapped = true; UIText text = uiText; FlavorTextBestiaryInfoElement.AddDynamicResize((UIElement)uiPanel, text); uiPanel.Append((UIElement)text); return((UIElement)uiPanel); }
private void MakeBackAndCreatebuttons(UIElement outerContainer) { UITextPanel <LocalizedText> uiTextPanel1 = new UITextPanel <LocalizedText>(Language.GetText("UI.Back"), 0.7f, true); uiTextPanel1.Width = StyleDimension.FromPixelsAndPercent(-10f, 0.5f); uiTextPanel1.Height = StyleDimension.FromPixels(50f); uiTextPanel1.VAlign = 1f; uiTextPanel1.HAlign = 0.0f; uiTextPanel1.Top = StyleDimension.FromPixels(-45f); UITextPanel <LocalizedText> uiTextPanel2 = uiTextPanel1; uiTextPanel2.OnMouseOver += new UIElement.MouseEvent(this.FadedMouseOver); uiTextPanel2.OnMouseOut += new UIElement.MouseEvent(this.FadedMouseOut); uiTextPanel2.OnMouseDown += new UIElement.MouseEvent(this.Click_GoBack); uiTextPanel2.SetSnapPoint("Back", 0, new Vector2?(), new Vector2?()); outerContainer.Append((UIElement)uiTextPanel2); UITextPanel <LocalizedText> uiTextPanel3 = new UITextPanel <LocalizedText>(Language.GetText("UI.Create"), 0.7f, true); uiTextPanel3.Width = StyleDimension.FromPixelsAndPercent(-10f, 0.5f); uiTextPanel3.Height = StyleDimension.FromPixels(50f); uiTextPanel3.VAlign = 1f; uiTextPanel3.HAlign = 1f; uiTextPanel3.Top = StyleDimension.FromPixels(-45f); UITextPanel <LocalizedText> uiTextPanel4 = uiTextPanel3; uiTextPanel4.OnMouseOver += new UIElement.MouseEvent(this.FadedMouseOver); uiTextPanel4.OnMouseOut += new UIElement.MouseEvent(this.FadedMouseOut); uiTextPanel4.OnMouseDown += new UIElement.MouseEvent(this.Click_NamingAndCreating); uiTextPanel4.SetSnapPoint("Create", 0, new Vector2?(), new Vector2?()); outerContainer.Append((UIElement)uiTextPanel4); }
public UIElement ProvideUIElement(BestiaryUICollectionInfo info) { if (info.UnlockState < BestiaryEntryUnlockState.CanShowStats_2) { return(null); } UIPanel obj = new UIPanel(Main.Assets.Request <Texture2D>("Images/UI/Bestiary/Stat_Panel", Main.content, (AssetRequestMode)1), null, 12, 7) { Width = new StyleDimension(-11f, 1f), Height = new StyleDimension(109f, 0f), BackgroundColor = new Color(43, 56, 101), BorderColor = Color.Transparent, Left = new StyleDimension(3f, 0f), PaddingLeft = 4f, PaddingRight = 4f }; UIText uIText = new UIText(Language.GetText(_key), 0.8f) { HAlign = 0f, VAlign = 0f, Width = StyleDimension.FromPixelsAndPercent(0f, 1f), Height = StyleDimension.FromPixelsAndPercent(0f, 1f), IsWrapped = true }; AddDynamicResize(obj, uIText); obj.Append(uIText); return(obj); }
private void AddDescriptionPanel(UIElement container, float accumulatedHeight, string tagGroup) { float num = 0f; UISlicedImage uISlicedImage = new UISlicedImage(Main.Assets.Request <Texture2D>("Images/UI/CharCreation/CategoryPanelHighlight", Main.content, (AssetRequestMode)1)) { HAlign = 0.5f, VAlign = 1f, Width = StyleDimension.FromPixelsAndPercent((0f - num) * 2f, 1f), Left = StyleDimension.FromPixels(0f - num), Height = StyleDimension.FromPixelsAndPercent(40f, 0f), Top = StyleDimension.FromPixels(2f) }; uISlicedImage.SetSliceDepths(10); uISlicedImage.Color = Color.LightGray * 0.7f; container.Append(uISlicedImage); UIText uIText = new UIText(Language.GetText("UI.WorldDescriptionDefault"), 0.82f) { HAlign = 0f, VAlign = 0f, Width = StyleDimension.FromPixelsAndPercent(0f, 1f), Height = StyleDimension.FromPixelsAndPercent(0f, 1f), Top = StyleDimension.FromPixelsAndPercent(5f, 0f) }; uIText.PaddingLeft = 20f; uIText.PaddingRight = 20f; uIText.PaddingTop = 6f; uISlicedImage.Append(uIText); _descriptionText = uIText; }
public UIBestiaryEntryInfoPage() { this.Width.Set(230f, 0.0f); this.Height.Set(0.0f, 1f); this.SetPadding(0.0f); this.BorderColor = new Color(89, 116, 213, (int)byte.MaxValue); this.BackgroundColor = new Color(73, 94, 171); UIList uiList1 = new UIList(); uiList1.Width = StyleDimension.FromPixelsAndPercent(0.0f, 1f); uiList1.Height = StyleDimension.FromPixelsAndPercent(0.0f, 1f); UIList uiList2 = uiList1; uiList2.SetPadding(2f); uiList2.PaddingBottom = 4f; uiList2.PaddingTop = 4f; this.Append((UIElement)uiList2); this._list = uiList2; uiList2.ListPadding = 4f; uiList2.ManualSortMethod = new Action <List <UIElement> >(this.ManualIfnoSortingMethod); UIScrollbar uiScrollbar = new UIScrollbar(); uiScrollbar.SetView(100f, 1000f); uiScrollbar.Height.Set(-20f, 1f); uiScrollbar.HAlign = 1f; uiScrollbar.VAlign = 0.5f; uiScrollbar.Left.Set(-6f, 0.0f); this._scrollbar = uiScrollbar; this._list.SetScrollbar(this._scrollbar); this.CheckScrollBar(); this.AppendBorderOverEverything(); }
private void MakeBackAndCreatebuttons(UIElement outerContainer) { UITextPanel <LocalizedText> uITextPanel = new UITextPanel <LocalizedText>(Language.GetText("UI.Back"), 0.7f, large: true) { Width = StyleDimension.FromPixelsAndPercent(-10f, 0.5f), Height = StyleDimension.FromPixels(50f), VAlign = 1f, HAlign = 0f, Top = StyleDimension.FromPixels(-45f) }; uITextPanel.OnMouseOver += FadedMouseOver; uITextPanel.OnMouseOut += FadedMouseOut; uITextPanel.OnMouseDown += Click_GoBack; uITextPanel.SetSnapPoint("Back", 0); outerContainer.Append(uITextPanel); UITextPanel <LocalizedText> uITextPanel2 = new UITextPanel <LocalizedText>(Language.GetText("UI.Create"), 0.7f, large: true) { Width = StyleDimension.FromPixelsAndPercent(-10f, 0.5f), Height = StyleDimension.FromPixels(50f), VAlign = 1f, HAlign = 1f, Top = StyleDimension.FromPixels(-45f) }; uITextPanel2.OnMouseOver += FadedMouseOver; uITextPanel2.OnMouseOut += FadedMouseOut; uITextPanel2.OnMouseDown += Click_NamingAndCreating; uITextPanel2.SetSnapPoint("Create", 0); outerContainer.Append(uITextPanel2); }
private void AddDescriptionPanel(UIElement container, float accumulatedHeight, string tagGroup) { float num = 0.0f; UISlicedImage uiSlicedImage1 = new UISlicedImage((Asset <Texture2D>)Main.Assets.Request <Texture2D>("Images/UI/CharCreation/CategoryPanelHighlight", (AssetRequestMode)1)); uiSlicedImage1.HAlign = 0.5f; uiSlicedImage1.VAlign = 1f; uiSlicedImage1.Width = StyleDimension.FromPixelsAndPercent((float)(-(double)num * 2.0), 1f); uiSlicedImage1.Left = StyleDimension.FromPixels(-num); uiSlicedImage1.Height = StyleDimension.FromPixelsAndPercent(40f, 0.0f); uiSlicedImage1.Top = StyleDimension.FromPixels(2f); UISlicedImage uiSlicedImage2 = uiSlicedImage1; uiSlicedImage2.SetSliceDepths(10); uiSlicedImage2.Color = Color.LightGray * 0.7f; container.Append((UIElement)uiSlicedImage2); UIText uiText1 = new UIText(Language.GetText("UI.WorldDescriptionDefault"), 0.82f, false); uiText1.HAlign = 0.0f; uiText1.VAlign = 0.0f; uiText1.Width = StyleDimension.FromPixelsAndPercent(0.0f, 1f); uiText1.Height = StyleDimension.FromPixelsAndPercent(0.0f, 1f); uiText1.Top = StyleDimension.FromPixelsAndPercent(5f, 0.0f); UIText uiText2 = uiText1; uiText2.PaddingLeft = 20f; uiText2.PaddingRight = 20f; uiText2.PaddingTop = 6f; uiSlicedImage2.Append((UIElement)uiText2); this._descriptionText = uiText2; }
private UIElement CreatePackToggleButton(ResourcePack resourcePack) { Language.GetText(resourcePack.IsEnabled ? "GameUI.Enabled" : "GameUI.Disabled"); GroupOptionButton <bool> groupOptionButton = new GroupOptionButton <bool>(option: true, null, null, Color.White, null, 0.8f); groupOptionButton.Left = StyleDimension.FromPercent(0.5f); groupOptionButton.Width = StyleDimension.FromPixelsAndPercent(0f, 0.5f); groupOptionButton.Height = StyleDimension.Fill; groupOptionButton.SetColorsBasedOnSelectionState(Color.LightGreen, Color.PaleVioletRed, 0.7f, 0.7f); groupOptionButton.SetCurrentOption(resourcePack.IsEnabled); groupOptionButton.ShowHighlightWhenSelected = false; groupOptionButton.SetPadding(0f); Asset <Texture2D> obj = Main.Assets.Request <Texture2D>("Images/UI/TexturePackButtons", (AssetRequestMode)1); UIImageFramed element = new UIImageFramed(obj, obj.Frame(2, 2, (!resourcePack.IsEnabled) ? 1 : 0, 1)) { HAlign = 0.5f, VAlign = 0.5f, IgnoresMouseInteraction = true }; groupOptionButton.Append(element); groupOptionButton.OnMouseOver += delegate { SoundEngine.PlaySound(12); }; groupOptionButton.OnClick += delegate { SoundEngine.PlaySound(12); resourcePack.IsEnabled = !resourcePack.IsEnabled; SetResourcePackAsTopPriority(resourcePack); PopulatePackList(); Main.instance.TilePaintSystem.Reset(); }; return(groupOptionButton); }
private UIElement CreatePackToggleButton(ResourcePack resourcePack) { Language.GetText(resourcePack.IsEnabled ? "GameUI.Enabled" : "GameUI.Disabled"); GroupOptionButton <bool> groupOptionButton = new GroupOptionButton <bool>(true, (LocalizedText)null, (LocalizedText)null, Color.White, (string)null, 0.8f, 0.5f, 10f); groupOptionButton.Left = StyleDimension.FromPercent(0.5f); groupOptionButton.Width = StyleDimension.FromPixelsAndPercent(0.0f, 0.5f); groupOptionButton.Height = StyleDimension.Fill; groupOptionButton.SetColorsBasedOnSelectionState(Color.LightGreen, Color.PaleVioletRed, 0.7f, 0.7f); groupOptionButton.SetCurrentOption(resourcePack.IsEnabled); groupOptionButton.ShowHighlightWhenSelected = false; groupOptionButton.SetPadding(0.0f); Asset <M0> asset = Main.Assets.Request <Texture2D>("Images/UI/TexturePackButtons", (AssetRequestMode)1); UIImageFramed uiImageFramed = new UIImageFramed((Asset <Texture2D>)asset, ((Asset <Texture2D>)asset).Frame(2, 2, resourcePack.IsEnabled ? 0 : 1, 1, 0, 0)); uiImageFramed.HAlign = 0.5f; uiImageFramed.VAlign = 0.5f; uiImageFramed.IgnoresMouseInteraction = true; groupOptionButton.Append((UIElement)uiImageFramed); groupOptionButton.OnMouseOver += (UIElement.MouseEvent)((evt, listeningElement) => SoundEngine.PlaySound(12, -1, -1, 1, 1f, 0.0f)); groupOptionButton.OnClick += (UIElement.MouseEvent)((evt, listeningElement) => { SoundEngine.PlaySound(12, -1, -1, 1, 1f, 0.0f); resourcePack.IsEnabled = !resourcePack.IsEnabled; this.SetResourcePackAsTopPriority(resourcePack); this.PopulatePackList(); }); return((UIElement)groupOptionButton); }
public GroupOptionButton(T option, LocalizedText title, LocalizedText description, Color textColor, string iconTexturePath, float textSize = 1f, float titleAlignmentX = 0.5f, float titleWidthReduction = 10f) { _borderColor = Color.White; _currentOption = option; _myOption = option; Description = description; Width = StyleDimension.FromPixels(44f); Height = StyleDimension.FromPixels(34f); _BasePanelTexture = Main.Assets.Request <Texture2D>("Images/UI/CharCreation/PanelGrayscale", (AssetRequestMode)1); _selectedBorderTexture = Main.Assets.Request <Texture2D>("Images/UI/CharCreation/CategoryPanelHighlight", (AssetRequestMode)1); _hoveredBorderTexture = Main.Assets.Request <Texture2D>("Images/UI/CharCreation/CategoryPanelBorder", (AssetRequestMode)1); if (iconTexturePath != null) { _iconTexture = Main.Assets.Request <Texture2D>(iconTexturePath, (AssetRequestMode)1); } _color = Colors.InventoryDefaultColor; if (title != null) { UIText uIText = new UIText(title, textSize) { HAlign = titleAlignmentX, VAlign = 0.5f, Width = StyleDimension.FromPixelsAndPercent(0f - titleWidthReduction, 1f), Top = StyleDimension.FromPixels(0f) }; uIText.TextColor = textColor; Append(uIText); _title = uIText; } }
public UIBestiaryEntryInfoPage() { Width.Set(230f, 0f); Height.Set(0f, 1f); SetPadding(0f); BorderColor = new Color(89, 116, 213, 255); BackgroundColor = new Color(73, 94, 171); UIList uIList = new UIList { Width = StyleDimension.FromPixelsAndPercent(0f, 1f), Height = StyleDimension.FromPixelsAndPercent(0f, 1f) }; uIList.SetPadding(2f); uIList.PaddingBottom = 4f; uIList.PaddingTop = 4f; Append(uIList); _list = uIList; uIList.ListPadding = 4f; uIList.ManualSortMethod = ManualIfnoSortingMethod; UIScrollbar uIScrollbar = new UIScrollbar(); uIScrollbar.SetView(100f, 1000f); uIScrollbar.Height.Set(-20f, 1f); uIScrollbar.HAlign = 1f; uIScrollbar.VAlign = 0.5f; uIScrollbar.Left.Set(-6f, 0f); _scrollbar = uIScrollbar; _list.SetScrollbar(_scrollbar); CheckScrollBar(); AppendBorderOverEverything(); }
private void AddWorldDifficultyOptions( UIElement container, float accumualtedHeight, UIElement.MouseEvent clickEvent, string tagGroup, float usableWidthPercent) { UIWorldCreation.WorldDifficultyId[] worldDifficultyIdArray = new UIWorldCreation.WorldDifficultyId[4] { UIWorldCreation.WorldDifficultyId.Creative, UIWorldCreation.WorldDifficultyId.Normal, UIWorldCreation.WorldDifficultyId.Expert, UIWorldCreation.WorldDifficultyId.Master }; LocalizedText[] localizedTextArray1 = new LocalizedText[4] { Language.GetText("UI.Creative"), Language.GetText("UI.Normal"), Language.GetText("UI.Expert"), Language.GetText("UI.Master") }; LocalizedText[] localizedTextArray2 = new LocalizedText[4] { Language.GetText("UI.WorldDescriptionCreative"), Language.GetText("UI.WorldDescriptionNormal"), Language.GetText("UI.WorldDescriptionExpert"), Language.GetText("UI.WorldDescriptionMaster") }; Color[] colorArray = new Color[4] { Main.creativeModeColor, Color.White, Main.mcColor, Main.hcColor }; string[] strArray = new string[4] { "Images/UI/WorldCreation/IconDifficultyCreative", "Images/UI/WorldCreation/IconDifficultyNormal", "Images/UI/WorldCreation/IconDifficultyExpert", "Images/UI/WorldCreation/IconDifficultyMaster" }; GroupOptionButton <UIWorldCreation.WorldDifficultyId>[] groupOptionButtonArray = new GroupOptionButton <UIWorldCreation.WorldDifficultyId> [worldDifficultyIdArray.Length]; for (int id = 0; id < groupOptionButtonArray.Length; ++id) { GroupOptionButton <UIWorldCreation.WorldDifficultyId> groupOptionButton = new GroupOptionButton <UIWorldCreation.WorldDifficultyId>(worldDifficultyIdArray[id], localizedTextArray1[id], localizedTextArray2[id], colorArray[id], strArray[id], 1f, 1f, 16f); groupOptionButton.Width = StyleDimension.FromPixelsAndPercent((float)(-1 * (groupOptionButtonArray.Length - 1)), 1f / (float)groupOptionButtonArray.Length * usableWidthPercent); groupOptionButton.Left = StyleDimension.FromPercent(1f - usableWidthPercent); groupOptionButton.HAlign = (float)id / (float)(groupOptionButtonArray.Length - 1); groupOptionButton.Top.Set(accumualtedHeight, 0.0f); groupOptionButton.OnMouseDown += clickEvent; groupOptionButton.OnMouseOver += new UIElement.MouseEvent(this.ShowOptionDescription); groupOptionButton.OnMouseOut += new UIElement.MouseEvent(this.ClearOptionDescription); groupOptionButton.SetSnapPoint(tagGroup, id, new Vector2?(), new Vector2?()); container.Append((UIElement)groupOptionButton); groupOptionButtonArray[id] = groupOptionButton; } this._difficultyButtons = groupOptionButtonArray; }
private UIElement CreateOffsetButton(ResourcePack resourcePack, int offset) { GroupOptionButton <bool> groupOptionButton = new GroupOptionButton <bool>(option: true, null, null, Color.White, null, 0.8f) { Left = StyleDimension.FromPercent(0.5f), Width = StyleDimension.FromPixelsAndPercent(0f, 0.5f), Height = StyleDimension.Fill }; bool num = (offset == -1 && resourcePack.SortingOrder == 0) | (offset == 1 && resourcePack.SortingOrder == _packsList.EnabledPacks.Count() - 1); Color lightCyan = Color.LightCyan; groupOptionButton.SetColorsBasedOnSelectionState(lightCyan, lightCyan, 0.7f, 0.7f); groupOptionButton.ShowHighlightWhenSelected = false; groupOptionButton.SetPadding(0f); Asset <Texture2D> obj = Main.Assets.Request <Texture2D>("Images/UI/TexturePackButtons", Main.content, (AssetRequestMode)1); UIImageFramed element = new UIImageFramed(obj, obj.Frame(2, 2, (offset == 1) ? 1 : 0)) { HAlign = 0.5f, VAlign = 0.5f, IgnoresMouseInteraction = true }; groupOptionButton.Append(element); groupOptionButton.OnMouseOver += delegate { SoundEngine.PlaySound(12); }; int offsetLocalForLambda = offset; if (num) { groupOptionButton.OnClick += delegate { SoundEngine.PlaySound(12); }; } else { groupOptionButton.OnClick += delegate { SoundEngine.PlaySound(12); OffsetResourcePackPriority(resourcePack, offsetLocalForLambda); PopulatePackList(); Main.instance.TilePaintSystem.Reset(); }; } if (offset == 1) { groupOptionButton.OnUpdate += OffsetFrontwardUpdate; } else { groupOptionButton.OnUpdate += OffsetBackwardUpdate; } return(groupOptionButton); }
private void AddWorldEvilOptions( UIElement container, float accumualtedHeight, UIElement.MouseEvent clickEvent, string tagGroup, float usableWidthPercent) { UIWorldCreation.WorldEvilId[] worldEvilIdArray = new UIWorldCreation.WorldEvilId[3] { UIWorldCreation.WorldEvilId.Random, UIWorldCreation.WorldEvilId.Corruption, UIWorldCreation.WorldEvilId.Crimson }; LocalizedText[] localizedTextArray1 = new LocalizedText[3] { Lang.misc[103], Lang.misc[101], Lang.misc[102] }; LocalizedText[] localizedTextArray2 = new LocalizedText[3] { Language.GetText("UI.WorldDescriptionEvilRandom"), Language.GetText("UI.WorldDescriptionEvilCorrupt"), Language.GetText("UI.WorldDescriptionEvilCrimson") }; Color[] colorArray = new Color[3] { Color.White, Color.MediumPurple, Color.IndianRed }; string[] strArray = new string[3] { "Images/UI/WorldCreation/IconEvilRandom", "Images/UI/WorldCreation/IconEvilCorruption", "Images/UI/WorldCreation/IconEvilCrimson" }; GroupOptionButton <UIWorldCreation.WorldEvilId>[] groupOptionButtonArray = new GroupOptionButton <UIWorldCreation.WorldEvilId> [worldEvilIdArray.Length]; for (int id = 0; id < groupOptionButtonArray.Length; ++id) { GroupOptionButton <UIWorldCreation.WorldEvilId> groupOptionButton = new GroupOptionButton <UIWorldCreation.WorldEvilId>(worldEvilIdArray[id], localizedTextArray1[id], localizedTextArray2[id], colorArray[id], strArray[id], 1f, 1f, 16f); groupOptionButton.Width = StyleDimension.FromPixelsAndPercent((float)(-4 * (groupOptionButtonArray.Length - 1)), 1f / (float)groupOptionButtonArray.Length * usableWidthPercent); groupOptionButton.Left = StyleDimension.FromPercent(1f - usableWidthPercent); groupOptionButton.HAlign = (float)id / (float)(groupOptionButtonArray.Length - 1); groupOptionButton.Top.Set(accumualtedHeight, 0.0f); groupOptionButton.OnMouseDown += clickEvent; groupOptionButton.OnMouseOver += new UIElement.MouseEvent(this.ShowOptionDescription); groupOptionButton.OnMouseOut += new UIElement.MouseEvent(this.ClearOptionDescription); groupOptionButton.SetSnapPoint(tagGroup, id, new Vector2?(), new Vector2?()); container.Append((UIElement)groupOptionButton); groupOptionButtonArray[id] = groupOptionButton; } this._evilButtons = groupOptionButtonArray; }
private void AddWorldSizeOptions( UIElement container, float accumualtedHeight, UIElement.MouseEvent clickEvent, string tagGroup, float usableWidthPercent) { UIWorldCreation.WorldSizeId[] worldSizeIdArray = new UIWorldCreation.WorldSizeId[3] { UIWorldCreation.WorldSizeId.Small, UIWorldCreation.WorldSizeId.Medium, UIWorldCreation.WorldSizeId.Large }; LocalizedText[] localizedTextArray1 = new LocalizedText[3] { Lang.menu[92], Lang.menu[93], Lang.menu[94] }; LocalizedText[] localizedTextArray2 = new LocalizedText[3] { Language.GetText("UI.WorldDescriptionSizeSmall"), Language.GetText("UI.WorldDescriptionSizeMedium"), Language.GetText("UI.WorldDescriptionSizeLarge") }; Color[] colorArray = new Color[3] { Color.Cyan, Color.Lerp(Color.Cyan, Color.LimeGreen, 0.5f), Color.LimeGreen }; string[] strArray = new string[3] { "Images/UI/WorldCreation/IconSizeSmall", "Images/UI/WorldCreation/IconSizeMedium", "Images/UI/WorldCreation/IconSizeLarge" }; GroupOptionButton <UIWorldCreation.WorldSizeId>[] groupOptionButtonArray = new GroupOptionButton <UIWorldCreation.WorldSizeId> [worldSizeIdArray.Length]; for (int id = 0; id < groupOptionButtonArray.Length; ++id) { GroupOptionButton <UIWorldCreation.WorldSizeId> groupOptionButton = new GroupOptionButton <UIWorldCreation.WorldSizeId>(worldSizeIdArray[id], localizedTextArray1[id], localizedTextArray2[id], colorArray[id], strArray[id], 1f, 1f, 16f); groupOptionButton.Width = StyleDimension.FromPixelsAndPercent((float)(-4 * (groupOptionButtonArray.Length - 1)), 1f / (float)groupOptionButtonArray.Length * usableWidthPercent); groupOptionButton.Left = StyleDimension.FromPercent(1f - usableWidthPercent); groupOptionButton.HAlign = (float)id / (float)(groupOptionButtonArray.Length - 1); groupOptionButton.Top.Set(accumualtedHeight, 0.0f); groupOptionButton.OnMouseDown += clickEvent; groupOptionButton.OnMouseOver += new UIElement.MouseEvent(this.ShowOptionDescription); groupOptionButton.OnMouseOut += new UIElement.MouseEvent(this.ClearOptionDescription); groupOptionButton.SetSnapPoint(tagGroup, id, new Vector2?(), new Vector2?()); container.Append((UIElement)groupOptionButton); groupOptionButtonArray[id] = groupOptionButton; } this._sizeButtons = groupOptionButtonArray; }
private void AddWorldDifficultyOptions(UIElement container, float accumualtedHeight, MouseEvent clickEvent, string tagGroup, float usableWidthPercent) { WorldDifficultyId[] array = new WorldDifficultyId[4] { WorldDifficultyId.Creative, WorldDifficultyId.Normal, WorldDifficultyId.Expert, WorldDifficultyId.Master }; LocalizedText[] array2 = new LocalizedText[4] { Language.GetText("UI.Creative"), Language.GetText("UI.Normal"), Language.GetText("UI.Expert"), Language.GetText("UI.Master") }; LocalizedText[] array3 = new LocalizedText[4] { Language.GetText("UI.WorldDescriptionCreative"), Language.GetText("UI.WorldDescriptionNormal"), Language.GetText("UI.WorldDescriptionExpert"), Language.GetText("UI.WorldDescriptionMaster") }; Color[] array4 = new Color[4] { Main.creativeModeColor, Color.White, Main.mcColor, Main.hcColor }; string[] array5 = new string[4] { "Images/UI/WorldCreation/IconDifficultyCreative", "Images/UI/WorldCreation/IconDifficultyNormal", "Images/UI/WorldCreation/IconDifficultyExpert", "Images/UI/WorldCreation/IconDifficultyMaster" }; GroupOptionButton <WorldDifficultyId>[] array6 = new GroupOptionButton <WorldDifficultyId> [array.Length]; for (int i = 0; i < array6.Length; i++) { GroupOptionButton <WorldDifficultyId> groupOptionButton = new GroupOptionButton <WorldDifficultyId>(array[i], array2[i], array3[i], array4[i], array5[i], 1f, 1f, 16f); groupOptionButton.Width = StyleDimension.FromPixelsAndPercent(-1 * (array6.Length - 1), 1f / (float)array6.Length * usableWidthPercent); groupOptionButton.Left = StyleDimension.FromPercent(1f - usableWidthPercent); groupOptionButton.HAlign = (float)i / (float)(array6.Length - 1); groupOptionButton.Top.Set(accumualtedHeight, 0f); groupOptionButton.OnMouseDown += clickEvent; groupOptionButton.OnMouseOver += ShowOptionDescription; groupOptionButton.OnMouseOut += ClearOptionDescription; groupOptionButton.SetSnapPoint(tagGroup, i); container.Append(groupOptionButton); array6[i] = groupOptionButton; } _difficultyButtons = array6; }
private UIElement CreateOffsetButton(ResourcePack resourcePack, int offset) { GroupOptionButton <bool> groupOptionButton1 = new GroupOptionButton <bool>(true, (LocalizedText)null, (LocalizedText)null, Color.White, (string)null, 0.8f, 0.5f, 10f); groupOptionButton1.Left = StyleDimension.FromPercent(0.5f); groupOptionButton1.Width = StyleDimension.FromPixelsAndPercent(0.0f, 0.5f); groupOptionButton1.Height = StyleDimension.Fill; GroupOptionButton <bool> groupOptionButton2 = groupOptionButton1; int num = (offset != -1 ? 0 : (resourcePack.SortingOrder == 0 ? 1 : 0)) | (offset != 1 ? 0 : (resourcePack.SortingOrder == this._packsList.EnabledPacks.Count <ResourcePack>() - 1 ? 1 : 0)); Color lightCyan = Color.LightCyan; groupOptionButton2.SetColorsBasedOnSelectionState(lightCyan, lightCyan, 0.7f, 0.7f); groupOptionButton2.ShowHighlightWhenSelected = false; groupOptionButton2.SetPadding(0.0f); Asset <Texture2D> asset = Main.Assets.Request <Texture2D>("Images/UI/TexturePackButtons", (AssetRequestMode)1); UIImageFramed uiImageFramed1 = new UIImageFramed((Asset <Texture2D>)asset, ((Asset <Texture2D>)asset).Frame(2, 2, offset == 1 ? 1 : 0, 0, 0, 0)); uiImageFramed1.HAlign = 0.5f; uiImageFramed1.VAlign = 0.5f; uiImageFramed1.IgnoresMouseInteraction = true; UIImageFramed uiImageFramed2 = uiImageFramed1; groupOptionButton2.Append((UIElement)uiImageFramed2); groupOptionButton2.OnMouseOver += (UIElement.MouseEvent)((evt, listeningElement) => SoundEngine.PlaySound(12, -1, -1, 1, 1f, 0.0f)); int offsetLocalForLambda = offset; if (num != 0) { groupOptionButton2.OnClick += (UIElement.MouseEvent)((evt, listeningElement) => SoundEngine.PlaySound(12, -1, -1, 1, 1f, 0.0f)); } else { groupOptionButton2.OnClick += (UIElement.MouseEvent)((evt, listeningElement) => { SoundEngine.PlaySound(12, -1, -1, 1, 1f, 0.0f); this.OffsetResourcePackPriority(resourcePack, offsetLocalForLambda); this.PopulatePackList(); Main.instance.TilePaintSystem.Reset(); }); } if (offset == 1) { groupOptionButton2.OnUpdate += new UIElement.ElementEvent(this.OffsetFrontwardUpdate); } else { groupOptionButton2.OnUpdate += new UIElement.ElementEvent(this.OffsetBackwardUpdate); } return((UIElement)groupOptionButton2); }
private void AddWorldEvilOptions(UIElement container, float accumualtedHeight, MouseEvent clickEvent, string tagGroup, float usableWidthPercent) { WorldEvilId[] array = new WorldEvilId[3] { WorldEvilId.Random, WorldEvilId.Corruption, WorldEvilId.Crimson }; LocalizedText[] array2 = new LocalizedText[3] { Lang.misc[103], Lang.misc[101], Lang.misc[102] }; LocalizedText[] array3 = new LocalizedText[3] { Language.GetText("UI.WorldDescriptionEvilRandom"), Language.GetText("UI.WorldDescriptionEvilCorrupt"), Language.GetText("UI.WorldDescriptionEvilCrimson") }; Color[] array4 = new Color[3] { Color.White, Color.MediumPurple, Color.IndianRed }; string[] array5 = new string[3] { "Images/UI/WorldCreation/IconEvilRandom", "Images/UI/WorldCreation/IconEvilCorruption", "Images/UI/WorldCreation/IconEvilCrimson" }; GroupOptionButton <WorldEvilId>[] array6 = new GroupOptionButton <WorldEvilId> [array.Length]; for (int i = 0; i < array6.Length; i++) { GroupOptionButton <WorldEvilId> groupOptionButton = new GroupOptionButton <WorldEvilId>(array[i], array2[i], array3[i], array4[i], array5[i], 1f, 1f, 16f); groupOptionButton.Width = StyleDimension.FromPixelsAndPercent(-4 * (array6.Length - 1), 1f / (float)array6.Length * usableWidthPercent); groupOptionButton.Left = StyleDimension.FromPercent(1f - usableWidthPercent); groupOptionButton.HAlign = (float)i / (float)(array6.Length - 1); groupOptionButton.Top.Set(accumualtedHeight, 0f); groupOptionButton.OnMouseDown += clickEvent; groupOptionButton.OnMouseOver += ShowOptionDescription; groupOptionButton.OnMouseOut += ClearOptionDescription; groupOptionButton.SetSnapPoint(tagGroup, i); container.Append(groupOptionButton); array6[i] = groupOptionButton; } _evilButtons = array6; }
private void AddWorldSizeOptions(UIElement container, float accumualtedHeight, MouseEvent clickEvent, string tagGroup, float usableWidthPercent) { WorldSizeId[] array = new WorldSizeId[3] { WorldSizeId.Small, WorldSizeId.Medium, WorldSizeId.Large }; LocalizedText[] array2 = new LocalizedText[3] { Lang.menu[92], Lang.menu[93], Lang.menu[94] }; LocalizedText[] array3 = new LocalizedText[3] { Language.GetText("UI.WorldDescriptionSizeSmall"), Language.GetText("UI.WorldDescriptionSizeMedium"), Language.GetText("UI.WorldDescriptionSizeLarge") }; Color[] array4 = new Color[3] { Color.Cyan, Color.Lerp(Color.Cyan, Color.LimeGreen, 0.5f), Color.LimeGreen }; string[] array5 = new string[3] { "Images/UI/WorldCreation/IconSizeSmall", "Images/UI/WorldCreation/IconSizeMedium", "Images/UI/WorldCreation/IconSizeLarge" }; GroupOptionButton <WorldSizeId>[] array6 = new GroupOptionButton <WorldSizeId> [array.Length]; for (int i = 0; i < array6.Length; i++) { GroupOptionButton <WorldSizeId> groupOptionButton = new GroupOptionButton <WorldSizeId>(array[i], array2[i], array3[i], array4[i], array5[i], 1f, 1f, 16f); groupOptionButton.Width = StyleDimension.FromPixelsAndPercent(-4 * (array6.Length - 1), 1f / (float)array6.Length * usableWidthPercent); groupOptionButton.Left = StyleDimension.FromPercent(1f - usableWidthPercent); groupOptionButton.HAlign = (float)i / (float)(array6.Length - 1); groupOptionButton.Top.Set(accumualtedHeight, 0f); groupOptionButton.OnMouseDown += clickEvent; groupOptionButton.OnMouseOver += ShowOptionDescription; groupOptionButton.OnMouseOut += ClearOptionDescription; groupOptionButton.SetSnapPoint(tagGroup, i); container.Append(groupOptionButton); array6[i] = groupOptionButton; } _sizeButtons = array6; }
public UIElement ProvideUIElement(BestiaryUICollectionInfo info) { UIElement uIElement = new UIPanel(Main.Assets.Request <Texture2D>("Images/UI/Bestiary/Stat_Panel", Main.content, (AssetRequestMode)1), null, 12, 7) { Width = new StyleDimension(-11f, 1f), Height = new StyleDimension(109f, 0f), BackgroundColor = new Color(43, 56, 101), BorderColor = Color.Transparent, Left = new StyleDimension(3f, 0f) }; uIElement.PaddingLeft = 4f; uIElement.PaddingRight = 4f; string arg = Utils.PrettifyPercentDisplay((float)info.UnlockState / 4f, "P2"); string text = $"{arg} Entry Collected"; string arg2 = Utils.PrettifyPercentDisplay(_progressReport.CompletionPercent, "P2"); string text2 = $"{arg2} Bestiary Collected"; int num = 8; UIText uIText = new UIText(text, 0.8f) { HAlign = 0f, VAlign = 0f, Width = StyleDimension.FromPixelsAndPercent(0f, 1f), Height = StyleDimension.FromPixelsAndPercent(0f, 1f), IsWrapped = true, PaddingTop = -num, PaddingBottom = -num }; UIText uIText2 = new UIText(text2, 0.8f) { HAlign = 0f, VAlign = 0f, Width = StyleDimension.FromPixelsAndPercent(0f, 1f), Height = StyleDimension.FromPixelsAndPercent(0f, 1f), IsWrapped = true, PaddingTop = -num, PaddingBottom = -num }; _text1 = uIText; _text2 = uIText2; AddDynamicResize(uIElement, uIText); uIElement.Append(uIText); uIElement.Append(uIText2); return(uIElement); }
private UIElement CreatePackInfoButton(ResourcePack resourcePack) { UIResourcePackInfoButton <string> resourcePackInfoButton = new UIResourcePackInfoButton <string>("", 0.8f, false); resourcePackInfoButton.Width = StyleDimension.FromPixelsAndPercent(0.0f, 0.5f); resourcePackInfoButton.Height = StyleDimension.Fill; resourcePackInfoButton.ResourcePack = resourcePack; resourcePackInfoButton.SetPadding(0.0f); UIImage uiImage = new UIImage((Asset <Texture2D>)Main.Assets.Request <Texture2D>("Images/UI/CharCreation/CharInfo", (AssetRequestMode)1)); uiImage.HAlign = 0.5f; uiImage.VAlign = 0.5f; uiImage.IgnoresMouseInteraction = true; resourcePackInfoButton.Append((UIElement)uiImage); resourcePackInfoButton.OnMouseOver += (UIElement.MouseEvent)((evt, listeningElement) => SoundEngine.PlaySound(12, -1, -1, 1, 1f, 0.0f)); resourcePackInfoButton.OnClick += new UIElement.MouseEvent(this.Click_Info); return((UIElement)resourcePackInfoButton); }
public void SetText(LocalizedText text, float textSize, Color color) { if (this._title != null) { this._title.Remove(); } UIText uiText1 = new UIText(text, textSize, false); uiText1.HAlign = 0.5f; uiText1.VAlign = 0.5f; uiText1.Width = StyleDimension.FromPixelsAndPercent(-10f, 1f); uiText1.Top = StyleDimension.FromPixels(0.0f); UIText uiText2 = uiText1; uiText2.TextColor = color; this.Append((UIElement)uiText2); this._title = uiText2; }
public void SetText(LocalizedText text, float textSize, Color color) { if (_title != null) { _title.Remove(); } UIText uIText = new UIText(text, textSize) { HAlign = 0.5f, VAlign = 0.5f, Width = StyleDimension.FromPixelsAndPercent(-10f, 1f), Top = StyleDimension.FromPixels(0f) }; uIText.TextColor = color; Append(uIText); _title = uIText; }
private void BuildChildren() { StyleDimension left = StyleDimension.FromPixels(77f); StyleDimension top = StyleDimension.FromPixels(4f); UIText uIText = new UIText(ResourcePack.Name) { Left = left, Top = top }; Append(uIText); top.Pixels += uIText.GetOuterDimensions().Height + 6f; UIText uIText2 = new UIText(Language.GetTextValue("UI.Author", ResourcePack.Author), 0.7f) { Left = left, Top = top }; Append(uIText2); top.Pixels += uIText2.GetOuterDimensions().Height + 10f; Asset <Texture2D> val = Main.Assets.Request <Texture2D>("Images/UI/Divider", Main.content, (AssetRequestMode)1); UIImage uIImage = new UIImage(val) { Left = StyleDimension.FromPixels(72f), Top = top, Height = StyleDimension.FromPixels(val.Height()), Width = StyleDimension.FromPixelsAndPercent(-80f, 1f), ScaleToFit = true }; Recalculate(); Append(uIImage); top.Pixels += uIImage.GetOuterDimensions().Height + 5f; UIElement uIElement = new UIElement { Left = left, Top = top, Height = StyleDimension.FromPixels(92f - top.Pixels), Width = StyleDimension.FromPixelsAndPercent(0f - left.Pixels, 1f) }; Append(uIElement); ContentPanel = uIElement; }
private void BuildChildren() { StyleDimension styleDimension1 = StyleDimension.FromPixels(77f); StyleDimension styleDimension2 = StyleDimension.FromPixels(4f); UIText uiText1 = new UIText(this.ResourcePack.Name, 1f, false); uiText1.Left = styleDimension1; uiText1.Top = styleDimension2; UIText uiText2 = uiText1; this.Append((UIElement)uiText2); styleDimension2.Pixels += uiText2.GetOuterDimensions().Height + 6f; UIText uiText3 = new UIText(Language.GetTextValue("UI.Author", (object)this.ResourcePack.Author), 0.7f, false); uiText3.Left = styleDimension1; uiText3.Top = styleDimension2; UIText uiText4 = uiText3; this.Append((UIElement)uiText4); styleDimension2.Pixels += uiText4.GetOuterDimensions().Height + 10f; Asset <Texture2D> asset = (Asset <Texture2D>)Main.Assets.Request <Texture2D>("Images/UI/Divider", (AssetRequestMode)1); UIImage uiImage1 = new UIImage(asset); uiImage1.Left = StyleDimension.FromPixels(72f); uiImage1.Top = styleDimension2; uiImage1.Height = StyleDimension.FromPixels((float)asset.Height()); uiImage1.Width = StyleDimension.FromPixelsAndPercent(-80f, 1f); uiImage1.ScaleToFit = true; UIImage uiImage2 = uiImage1; this.Recalculate(); this.Append((UIElement)uiImage2); styleDimension2.Pixels += uiImage2.GetOuterDimensions().Height + 5f; UIElement element = new UIElement() { Left = styleDimension1, Top = styleDimension2, Height = StyleDimension.FromPixels(92f - styleDimension2.Pixels), Width = StyleDimension.FromPixelsAndPercent(-styleDimension1.Pixels, 1f) }; this.Append(element); this.ContentPanel = element; }
public UIElement ProvideUIElement(BestiaryUICollectionInfo info) { UIPanel uiPanel = new UIPanel((Asset <Texture2D>)Main.Assets.Request <Texture2D>("Images/UI/Bestiary/Stat_Panel", (AssetRequestMode)1), (Asset <Texture2D>)null, 12, 7); uiPanel.Width = new StyleDimension(-11f, 1f); uiPanel.Height = new StyleDimension(109f, 0.0f); uiPanel.BackgroundColor = new Color(43, 56, 101); uiPanel.BorderColor = Color.Transparent; uiPanel.Left = new StyleDimension(3f, 0.0f); UIElement container = (UIElement)uiPanel; container.PaddingLeft = 4f; container.PaddingRight = 4f; string text1 = string.Format("{0} Entry Collected", (object)Utils.PrettifyPercentDisplay((float)info.UnlockState / 4f, "P2")); string text2 = string.Format("{0} Bestiary Collected", (object)Utils.PrettifyPercentDisplay(this._progressReport.CompletionPercent, "P2")); int num = 8; UIText uiText1 = new UIText(text1, 0.8f, false); uiText1.HAlign = 0.0f; uiText1.VAlign = 0.0f; uiText1.Width = StyleDimension.FromPixelsAndPercent(0.0f, 1f); uiText1.Height = StyleDimension.FromPixelsAndPercent(0.0f, 1f); uiText1.IsWrapped = true; uiText1.PaddingTop = (float)-num; uiText1.PaddingBottom = (float)-num; UIText text3 = uiText1; UIText uiText2 = new UIText(text2, 0.8f, false); uiText2.HAlign = 0.0f; uiText2.VAlign = 0.0f; uiText2.Width = StyleDimension.FromPixelsAndPercent(0.0f, 1f); uiText2.Height = StyleDimension.FromPixelsAndPercent(0.0f, 1f); uiText2.IsWrapped = true; uiText2.PaddingTop = (float)-num; uiText2.PaddingBottom = (float)-num; UIText uiText3 = uiText2; this._text1 = (UIElement)text3; this._text2 = (UIElement)uiText3; this.AddDynamicResize(container, text3); container.Append((UIElement)text3); container.Append((UIElement)uiText3); return(container); }
public UIDifficultyButton(Player player, LocalizedText title, LocalizedText description, byte difficulty, Color color) { _player = player; _difficulty = difficulty; Width = StyleDimension.FromPixels(44f); Height = StyleDimension.FromPixels(110f); _BasePanelTexture = Main.Assets.Request <Texture2D>("Images/UI/CharCreation/PanelGrayscale", Main.content, (AssetRequestMode)1); _selectedBorderTexture = Main.Assets.Request <Texture2D>("Images/UI/CharCreation/CategoryPanelHighlight", Main.content, (AssetRequestMode)1); _hoveredBorderTexture = Main.Assets.Request <Texture2D>("Images/UI/CharCreation/CategoryPanelBorder", Main.content, (AssetRequestMode)1); _color = color; UIText element = new UIText(title, 0.9f) { HAlign = 0.5f, VAlign = 0f, Width = StyleDimension.FromPixelsAndPercent(-10f, 1f), Top = StyleDimension.FromPixels(5f) }; Append(element); }
private void BuildPage() { int num = 18; RemoveAllChildren(); UIElement uIElement = new UIElement { Width = StyleDimension.FromPixels(500f), Height = StyleDimension.FromPixels(434f + (float)num), Top = StyleDimension.FromPixels(170f - (float)num), HAlign = 0.5f, VAlign = 0f }; uIElement.SetPadding(0f); Append(uIElement); UIPanel uIPanel = new UIPanel { Width = StyleDimension.FromPercent(1f), Height = StyleDimension.FromPixels(280 + num), Top = StyleDimension.FromPixels(50f), BackgroundColor = new Color(33, 43, 79) * 0.8f }; uIPanel.SetPadding(0f); uIElement.Append(uIPanel); MakeBackAndCreatebuttons(uIElement); UIElement uIElement2 = new UIElement { Top = StyleDimension.FromPixelsAndPercent(0f, 0f), Width = StyleDimension.FromPixelsAndPercent(0f, 1f), Height = StyleDimension.FromPixelsAndPercent(0f, 1f), HAlign = 1f }; uIElement2.SetPadding(0f); uIElement2.PaddingTop = 8f; uIElement2.PaddingBottom = 12f; uIPanel.Append(uIElement2); MakeInfoMenu(uIElement2); }
private void BuildPage() { int num = 18; this.RemoveAllChildren(); UIElement uiElement1 = new UIElement() { Width = StyleDimension.FromPixels(500f), Height = StyleDimension.FromPixels(434f + (float)num), Top = StyleDimension.FromPixels(170f - (float)num), HAlign = 0.5f, VAlign = 0.0f }; uiElement1.SetPadding(0.0f); this.Append(uiElement1); UIPanel uiPanel1 = new UIPanel(); uiPanel1.Width = StyleDimension.FromPercent(1f); uiPanel1.Height = StyleDimension.FromPixels((float)(280 + num)); uiPanel1.Top = StyleDimension.FromPixels(50f); uiPanel1.BackgroundColor = new Color(33, 43, 79) * 0.8f; UIPanel uiPanel2 = uiPanel1; uiPanel2.SetPadding(0.0f); uiElement1.Append((UIElement)uiPanel2); this.MakeBackAndCreatebuttons(uiElement1); UIElement uiElement2 = new UIElement() { Top = StyleDimension.FromPixelsAndPercent(0.0f, 0.0f), Width = StyleDimension.FromPixelsAndPercent(0.0f, 1f), Height = StyleDimension.FromPixelsAndPercent(0.0f, 1f), HAlign = 1f }; uiElement2.SetPadding(0.0f); uiElement2.PaddingTop = 8f; uiElement2.PaddingBottom = 12f; uiPanel2.Append(uiElement2); this.MakeInfoMenu(uiElement2); }