From 7c118e906636bc9c0cf5d1c0c53cb419ab76830c Mon Sep 17 00:00:00 2001 From: PunishedPineapple <50609717+PunishedPineapple@users.noreply.github.com> Date: Wed, 27 Jul 2022 00:19:16 -0500 Subject: [PATCH] Don't limit double clicking to the selected preset; people might want to place a preset while editing, and it's not inherently unsafe to do that. --- WaymarkPresetPlugin/UI/Window_Library.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/WaymarkPresetPlugin/UI/Window_Library.cs b/WaymarkPresetPlugin/UI/Window_Library.cs index cb327ae..5c1b158 100644 --- a/WaymarkPresetPlugin/UI/Window_Library.cs +++ b/WaymarkPresetPlugin/UI/Window_Library.cs @@ -303,9 +303,9 @@ unsafe private (int,int,bool)? DrawPresetsForZone( KeyValuePair= 0 && ImGui.IsItemHovered() && ImGui.IsMouseDoubleClicked( ImGuiMouseButton.Left ) ) + if( ImGui.IsItemHovered() && ImGui.IsMouseDoubleClicked( ImGuiMouseButton.Left ) ) { - var preset = mConfiguration.PresetLibrary.Presets[SelectedPreset].GetAsGamePreset(); + var preset = mConfiguration.PresetLibrary.Presets[indices[i]].GetAsGamePreset(); MemoryHandler.PlacePreset( preset ); } @@ -404,9 +404,9 @@ unsafe private (int,int,bool)? DrawUncategorizedPresets() } // Place preset when its entry in the library window is double clicked. - if( SelectedPreset >= 0 && ImGui.IsItemHovered() && ImGui.IsMouseDoubleClicked( ImGuiMouseButton.Left ) ) + if( ImGui.IsItemHovered() && ImGui.IsMouseDoubleClicked( ImGuiMouseButton.Left ) ) { - var preset = mConfiguration.PresetLibrary.Presets[SelectedPreset].GetAsGamePreset(); + var preset = mConfiguration.PresetLibrary.Presets[i].GetAsGamePreset(); MemoryHandler.PlacePreset( preset ); }