public void LoadDialogDropPanel(ParamValueDialog control, BfresShaderParam param)
        {
            ParamValueEditorBase panel = new ParamValueEditorBase();

            switch (param.Type)
            {
            case ShaderParamType.Float: panel = new vector1SliderPanel(param.ValueFloat, param); break;

            case ShaderParamType.Float2: panel = new vector2SliderPanel(param.ValueFloat, param); break;

            case ShaderParamType.Float3: panel = new vector3SliderPanel(param.Name, param.ValueFloat, param); break;

            case ShaderParamType.Float4: panel = new vector4SliderPanel(param.Name, param.ValueFloat, param); break;

            case ShaderParamType.Int: panel = new vector1SliderPanel(param.ValueInt, param); break;

            case ShaderParamType.Int2: panel = new vector2SliderPanel(param.ValueInt, param); break;

            case ShaderParamType.Int3: panel = new vector3SliderPanel(param.Name, param.ValueInt, param); break;

            case ShaderParamType.Int4: panel = new vector4SliderPanel(param.Name, param.ValueInt, param); break;

            case ShaderParamType.UInt: panel = new vector1SliderPanel(param.ValueUint, param); break;

            case ShaderParamType.UInt2: panel = new vector2SliderPanel(param.ValueUint, param); break;

            case ShaderParamType.UInt3: panel = new vector3SliderPanel(param.Name, param.ValueUint, param); break;

            case ShaderParamType.UInt4: panel = new vector4SliderPanel(param.Name, param.ValueUint, param); break;

            case ShaderParamType.TexSrt: panel = new TexSrtPanel(param.ValueTexSrt, param); break;

            case ShaderParamType.TexSrtEx: panel = new TexSrtPanel(param.ValueTexSrtEx, param); break;

            case ShaderParamType.Srt2D: panel = new TexSrtPanel2D(param.ValueSrt2D, param); break;

            case ShaderParamType.Bool: panel = new booleanPanel(param.ValueBool, param); break;

            case ShaderParamType.Bool2: panel = new booleanPanel(param.ValueBool, param); break;

            case ShaderParamType.Bool3: panel = new booleanPanel(param.ValueBool, param); break;

            case ShaderParamType.Bool4: panel = new booleanPanel(param.ValueBool, param); break;
            }
            control.Width     = panel.Width;
            control.Height    = panel.Height + 70;
            control.CanResize = false;
            control.BackColor = FormThemes.BaseTheme.DropdownPanelBackColor;
            control.AddControl(panel);
        }
Beispiel #2
0
        public void InitializeShaderParamList(FMAT mat)
        {
            material = mat;

            stFlowLayoutPanel1.SuspendLayout();
            stFlowLayoutPanel1.Controls.Clear();


            foreach (BfresShaderParam param in mat.matparam.Values)
            {
                if (param.Type == ShaderParamType.Bool ||
                    param.Type == ShaderParamType.Bool2 ||
                    param.Type == ShaderParamType.Bool3 ||
                    param.Type == ShaderParamType.Bool4)
                {
                    booleanPanel panel = new booleanPanel(param.ValueBool, param);
                    LoadDropPanel(panel, param);
                }
                if (param.Type == ShaderParamType.TexSrt)
                {
                    TexSrtPanel panel = new TexSrtPanel(param.ValueTexSrt, param);
                    LoadDropPanel(panel, param);
                }
                if (param.Type == ShaderParamType.Float)
                {
                    vector1SliderPanel panel = new vector1SliderPanel(param.ValueFloat, param);
                    LoadDropPanel(panel, param);
                }
                if (param.Type == ShaderParamType.Float2)
                {
                    vector2SliderPanel panel = new vector2SliderPanel(param.ValueFloat, param);
                    LoadDropPanel(panel, param);
                }
                if (param.Type == ShaderParamType.Float3)
                {
                    vector3SliderPanel panel = new vector3SliderPanel(param.Name, param.ValueFloat, param);
                    LoadDropPanel(panel, param);
                }
                if (param.Type == ShaderParamType.Float4)
                {
                    vector4SliderPanel panel = new vector4SliderPanel(param.Name, param.ValueFloat, param);
                    LoadDropPanel(panel, param);
                }
                if (param.Type == ShaderParamType.UInt)
                {
                    vector1SliderPanel panel = new vector1SliderPanel(param.ValueUint, param);
                    LoadDropPanel(panel, param);
                }
                if (param.Type == ShaderParamType.UInt2)
                {
                    vector2SliderPanel panel = new vector2SliderPanel(param.ValueUint, param);
                    LoadDropPanel(panel, param);
                }
                if (param.Type == ShaderParamType.UInt3)
                {
                    vector3SliderPanel panel = new vector3SliderPanel(param.Name, param.ValueUint, param);
                    LoadDropPanel(panel, param);
                }
                if (param.Type == ShaderParamType.UInt4)
                {
                    vector4SliderPanel panel = new vector4SliderPanel(param.Name, param.ValueUint, param);
                    LoadDropPanel(panel, param);
                }
                if (param.Type == ShaderParamType.Int)
                {
                    vector1SliderPanel panel = new vector1SliderPanel(param.ValueInt, param);
                    LoadDropPanel(panel, param);
                }
                if (param.Type == ShaderParamType.Int2)
                {
                    vector2SliderPanel panel = new vector2SliderPanel(param.ValueInt, param);
                    LoadDropPanel(panel, param);
                }
                if (param.Type == ShaderParamType.Int3)
                {
                    vector3SliderPanel panel = new vector3SliderPanel(param.Name, param.ValueInt, param);
                    LoadDropPanel(panel, param);
                }
                if (param.Type == ShaderParamType.Int4)
                {
                    vector4SliderPanel panel = new vector4SliderPanel(param.Name, param.ValueInt, param);
                    LoadDropPanel(panel, param);
                }
            }

            stFlowLayoutPanel1.ResumeLayout();
        }
