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); }
private void shaderParamListView_DoubleClick(object sender, EventArgs e) { if (shaderParamListView.SelectedItems.Count > 0) { var currentItem = shaderParamListView.SelectedItems[0]; if (material.matparam.ContainsKey(currentItem.Text)) { ParamValueDialog dialog = new ParamValueDialog(); LoadDialogDropPanel(dialog, material.matparam[currentItem.Text]); dialog.Location = currentItem.Position; if (dialog.ShowDialog() == DialogResult.OK) { ShaderParamToListItem(material.matparam[currentItem.Text], shaderParamListView.SelectedItems[0]); } } } }