mirror of
https://github.com/brues-code/pfUI.git
synced 2026-09-30 11:10:00 +00:00
actionbar: add option to switch page on keypress
This commit is contained in:
@@ -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")
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user