private void BuildInfinitesMenuContents(UIElement totalContainer)
        {
            UIPanel basicPanel = UICreativeInfiniteItemsDisplay.CreateBasicPanel();

            totalContainer.Append((UIElement)basicPanel);
            basicPanel.OnUpdate    += new UIElement.ElementEvent(this.Hover_OnUpdate);
            basicPanel.OnMouseOver += new UIElement.MouseEvent(this.Hover_OnMouseOver);
            basicPanel.OnMouseOut  += new UIElement.MouseEvent(this.Hover_OnMouseOut);
            UIDynamicItemCollection dynamicItemCollection = new UIDynamicItemCollection();

            this._itemGrid = dynamicItemCollection;
            UIElement uiElement = new UIElement()
            {
                Height = new StyleDimension(24f, 0.0f),
                Width  = new StyleDimension(0.0f, 1f)
            };

            uiElement.SetPadding(0.0f);
            basicPanel.Append(uiElement);
            this.AddSearchBar(uiElement);
            this._searchBar.SetContents((string)null, true);
            UIList uiList1 = new UIList();

            uiList1.Width  = new StyleDimension(-25f, 1f);
            uiList1.Height = new StyleDimension(-28f, 1f);
            uiList1.VAlign = 1f;
            uiList1.HAlign = 0.0f;
            UIList uiList2 = uiList1;

            basicPanel.Append((UIElement)uiList2);
            float       num         = 4f;
            UIScrollbar uiScrollbar = new UIScrollbar();

            uiScrollbar.Height = new StyleDimension((float)(-28.0 - (double)num * 2.0), 1f);
            uiScrollbar.Top    = new StyleDimension(-num, 0.0f);
            uiScrollbar.VAlign = 1f;
            uiScrollbar.HAlign = 1f;
            UIScrollbar scrollbar = uiScrollbar;

            basicPanel.Append((UIElement)scrollbar);
            uiList2.SetScrollbar(scrollbar);
            uiList2.Add((UIElement)dynamicItemCollection);
            UICreativeItemsInfiniteFilteringOptions filteringOptions = new UICreativeItemsInfiniteFilteringOptions(this._filterer, "CreativeInfinitesFilter");

            filteringOptions.OnClickingOption += new Action(this.filtersHelper_OnClickingOption);
            filteringOptions.Left              = new StyleDimension(20f, 0.0f);
            totalContainer.Append((UIElement)filteringOptions);
            filteringOptions.OnUpdate    += new UIElement.ElementEvent(this.Hover_OnUpdate);
            filteringOptions.OnMouseOver += new UIElement.MouseEvent(this.Hover_OnMouseOver);
            filteringOptions.OnMouseOut  += new UIElement.MouseEvent(this.Hover_OnMouseOut);
        }
        private void BuildSacrificeMenuContents(UIElement totalContainer)
        {
            UIPanel basicPanel = UICreativeInfiniteItemsDisplay.CreateBasicPanel();

            basicPanel.VAlign = 0.5f;
            basicPanel.Height = new StyleDimension(170f, 0.0f);
            basicPanel.Width  = new StyleDimension(170f, 0.0f);
            basicPanel.Top    = new StyleDimension();
            totalContainer.Append((UIElement)basicPanel);
            basicPanel.OnUpdate    += new UIElement.ElementEvent(this.Hover_OnUpdate);
            basicPanel.OnMouseOver += new UIElement.MouseEvent(this.Hover_OnMouseOver);
            basicPanel.OnMouseOut  += new UIElement.MouseEvent(this.Hover_OnMouseOut);
            this.AddCogsForSacrificeMenu((UIElement)basicPanel);
            this._pistonParticleAsset = (Asset <Texture2D>)Main.Assets.Request <Texture2D>("Images/UI/Creative/Research_Spark", (AssetRequestMode)1);
            float   pixels   = 0.0f;
            UIImage uiImage1 = new UIImage((Asset <Texture2D>)Main.Assets.Request <Texture2D>("Images/UI/Creative/Research_Slots", (AssetRequestMode)1));

            uiImage1.HAlign = 0.5f;
            uiImage1.VAlign = 0.5f;
            uiImage1.Top    = new StyleDimension(-20f, 0.0f);
            uiImage1.Left   = new StyleDimension(pixels, 0.0f);
            UIImage uiImage2 = uiImage1;

            basicPanel.Append((UIElement)uiImage2);
            Asset <M0>    asset          = Main.Assets.Request <Texture2D>("Images/UI/Creative/Research_FramedPistons", (AssetRequestMode)1);
            UIImageFramed uiImageFramed1 = new UIImageFramed((Asset <Texture2D>)asset, ((Asset <Texture2D>)asset).Frame(1, 9, 0, 0, 0, 0));

            uiImageFramed1.HAlign = 0.5f;
            uiImageFramed1.VAlign = 0.5f;
            uiImageFramed1.Top    = new StyleDimension(-20f, 0.0f);
            uiImageFramed1.Left   = new StyleDimension(pixels, 0.0f);
            uiImageFramed1.IgnoresMouseInteraction = true;
            UIImageFramed uiImageFramed2 = uiImageFramed1;

            basicPanel.Append((UIElement)uiImageFramed2);
            this._sacrificePistons = uiImageFramed2;
            UIParticleLayer uiParticleLayer = new UIParticleLayer();

            uiParticleLayer.Width  = new StyleDimension(0.0f, 1f);
            uiParticleLayer.Height = new StyleDimension(0.0f, 1f);
            uiParticleLayer.AnchorPositionOffsetByPercents = Vector2.One / 2f;
            uiParticleLayer.AnchorPositionOffsetByPixels   = Vector2.Zero;
            this._pistonParticleSystem = uiParticleLayer;
            uiImageFramed2.Append((UIElement)this._pistonParticleSystem);
            UIElement element = Main.CreativeMenu.ProvideItemSlotElement(0);

            element.HAlign = 0.5f;
            element.VAlign = 0.5f;
            element.Top    = new StyleDimension(-15f, 0.0f);
            element.Left   = new StyleDimension(pixels, 0.0f);
            element.SetSnapPoint("CreativeSacrificeSlot", 0, new Vector2?(), new Vector2?());
            uiImage2.Append(element);
            UIText uiText1 = new UIText("(0/50)", 0.8f, false);

            uiText1.Top    = new StyleDimension(10f, 0.0f);
            uiText1.Left   = new StyleDimension(pixels, 0.0f);
            uiText1.HAlign = 0.5f;
            uiText1.VAlign = 0.5f;
            uiText1.IgnoresMouseInteraction = true;
            UIText uiText2 = uiText1;

            uiText2.OnUpdate += new UIElement.ElementEvent(this.descriptionText_OnUpdate);
            basicPanel.Append((UIElement)uiText2);
            UIPanel uiPanel1 = new UIPanel();

            uiPanel1.Top    = new StyleDimension(0.0f, 0.0f);
            uiPanel1.Left   = new StyleDimension(pixels, 0.0f);
            uiPanel1.HAlign = 0.5f;
            uiPanel1.VAlign = 1f;
            uiPanel1.Width  = new StyleDimension(124f, 0.0f);
            uiPanel1.Height = new StyleDimension(30f, 0.0f);
            UIPanel uiPanel2 = uiPanel1;
            UIText  uiText3  = new UIText(Language.GetText("CreativePowers.ConfirmInfiniteItemSacrifice"), 0.8f, false);

            uiText3.IgnoresMouseInteraction = true;
            uiText3.HAlign = 0.5f;
            uiText3.VAlign = 0.5f;
            UIText uiText4 = uiText3;

            uiPanel2.Append((UIElement)uiText4);
            uiPanel2.SetSnapPoint("CreativeSacrificeConfirm", 0, new Vector2?(), new Vector2?());
            uiPanel2.OnClick     += new UIElement.MouseEvent(this.sacrificeButton_OnClick);
            uiPanel2.OnMouseOver += new UIElement.MouseEvent(this.FadedMouseOver);
            uiPanel2.OnMouseOut  += new UIElement.MouseEvent(this.FadedMouseOut);
            uiPanel2.OnUpdate    += new UIElement.ElementEvent(this.research_OnUpdate);
            basicPanel.Append((UIElement)uiPanel2);
            basicPanel.OnUpdate += new UIElement.ElementEvent(this.sacrificeWindow_OnUpdate);
        }