From 6f7f8a18b485e1604921e1f3657d08c9a05214e6 Mon Sep 17 00:00:00 2001 From: shagu Date: Sun, 3 Dec 2017 12:52:06 +0100 Subject: [PATCH] actionbar: add option to use actions on keydown --- api/config.lua | 1 + modules/actionbar.lua | 10 ++++++++++ modules/gui.lua | 1 + 3 files changed, 12 insertions(+) diff --git a/api/config.lua b/api/config.lua index b73c7339..09dc5cdd 100644 --- a/api/config.lua +++ b/api/config.lua @@ -446,6 +446,7 @@ function pfUI:LoadConfig() pfUI:UpdateConfig("bars", nil, "showmacro", "1") pfUI:UpdateConfig("bars", nil, "showkeybind", "1") pfUI:UpdateConfig("bars", nil, "hunterbar", "1") + pfUI:UpdateConfig("bars", nil, "keydown", "0") pfUI:UpdateConfig("bars", nil, "hide_time", "1") pfUI:UpdateConfig("bars", nil, "hide_actionmain", "0") pfUI:UpdateConfig("bars", nil, "hide_bottomleft", "0") diff --git a/modules/actionbar.lua b/modules/actionbar.lua index 420494e5..69b6fc64 100644 --- a/modules/actionbar.lua +++ b/modules/actionbar.lua @@ -44,6 +44,16 @@ pfUI:RegisterModule("actionbar", function () if pfBonusBar then pfBonusBar:Hide() end end) + if C.bars.keydown == "1" then + hooksecurefunc("ActionButtonDown", function(id) + ActionButtonUp(id) + end, true) + + hooksecurefunc("MultiActionButtonDown", function(bar, id) + MultiActionButtonUp(bar, id) + end, true) + end + -- reagent counter local reagentslots = { } local reagentscan = CreateFrame("GameTooltip", "pfReagentScanner", UIParent, "GameTooltipTemplate") diff --git a/modules/gui.lua b/modules/gui.lua index 8e327df7..acd853b3 100644 --- a/modules/gui.lua +++ b/modules/gui.lua @@ -1194,6 +1194,7 @@ pfUI:RegisterModule("gui", function () CreateConfig(this, T["Show Macro Text"], C.bars, "showmacro", "checkbox") CreateConfig(this, T["Show Hotkey Text"], C.bars, "showkeybind", "checkbox") CreateConfig(this, T["Enable Range Based Auto Paging (Hunter)"], C.bars, "hunterbar", "checkbox") + CreateConfig(this, T["Enable Action On Key Down"], C.bars, "keydown", "checkbox") this.setup = true end end)