From ebd7d336076d8a14d3ed1a01bb90280eac2f5981 Mon Sep 17 00:00:00 2001 From: atom0s Date: Tue, 29 Nov 2016 19:05:18 -0800 Subject: [PATCH] Added double-click to load a saved list. --- itemwatch.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/itemwatch.lua b/itemwatch.lua index 004ed11..d08fe80 100644 --- a/itemwatch.lua +++ b/itemwatch.lua @@ -631,8 +631,17 @@ function render_savedlists_editor() if (imgui.Selectable(name, imgui.GetVarValue(variables['var_SelectedSavedList'][1]) == x)) then imgui.SetVarValue(variables['var_SelectedSavedList'][1], x); end + + -- Handle saved list item double click.. + if (imgui.IsItemHovered() and imgui.IsMouseDoubleClicked(0)) then + if (imgui.GetVarValue(variables['var_SelectedSavedList'][1]) >= 0) then + local index = imgui.GetVarValue(variables['var_SelectedSavedList'][1]); + lists.load_list(index); + end + end end end + if (#lists.saved_lists <= 0) then imgui.PushTextWrapPos(0); imgui.TextColored(1.0, 0.4, 0.4, 1.0, 'There are currently no saved lists to display here!');