Esempio n. 1
0
        private void lightToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var menuItem = sender as ToolStripMenuItem;

            int.TryParse(menuItem.Tag.ToString(), out int lightTypeInt);
            LightType type = (LightType)lightTypeInt;

            if (lightDialog == null || lightDialog.IsDisposed)
            {
                lightDialog = new LightDialog(type);
                lightDialog.Show();
            }
        }
Esempio n. 2
0
        private void outlinerTree_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                // Get the clicked on node from mouse position and set the selected node
                var node = outlinerTree.GetNodeAt(e.X, e.Y);
                outlinerTree.SelectedNode = node;

                if (node == null)
                {
                    return;
                }

                // Get light from clicked on node
                var light = Scene.Instance.GetLight(node.Text);
                if (light != null)
                {
                    // Show light dialog with selected light
                    if (lightDialog == null || lightDialog.IsDisposed)
                    {
                        lightDialog = new LightDialog(light);
                        lightDialog.Show();
                        return;
                    }
                }

                // Get Camera from clicked on node
                var camera = Scene.Instance.GetCamera(node.Text);
                if (camera != null)
                {
                    if (cameraDialog == null || cameraDialog.IsDisposed)
                    {
                        cameraDialog = new CameraDialog(camera);
                        cameraDialog.Show();
                        return;
                    }
                }
            }
        }