public void DeleteLight(WadLight light) { if (DarkMessageBox.Show(Parent, "Do you really want to delete this light?", "Confirm delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { Static.Lights.Remove(light); SelectedLight = null; _tool.StaticLightsChanged(); } }
private void PlaceLight(int x, int y) { // Get the intersection point between ray and the horizontal plane var ray = GetRay(x, y); var plane = new Plane(Vector3.UnitY, 0.0f); var point = Vector3.Zero; Collision.RayIntersectsPlane(ray, plane, out point); // Add the light at the intersection point var light = new WadLight(point, 1.0f, 0.5f); Static.Lights.Add(light); _tool.StaticLightsChanged(); Action = StaticEditorAction.Normal; Invalidate(); }
private void butDeleteLight_Click(object sender, EventArgs e) { if (!_doChangesInLighting) { return; } if (panelRendering.SelectedLight == null) { return; } WadLight light = panelRendering.SelectedLight; var node = lstLights.SelectedNodes[0]; panelRendering.SelectedLight = null; panelRendering.DeleteLight(light); panelRendering.UpdateLights(); UpdateLightsList(); UpdateLightUI(); panelRendering.Invalidate(); }