From bacaff5b6bbaed08a303253c6a03c36a5881f7ff Mon Sep 17 00:00:00 2001 From: biwa <6475593+biwa@users.noreply.github.com> Date: Tue, 23 Aug 2022 14:41:03 +0200 Subject: [PATCH] - Sector Color Picker: fixed a problem where the dialog could not be closed using the "enter" or "ESC" buttons - Light/Sector Color Picker: fixed a problem where closing the dialog would result in a flicker - Light Color Picker: fixed a problem where canceling the dialog would not revert the color settings --- Source/Plugins/ColorPicker/BuilderPlug.cs | 7 ------- Source/Plugins/ColorPicker/Windows/LightColorPicker.cs | 3 +-- Source/Plugins/ColorPicker/Windows/SectorColorPicker.cs | 2 ++ 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/Source/Plugins/ColorPicker/BuilderPlug.cs b/Source/Plugins/ColorPicker/BuilderPlug.cs index fe136be8..ac1d97a0 100755 --- a/Source/Plugins/ColorPicker/BuilderPlug.cs +++ b/Source/Plugins/ColorPicker/BuilderPlug.cs @@ -172,11 +172,6 @@ namespace CodeImp.DoomBuilder.ColorPicker deselectelement.Selected = false; } } - else - { - form.Dispose(); - form = null; - } General.Interface.RedrawDisplay(); } @@ -184,8 +179,6 @@ namespace CodeImp.DoomBuilder.ColorPicker private void form_FormClosed(object sender, FormClosedEventArgs e) { formLocation = form.Location; - form.Dispose(); - form = null; } } } \ No newline at end of file diff --git a/Source/Plugins/ColorPicker/Windows/LightColorPicker.cs b/Source/Plugins/ColorPicker/Windows/LightColorPicker.cs index 8548e331..c7578d03 100755 --- a/Source/Plugins/ColorPicker/Windows/LightColorPicker.cs +++ b/Source/Plugins/ColorPicker/Windows/LightColorPicker.cs @@ -323,8 +323,7 @@ namespace CodeImp.DoomBuilder.ColorPicker.Windows { General.Map.UndoRedo.CreateUndo(description); - //tricky way to actually store undo information... - foreach(Thing t in selection) t.Move(t.Position); + foreach (Thing t in selection) t.Fields.BeforeFieldsChange(); } //this is called only once diff --git a/Source/Plugins/ColorPicker/Windows/SectorColorPicker.cs b/Source/Plugins/ColorPicker/Windows/SectorColorPicker.cs index c3e719eb..a077f7d3 100755 --- a/Source/Plugins/ColorPicker/Windows/SectorColorPicker.cs +++ b/Source/Plugins/ColorPicker/Windows/SectorColorPicker.cs @@ -97,6 +97,8 @@ namespace CodeImp.DoomBuilder.ColorPicker.Windows rbSectorColor.CheckedChanged += rbColor_CheckedChanged; rbFadeColor.CheckedChanged += rbColor_CheckedChanged; + this.AcceptButton = colorPickerControl1.OkButton; + this.CancelButton = colorPickerControl1.CancelButton; Text = "Editing " + rest; //cannot fail here :)