示例#1
0
        public override void OnInitialize()
        {
            mainPanel = new UIPanel();
            mainPanel.SetPadding(6);
            int width  = 350;
            int height = 840;

            mainPanel.Left.Set(-40f - width, 1f);
            mainPanel.Top.Set(-110f - height, 1f);
            mainPanel.Width.Set(width, 0f);
            mainPanel.Height.Set(height, 0f);
            mainPanel.BackgroundColor = new Color(173, 94, 171);

            int playgroundPanelWidth  = 400;
            int playgroundPanelHeight = 150;

            playgroundPanel = new DebugDrawUIPanel();
            playgroundPanel.SetPadding(0);
            playgroundPanel.Left.Set(0, .15f);
            playgroundPanel.Top.Set(0, .5f);
            playgroundPanel.Width.Set(playgroundPanelWidth, 0f);
            playgroundPanel.Height.Set(playgroundPanelHeight, 0f);
            playgroundPanel.BackgroundColor = new Color(108, 226, 108);
            Append(playgroundPanel);

            playgroundText        = new UIText("Example UIText");
            playgroundTextPanel   = new UITextPanel <string>("Example UITextPanel");
            playgroundImageButton = new UIImageButton(TextureAssets.InventoryBack10);

            // checkboxes
            int       top    = 0;
            int       indent = 0;
            UIElement uiRange;

            UIText text = new UIText("UIPlayground UI:", 0.85f);

            //text.Top.Set(12f, 0f);
            //text.Left.Set(12f, 0f);
            mainPanel.Append(text);
            top += 20;

            panelPaddingData = new UIIntRangedDataValue("Panel Padding:", 0, 0, 12);
            uiRange          = new UIRange <int>(panelPaddingData);
            panelPaddingData.OnValueChanged += () => UpdatePlaygroundChildren();
            uiRange.Top.Set(top, 0f);
            uiRange.Width.Set(0, 1f);
            uiRange.Left.Set(indent, 0);
            mainPanel.Append(uiRange);
            top += 20;

            drawInnerDimensionsCheckbox           = new UICheckbox("Draw Inner Dimensions", "Inner Dimensions takes into account Padding of the current UIElement");
            drawInnerDimensionsCheckbox.TextColor = Color.Blue;
            drawInnerDimensionsCheckbox.Top.Set(top, 0f);
            drawInnerDimensionsCheckbox.Left.Set(indent, 0f);
            mainPanel.Append(drawInnerDimensionsCheckbox);
            top += 20;

            drawDimensionsCheckbox           = new UICheckbox("Draw Dimensions", "");
            drawDimensionsCheckbox.TextColor = Color.Pink;
            drawDimensionsCheckbox.Top.Set(top, 0f);
            drawDimensionsCheckbox.Left.Set(indent, 0f);
            mainPanel.Append(drawDimensionsCheckbox);
            top += 20;

            drawOuterDimensionsCheckbox           = new UICheckbox("Draw Outer Dimensions", "Outer Dimensions takes into account Margin of the current UIElement");
            drawOuterDimensionsCheckbox.TextColor = Color.Yellow;
            drawOuterDimensionsCheckbox.Top.Set(top, 0f);
            drawOuterDimensionsCheckbox.Left.Set(indent, 0f);
            mainPanel.Append(drawOuterDimensionsCheckbox);
            top += 20;

            top += 8;             // additional spacing
            playgroundTextCheckbox = new UICheckbox("UIText", "Show UIText");
            playgroundTextCheckbox.Top.Set(top, 0f);
            playgroundTextCheckbox.Left.Set(indent, 0f);
            playgroundTextCheckbox.OnSelectedChanged += () => UpdatePlaygroundChildren();
            mainPanel.Append(playgroundTextCheckbox);
            top += 20;

            indent = 18;

            textHAlign      = new UIFloatRangedDataValue("HAlign:", 0, 0, 1);
            textVAlign      = new UIFloatRangedDataValue("VAlign:", 0, 0, 1);
            textLeftPixels  = new UIFloatRangedDataValue("LeftPixels:", 0, 0, playgroundPanelWidth);
            textLeftPercent = new UIFloatRangedDataValue("LeftPercent:", 0, 0, 1);
            textTopPixels   = new UIFloatRangedDataValue("TopPixels:", 0, 0, playgroundPanelHeight);
            textTopPercent  = new UIFloatRangedDataValue("TopPercent:", 0, 0, 1);
            AppendRange(ref top, indent, textHAlign);
            AppendRange(ref top, indent, textVAlign);
            AppendRange(ref top, indent, textLeftPixels);
            AppendRange(ref top, indent, textLeftPercent);
            AppendRange(ref top, indent, textTopPixels);
            AppendRange(ref top, indent, textTopPercent);
            textHAlign.OnValueChanged      += () => UpdatePlaygroundChildren();
            textVAlign.OnValueChanged      += () => UpdatePlaygroundChildren();
            textLeftPixels.OnValueChanged  += () => UpdatePlaygroundChildren();
            textLeftPercent.OnValueChanged += () => UpdatePlaygroundChildren();
            textTopPixels.OnValueChanged   += () => UpdatePlaygroundChildren();
            textTopPercent.OnValueChanged  += () => UpdatePlaygroundChildren();

            indent = 0;

            top += 8;             // additional spacing
            playgroundTextPanelCheckbox = new UICheckbox("UITextPanel", "Show UITextPanel");
            playgroundTextPanelCheckbox.Top.Set(top, 0f);
            playgroundTextPanelCheckbox.Left.Set(indent, 0f);
            playgroundTextPanelCheckbox.OnSelectedChanged += () => UpdatePlaygroundChildren();
            mainPanel.Append(playgroundTextPanelCheckbox);
            top += 20;

            textPanelTextInput = new NewUITextBox("UITextPanel Text Here", 0.85f);
            textPanelTextInput.SetText(playgroundTextPanel.Text);
            //textPanelTextInput.SetPadding(0);
            textPanelTextInput.Top.Set(top, 0f);
            textPanelTextInput.Left.Set(indent, 0f);
            textPanelTextInput.Width.Set(-indent, 1f);
            mainPanel.Append(textPanelTextInput);
            textPanelTextInput.OnTextChanged += () =>             // order matters
            {
                //if (mainPanel.Parent != null) //
                UpdatePlaygroundChildren();                 // playgroundTextPanel.SetText(textPanelTextInput.Text, textPanelTextScale.Data, false);
            };
            top += 20;

            textPanelTextScale     = new UIFloatRangedDataValue("TextScale:", playgroundTextPanel.TextScale, .2f, 3f);
            textPanelPadding       = new UIFloatRangedDataValue("Padding:", playgroundTextPanel.PaddingBottom, 0, 12);
            textPanelHAlign        = new UIFloatRangedDataValue("HAlign:", 0, 0, 1);
            textPanelVAlign        = new UIFloatRangedDataValue("VAlign:", 0, 0, 1);
            textPanelLeftPixels    = new UIFloatRangedDataValue("LeftPixels:", 0, 0, playgroundPanelWidth);
            textPanelLeftPercent   = new UIFloatRangedDataValue("LeftPercent:", 0, 0, 1);
            textPanelTopPixels     = new UIFloatRangedDataValue("TopPixels:", 0, 0, playgroundPanelHeight);
            textPanelTopPercent    = new UIFloatRangedDataValue("TopPercent:", 0, 0, 1);
            textPanelWidthPixels   = new UIFloatRangedDataValue("WidthPixels:", playgroundTextPanel.Width.Pixels, 0, playgroundPanelWidth);
            textPanelWidthPercent  = new UIFloatRangedDataValue("WidthPercent:", playgroundTextPanel.Width.Precent, 0, 1);
            textPanelHeightPixels  = new UIFloatRangedDataValue("HeightPixels:", playgroundTextPanel.Height.Pixels, 0, playgroundPanelHeight);
            textPanelHeightPercent = new UIFloatRangedDataValue("HeightPercent:", playgroundTextPanel.Height.Precent, 0, 1);
            //textPanelMinWidthPixels = new UIFloatRangedDataValue("MinWidthPixels:", playgroundTextPanel.MinWidth.Pixels, 0, playgroundPanelWidth);
            //textPanelMinWidthPercent = new UIFloatRangedDataValue("MinWidthPercent:", playgroundTextPanel.MinWidth.Precent, 0, 1);
            //textPanelMinHeightPixels = new UIFloatRangedDataValue("MinHeightPixels:", playgroundTextPanel.MinHeight.Pixels, 0, playgroundPanelHeight);
            //textPanelMinHeightPercent = new UIFloatRangedDataValue("MinHeightPercent:", playgroundTextPanel.MinHeight.Precent, 0, 1);
            AppendRange(ref top, indent, textPanelTextScale);
            AppendRange(ref top, indent, textPanelPadding);
            AppendRange(ref top, indent, textPanelHAlign);
            AppendRange(ref top, indent, textPanelVAlign);
            AppendRange(ref top, indent, textPanelLeftPixels);
            AppendRange(ref top, indent, textPanelLeftPercent);
            AppendRange(ref top, indent, textPanelTopPixels);
            AppendRange(ref top, indent, textPanelTopPercent);
            AppendRange(ref top, indent, textPanelWidthPixels);
            AppendRange(ref top, indent, textPanelWidthPercent);
            AppendRange(ref top, indent, textPanelHeightPixels);
            AppendRange(ref top, indent, textPanelHeightPercent);
            //AppendRange(ref top, indent, textPanelMinWidthPixels);
            //AppendRange(ref top, indent, textPanelMinWidthPercent);
            //AppendRange(ref top, indent, textPanelMinHeightPixels);
            //AppendRange(ref top, indent, textPanelMinHeightPercent);
            textPanelTextScale.OnValueChanged     += () => UpdatePlaygroundChildren();
            textPanelPadding.OnValueChanged       += () => UpdatePlaygroundChildren();
            textPanelHAlign.OnValueChanged        += () => UpdatePlaygroundChildren();
            textPanelVAlign.OnValueChanged        += () => UpdatePlaygroundChildren();
            textPanelLeftPixels.OnValueChanged    += () => UpdatePlaygroundChildren();
            textPanelLeftPercent.OnValueChanged   += () => UpdatePlaygroundChildren();
            textPanelTopPixels.OnValueChanged     += () => UpdatePlaygroundChildren();
            textPanelTopPercent.OnValueChanged    += () => UpdatePlaygroundChildren();
            textPanelWidthPixels.OnValueChanged   += () => UpdatePlaygroundChildren();
            textPanelWidthPercent.OnValueChanged  += () => UpdatePlaygroundChildren();
            textPanelHeightPixels.OnValueChanged  += () => UpdatePlaygroundChildren();
            textPanelHeightPercent.OnValueChanged += () => UpdatePlaygroundChildren();
            //textPanelMinWidthPixels.OnValueChanged += () => UpdatePlaygroundChildren();
            //textPanelMinWidthPercent.OnValueChanged += () => UpdatePlaygroundChildren();
            //textPanelMinHeightPixels.OnValueChanged += () => UpdatePlaygroundChildren();
            //textPanelMinHeightPercent.OnValueChanged += () => UpdatePlaygroundChildren();

            textPanelMinWidthHeightDisplay = new UIText("", 0.85f);
            textPanelMinWidthHeightDisplay.Top.Set(top, 0f);
            textPanelMinWidthHeightDisplay.Width.Set(-indent, 1f);
            textPanelMinWidthHeightDisplay.Left.Set(indent, 0);
            mainPanel.Append(textPanelMinWidthHeightDisplay);
            top += 20;

            indent = 0;

            top += 8;             // additional spacing
            playgroundImageButtonCheckbox = new UICheckbox("UIImageButton", "Show UIImageButton");
            playgroundImageButtonCheckbox.Top.Set(top, 0f);
            playgroundImageButtonCheckbox.Left.Set(indent, 0f);
            playgroundImageButtonCheckbox.OnSelectedChanged += () => UpdatePlaygroundChildren();
            mainPanel.Append(playgroundImageButtonCheckbox);
            top += 20;

            indent = 18;

            imageButtonHAlign      = new UIFloatRangedDataValue("HAlign:", 0, 0, 1);
            imageButtonVAlign      = new UIFloatRangedDataValue("VAlign:", 0, 0, 1);
            imageButtonLeftPixels  = new UIFloatRangedDataValue("LeftPixels:", 0, 0, playgroundPanelWidth);
            imageButtonLeftPercent = new UIFloatRangedDataValue("LeftPercent:", 0, 0, 1);
            imageButtonTopPixels   = new UIFloatRangedDataValue("TopPixels:", 0, 0, playgroundPanelHeight);
            imageButtonTopPercent  = new UIFloatRangedDataValue("TopPercent:", 0, 0, 1);
            AppendRange(ref top, indent, imageButtonHAlign);
            AppendRange(ref top, indent, imageButtonVAlign);
            AppendRange(ref top, indent, imageButtonLeftPixels);
            AppendRange(ref top, indent, imageButtonLeftPercent);
            AppendRange(ref top, indent, imageButtonTopPixels);
            AppendRange(ref top, indent, imageButtonTopPercent);
            imageButtonHAlign.OnValueChanged      += () => UpdatePlaygroundChildren();
            imageButtonVAlign.OnValueChanged      += () => UpdatePlaygroundChildren();
            imageButtonLeftPixels.OnValueChanged  += () => UpdatePlaygroundChildren();
            imageButtonLeftPercent.OnValueChanged += () => UpdatePlaygroundChildren();
            imageButtonTopPixels.OnValueChanged   += () => UpdatePlaygroundChildren();
            imageButtonTopPercent.OnValueChanged  += () => UpdatePlaygroundChildren();

            text = new UIText("UIPlayground UI Extra:", 0.85f);
            mainPanel.Append(text);
            top += 20;

            drawAllDimensionsCheckbox = new UICheckbox("Draw All UIElement Dimensions", "This will draw outer dimensions for Elements in your mod.");
            drawAllDimensionsCheckbox.Top.Set(top, 0f);
            //drawAllDimensionsCheckbox.Left.Set(indent, 0f);
            mainPanel.Append(drawAllDimensionsCheckbox);
            top += 20;

            colorDataProperty = new ColorDataRangeProperty("Color:");
            colorDataProperty.range.Top.Set(top, 0f);
            mainPanel.Append(colorDataProperty.range);
            top += 20;

            drawAllDimensionsDepthData = new UIIntRangedDataValue("Draw All Depth:", -1, -1, 10);
            uiRange = new UIRange <int>(drawAllDimensionsDepthData);
            //drawAllDimensionsDepthData.OnValueChanged += () => UpdatePlaygroundChildren();
            uiRange.Top.Set(top, 0f);
            uiRange.Width.Set(0, 1f);
            //uiRange.Left.Set(indent, 0);
            mainPanel.Append(uiRange);
            top += 30;

            drawAllParallaxCheckbox = new UICheckbox("Draw with Parallax", "This will offset UIElements to help visualize their hierarchy");
            drawAllParallaxCheckbox.Top.Set(top, 0f);
            //drawAllParallaxCheckbox.Left.Set(indent, 0f);
            mainPanel.Append(drawAllParallaxCheckbox);

            parallaxXProperty = new UIFloatRangedDataValue("ParallaxX:", 0, -10, 10);
            parallaxYProperty = new UIFloatRangedDataValue("ParallaxY:", 0, -10, 10);
            var ui2DRange = new UI2DRange <float>(parallaxXProperty, parallaxYProperty);

            ui2DRange.Top.Set(top, 0f);
            ui2DRange.Left.Set(200, 0f);
            mainPanel.Append(ui2DRange);
            top += 30;

            Append(mainPanel);
        }
