From 5f46be7376f1122b4b38eb1d5ce7046b9cb96f87 Mon Sep 17 00:00:00 2001 From: shagu Date: Sun, 6 Dec 2020 15:46:40 +0100 Subject: [PATCH] actionbar: move shift key check to last condition IsShiftKeyDown() is quite expensive in vanilla, therefore moving it to the last condition to have it execute as less as possible. --- modules/actionbar.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/actionbar.lua b/modules/actionbar.lua index 17e5b3af..442a6fd2 100644 --- a/modules/actionbar.lua +++ b/modules/actionbar.lua @@ -31,13 +31,13 @@ pfUI:RegisterModule("actionbar", "vanilla:tbc", function () -- skip if always shift-drag is not enabled if C.bars.shiftdrag ~= "1" then return end - if IsShiftKeyDown() and drag_await and not drag_active then + if drag_await and not drag_active and IsShiftKeyDown() then drag_active = true -- set all buttons to regular on release clicks for id, button in pairs(buttoncache) do button:RegisterForClicks("LeftButtonUp", "RightButtonUp") end - elseif not IsShiftKeyDown() and drag_active then + elseif drag_active and not IsShiftKeyDown() then drag_active = nil -- set all buttons back to their defaults for id, button in pairs(buttoncache) do