Exemplo n.º 1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            var edtior = new ShaderOptionsEditBox();

            edtior.LoadOption("", "");

            if (edtior.ShowDialog() == DialogResult.OK)
            {
                shaderOptionsListView.AddObject(new Options()
                {
                    Name  = edtior.textBoxName.Text,
                    Value = edtior.textBoxValue.Text,
                });
                material.shaderassign.options.Add(edtior.textBoxName.Text, edtior.textBoxValue.Text);
            }
        }
Exemplo n.º 2
0
        private void shaderOptionsListView_DoubleClick(object sender, EventArgs e)
        {
            int ActiveIndex = shaderOptionsListView.SelectedIndices[0];

            if (shaderOptionsListView.SelectedObject != null)
            {
                var option = (Options)shaderOptionsListView.SelectedObject;

                var edtior = new ShaderOptionsEditBox();
                edtior.LoadOption(option.Name, option.Value);

                if (edtior.ShowDialog() == DialogResult.OK)
                {
                    option.Name  = edtior.textBoxName.Text;
                    option.Value = edtior.textBoxValue.Text;
                }
            }
        }
Exemplo n.º 3
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            var result = MessageBox.Show("NOTE! Shader Options are link by shaders. These are not possible to edit yet, do you want to continue?", "Material Editor", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Exclamation);

            if (result == DialogResult.OK)
            {
                var edtior = new ShaderOptionsEditBox();
                edtior.LoadOption("", "");

                if (edtior.ShowDialog() == DialogResult.OK)
                {
                    shaderOptionsListView.AddObject(new Options()
                    {
                        Name  = edtior.textBoxName.Text,
                        Value = edtior.textBoxValue.Text,
                    });
                    material.shaderassign.options.Add(edtior.textBoxName.Text, edtior.textBoxValue.Text);
                }
            }
        }