示例#2
0
        public override void OnInitialize()
        {
            base.OnInitialize();
            mainPanel = new UIPanel();
            width     = 310;
            height    = 610;
            mainPanel.SetPadding(6);
            mainPanel.BackgroundColor = Color.Orange * 0.7f;

            int    top  = 0;
            UIText text = new UIText("Projectiles:", 0.85f);

            text.Top.Set(top, 0f);
            mainPanel.Append(text);

            UITextPanel <string> clearProjectilesButton = new UITextPanel <string>("Clear Projectiles");

            clearProjectilesButton.OnClick += (a, b) => {
                for (int i = 0; i < Main.maxProjectiles; i++)
                {
                    if (Main.projectile[i].active)
                    {
                        Main.projectile[i].Kill();
                        if (Main.netMode == 1)
                        {
                            NetMessage.SendData(27, -1, -1, null, i, 0f, 0f, 0f, 0);
                        }
                    }
                }
            };
            clearProjectilesButton.Top.Set(top, 0f);
            clearProjectilesButton.Width.Set(-10, 0.5f);
            clearProjectilesButton.HAlign = 1;
            clearProjectilesButton.SetPadding(4);
            mainPanel.Append(clearProjectilesButton);

            top += 20;

            UIText text2 = new UIText("Filter:", 0.85f);

            text2.Top.Set(top, 0f);
            mainPanel.Append(text2);

            searchFilter = new NewUITextBox("Search", 0.85f);
            searchFilter.SetPadding(0);
            searchFilter.OnTextChanged += () => { ValidateInput(); updateNeeded = true; };
            searchFilter.Top.Set(top, 0f);
            searchFilter.Left.Set(text2.GetInnerDimensions().Width, 0f);
            searchFilter.Width.Set(-text2.GetInnerDimensions().Width, 1f);
            searchFilter.Height.Set(20, 0f);
            //searchFilter.VAlign = 0.5f;
            mainPanel.Append(searchFilter);
            top += 20;

            speedXDataProperty = new UIFloatRangedDataValue("SpeedX:", 0, -10, 10);
            speedYDataProperty = new UIFloatRangedDataValue("SpeedY:", 0, -10, 10);
            var ui2DRange = new UI2DRange <float>(speedXDataProperty, speedYDataProperty);

            ui2DRange.Top.Set(top, 0f);
            mainPanel.Append(ui2DRange);
            top += 30;

            ai0DataProperty = new UIFloatRangedDataValue("ai0:", 0, -10, 10);
            var uiRange = new UIRange <float>(ai0DataProperty);

            uiRange.Top.Set(top, 0f);
            uiRange.Width.Set(0, 1f);
            mainPanel.Append(uiRange);
            top += 30;

            ai1DataProperty = new UIFloatRangedDataValue("ai1:", 0, -10, 10);
            uiRange         = new UIRange <float>(ai1DataProperty);
            uiRange.Top.Set(top, 0f);
            uiRange.Width.Set(0, 1f);
            mainPanel.Append(uiRange);
            top += 30;

            knockbackDataProperty = new UIFloatRangedDataValue("Knockback:", 0, 0, 20);
            uiRange = new UIRange <float>(knockbackDataProperty);
            uiRange.Top.Set(top, 0f);
            uiRange.Width.Set(0, 1f);
            mainPanel.Append(uiRange);
            top += 30;

            damageDataProperty = new UIIntRangedDataValue("Damage:", 20, 0, 200);
            var uiRangeI = new UIRange <int>(damageDataProperty);

            uiRangeI.Top.Set(top, 0f);
            uiRangeI.Width.Set(0, 1f);
            mainPanel.Append(uiRangeI);
            top += 30;

            aiStyleDataProperty = new UIIntRangedDataValue("AIStyle:", -1, -1, 145);
            uiRangeI            = new UIRange <int>(aiStyleDataProperty);
            uiRangeI.Top.Set(top, 0f);
            uiRangeI.Width.Set(0, 1f);
            mainPanel.Append(uiRangeI);
            top += 30;

            drawOffsetXDataProperty = new UIIntRangedDataValue("drawOffsetX:", 0, -30, 30);
            uiRangeI = new UIRange <int>(drawOffsetXDataProperty);
            uiRangeI.Top.Set(top, 0f);
            uiRangeI.Width.Set(0, 1f);
            mainPanel.Append(uiRangeI);
            top += 30;

            drawOriginOffsetXDataProperty = new UIIntRangedDataValue("drawOriginOffsetX:", 0, -30, 30);
            uiRangeI = new UIRange <int>(drawOriginOffsetXDataProperty);
            uiRangeI.Top.Set(top, 0f);
            uiRangeI.Width.Set(0, 1f);
            mainPanel.Append(uiRangeI);
            top += 30;

            drawOriginOffsetYDataProperty = new UIIntRangedDataValue("drawOriginOffsetY:", 0, -30, 30);
            uiRangeI = new UIRange <int>(drawOriginOffsetYDataProperty);
            uiRangeI.Top.Set(top, 0f);
            uiRangeI.Width.Set(0, 1f);
            mainPanel.Append(uiRangeI);
            top += 30;

            hostile = new UIBoolNDataValue("Hostile");
            var hostileCheckbox = new UITriStateCheckbox(hostile);

            hostileCheckbox.Top.Set(top, 0f);
            mainPanel.Append(hostileCheckbox);
            top += 30;

            friendly = new UIBoolNDataValue("Friendly");
            var friendlyCheckbox = new UITriStateCheckbox(friendly);

            friendlyCheckbox.Top.Set(top, 0f);
            mainPanel.Append(friendlyCheckbox);
            top += 25;

            pause = new UICheckbox("Pause", "Pauses All Projectiles (Prevent AI from running)");
            pause.Top.Set(top, 0f);
            mainPanel.Append(pause);

            UIHoverImageButton stepButton = new UIHoverImageButton(ModdersToolkit.Instance.GetTexture("UIElements/next"), "Step");

            stepButton.OnClick += (s, e) => step = true;
            stepButton.Top.Set(top - 6, 0f);
            stepButton.Left.Set(80, 0f);
            mainPanel.Append(stepButton);

            top += 25;

            freeze = new UICheckbox("Freeze", "Zero out velocity during PreAI for All Projectiles");
            freeze.Top.Set(top, 0f);
            mainPanel.Append(freeze);
            top += 25;

            projectileGrid            = new UIGrid(7);
            projectileGrid.Top.Pixels = top;
            //autoTrashGrid.Left.Pixels = spacing;
            projectileGrid.Width.Set(-25f, 1f);             // leave space for scroll?
            projectileGrid.Height.Set(-top, 1f);
            projectileGrid.ListPadding = 6f;
            mainPanel.Append(projectileGrid);

            // this will initialize grid
            updateNeeded = true;

            var projectileGridScrollbar = new UIElements.FixedUIScrollbar(_userInterface);

            projectileGridScrollbar.SetView(100f, 1000f);
            projectileGridScrollbar.Top.Pixels = top;            // + spacing;
            projectileGridScrollbar.Height.Set(-top /*- spacing*/, 1f);
            projectileGridScrollbar.HAlign = 1f;
            mainPanel.Append(projectileGridScrollbar);
            projectileGrid.SetScrollbar(projectileGridScrollbar);

            AdjustMainPanelDimensions(mainPanel);
            Append(mainPanel);
        }
