actionbar: add option to switch page on keypress

This commit is contained in:
shagu
2018-01-19 17:54:03 +01:00
parent dbfcca95c0
commit ac250e2265
3 changed files with 38 additions and 0 deletions
+1
View File
@@ -472,6 +472,7 @@ function pfUI:LoadConfig()
pfUI:UpdateConfig("bars", nil, "showequipped", "1")
pfUI:UpdateConfig("bars", nil, "hunterbar", "0")
pfUI:UpdateConfig("bars", nil, "keydown", "0")
pfUI:UpdateConfig("bars", nil, "pagemaster", "0")
pfUI:UpdateConfig("bars", nil, "hide_time", "1")
pfUI:UpdateConfig("bars", nil, "hide_actionmain", "0")
pfUI:UpdateConfig("bars", nil, "hide_bottomleft", "0")
+36
View File
@@ -54,6 +54,42 @@ pfUI:RegisterModule("actionbar", function ()
end, true)
end
if C.bars.pagemaster == "1" then
local modifier = { "ALT", "SHIFT", "CTRL" }
local buttons = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "-", "+", "=", "´" }
local shift, ctrl, alt, default = 6, 5, 3, 1
local current = CURRENT_ACTIONBAR_PAGE
local function SwitchBar(bar)
if CURRENT_ACTIONBAR_PAGE ~= bar then
CURRENT_ACTIONBAR_PAGE = bar
ChangeActionBarPage()
end
end
local pagemaster = CreateFrame("Frame", "pfPageMaster", UIParent)
pagemaster:RegisterEvent("PLAYER_ENTERING_WORLD")
pagemaster:SetScript("OnEvent", function()
for _,mod in pairs(modifier) do
for _,but in pairs(buttons) do
SetBinding(mod.."-"..but)
end
end
end)
pagemaster:SetScript("OnUpdate", function()
if IsShiftKeyDown() then
SwitchBar(shift)
elseif IsControlKeyDown() then
SwitchBar(ctrl)
elseif IsAltKeyDown() then
SwitchBar(alt)
else
SwitchBar(default)
end
end)
end
-- reagent counter
local reagentslots = { }
local reagentscan = CreateFrame("GameTooltip", "pfReagentScanner", UIParent, "GameTooltipTemplate")
+1
View File
@@ -953,6 +953,7 @@ pfUI:RegisterModule("gui", function ()
CreateConfig(nil, this, T["Show Equipped Items"], C.bars, "showequipped", "checkbox")
CreateConfig(nil, this, T["Enable Range Based Auto Paging (Hunter)"], C.bars, "hunterbar", "checkbox")
CreateConfig(nil, this, T["Enable Action On Key Down"], C.bars, "keydown", "checkbox")
CreateConfig(nil, this, T["Switch Bar On Meta Key Press"], C.bars, "pagemaster", "checkbox")
this.setup = true
end
end)