Beispiel #3
0
        private void LoadDropDownPanel(BfresShaderParam param)
        {
            stFlowLayoutPanel1      = new STFlowLayoutPanel();
            stFlowLayoutPanel1.Dock = DockStyle.Fill;
            stFlowLayoutPanel1.SuspendLayout();

            if (param.Type == ShaderParamType.Bool ||
                param.Type == ShaderParamType.Bool2 ||
                param.Type == ShaderParamType.Bool3 ||
                param.Type == ShaderParamType.Bool4)
            {
                booleanPanel panel = new booleanPanel(param.ValueBool, param);
                LoadDropPanel(panel, param);
            }
            else if (param.Type == ShaderParamType.TexSrtEx)
            {
                TexSrtPanel panel = new TexSrtPanel(param.ValueTexSrtEx, param);
                LoadDropPanel(panel, param);
            }
            else if (param.Type == ShaderParamType.TexSrt)
            {
                TexSrtPanel panel = new TexSrtPanel(param.ValueTexSrt, param);
                LoadDropPanel(panel, param);
            }
            else if (param.Type == ShaderParamType.Float)
            {
                vector1SliderPanel panel = new vector1SliderPanel(param.ValueFloat, param);
                LoadDropPanel(panel, param);
            }
            else if (param.Type == ShaderParamType.Float2)
            {
                vector2SliderPanel panel = new vector2SliderPanel(param.ValueFloat, param);
                LoadDropPanel(panel, param);
            }
            else if (param.Type == ShaderParamType.Float3)
            {
                vector3SliderPanel panel = new vector3SliderPanel(param.Name, param.ValueFloat, param);
                LoadDropPanel(panel, param);
            }
            else if (param.Type == ShaderParamType.Float4)
            {
                vector4SliderPanel panel = new vector4SliderPanel(param.Name, param.ValueFloat, param);
                LoadDropPanel(panel, param);
            }
            else if (param.Type == ShaderParamType.UInt)
            {
                vector1SliderPanel panel = new vector1SliderPanel(param.ValueUint, param);
                LoadDropPanel(panel, param);
            }
            else if (param.Type == ShaderParamType.UInt2)
            {
                vector2SliderPanel panel = new vector2SliderPanel(param.ValueUint, param);
                LoadDropPanel(panel, param);
            }
            else if (param.Type == ShaderParamType.UInt3)
            {
                vector3SliderPanel panel = new vector3SliderPanel(param.Name, param.ValueUint, param);
                LoadDropPanel(panel, param);
            }
            else if (param.Type == ShaderParamType.UInt4)
            {
                vector4SliderPanel panel = new vector4SliderPanel(param.Name, param.ValueUint, param);
                LoadDropPanel(panel, param);
            }
            else if (param.Type == ShaderParamType.Int)
            {
                vector1SliderPanel panel = new vector1SliderPanel(param.ValueInt, param);
                LoadDropPanel(panel, param);
            }
            else if (param.Type == ShaderParamType.Int2)
            {
                vector2SliderPanel panel = new vector2SliderPanel(param.ValueInt, param);
                LoadDropPanel(panel, param);
            }
            else if (param.Type == ShaderParamType.Int3)
            {
                vector3SliderPanel panel = new vector3SliderPanel(param.Name, param.ValueInt, param);
                LoadDropPanel(panel, param);
            }
            else if (param.Type == ShaderParamType.Int4)
            {
                vector4SliderPanel panel = new vector4SliderPanel(param.Name, param.ValueInt, param);
                LoadDropPanel(panel, param);
            }

            stFlowLayoutPanel1.ResumeLayout();
        }