示例#3
0
        public override void OnInitialize()
        {
            mainPanel = new UIPanel();
            mainPanel.Left.Set(-350f, 1f);
            mainPanel.Top.Set(-620f, 1f);
            mainPanel.Width.Set(310f, 0f);
            mainPanel.Height.Set(520f, 0f);
            mainPanel.SetPadding(12);
            mainPanel.BackgroundColor = Color.Orange * 0.7f;

            int    top  = 0;
            UIText text = new UIText("Projectiles:", 0.85f);

            text.Top.Set(top, 0f);
            mainPanel.Append(text);
            top += 20;

            UIText text2 = new UIText("Filter:", 0.85f);

            text2.Top.Set(top, 0f);
            mainPanel.Append(text2);

            searchFilter = new NewUITextBox("Search", 0.85f);
            searchFilter.SetPadding(0);
            searchFilter.OnTextChanged += () => { ValidateInput(); updateneeded = true; };
            searchFilter.Top.Set(top, 0f);
            searchFilter.Left.Set(text2.GetInnerDimensions().Width, 0f);
            searchFilter.Width.Set(0, 1f);
            searchFilter.Height.Set(20, 0f);
            //searchFilter.VAlign = 0.5f;
            mainPanel.Append(searchFilter);
            top += 20;

            speedXDataProperty = new UIFloatRangedDataValue("SpeedX:", 0, -10, 10);
            speedYDataProperty = new UIFloatRangedDataValue("SpeedY:", 0, -10, 10);
            var ui2DRange = new UI2DRange <float>(speedXDataProperty, speedYDataProperty);

            ui2DRange.Top.Set(top, 0f);
            mainPanel.Append(ui2DRange);
            top += 30;

            ai0DataProperty = new UIFloatRangedDataValue("ai0:", 0, -10, 10);
            var uiRange = new UIRange <float>(ai0DataProperty);

            uiRange.Top.Set(top, 0f);
            uiRange.Width.Set(0, 1f);
            mainPanel.Append(uiRange);
            top += 30;

            ai1DataProperty = new UIFloatRangedDataValue("ai1:", 0, -10, 10);
            uiRange         = new UIRange <float>(ai1DataProperty);
            uiRange.Top.Set(top, 0f);
            uiRange.Width.Set(0, 1f);
            mainPanel.Append(uiRange);
            top += 30;

            knockbackDataProperty = new UIFloatRangedDataValue("Knockback:", 0, 0, 20);
            uiRange = new UIRange <float>(knockbackDataProperty);
            uiRange.Top.Set(top, 0f);
            uiRange.Width.Set(0, 1f);
            mainPanel.Append(uiRange);
            top += 30;

            damageDataProperty = new UIIntRangedDataValue("Damage:", 20, 0, 200);
            var uiRangeI = new UIRange <int>(damageDataProperty);

            uiRangeI.Top.Set(top, 0f);
            uiRangeI.Width.Set(0, 1f);
            mainPanel.Append(uiRangeI);
            top += 30;

            aiStyleDataProperty = new UIIntRangedDataValue("AIStyle:", -1, -1, 145);
            uiRangeI            = new UIRange <int>(aiStyleDataProperty);
            uiRangeI.Top.Set(top, 0f);
            uiRangeI.Width.Set(0, 1f);
            mainPanel.Append(uiRangeI);
            top += 30;

            hostile = new UIBoolNDataValue("Hostile");
            var hostileCheckbox = new UITriStateCheckbox(hostile);

            hostileCheckbox.Top.Set(top, 0f);
            mainPanel.Append(hostileCheckbox);
            top += 30;

            friendly = new UIBoolNDataValue("Friendly");
            var friendlyCheckbox = new UITriStateCheckbox(friendly);

            friendlyCheckbox.Top.Set(top, 0f);
            mainPanel.Append(friendlyCheckbox);
            top += 30;

            projectileGrid            = new UIGrid(7);
            projectileGrid.Top.Pixels = top;
            //autoTrashGrid.Left.Pixels = spacing;
            projectileGrid.Width.Set(-25f, 1f);             // leave space for scroll?
            projectileGrid.Height.Set(-top, 1f);
            projectileGrid.ListPadding = 6f;
            mainPanel.Append(projectileGrid);

            // this will initialize grid
            updateneeded = true;

            var projectileGridScrollbar = new UIElements.FixedUIScrollbar(userInterface);

            projectileGridScrollbar.SetView(100f, 1000f);
            projectileGridScrollbar.Top.Pixels = top;            // + spacing;
            projectileGridScrollbar.Height.Set(-top /*- spacing*/, 1f);
            projectileGridScrollbar.HAlign = 1f;
            mainPanel.Append(projectileGridScrollbar);
            projectileGrid.SetScrollbar(projectileGridScrollbar);

            Append(mainPanel);
        }