gui: ability to access actionbar settings via gui

This commit is contained in:
shagu
2018-03-06 00:13:59 +01:00
parent ba22fcf75a
commit ff65b6b29a
3 changed files with 37 additions and 24 deletions
+8 -1
View File
@@ -240,7 +240,10 @@ pfUI:RegisterModule("actionbar", function ()
PetActionBarFrame:SetParent(pfUI.bars.pet)
pfUI.bars:SetScript("OnEvent", function()
MultiActionBar_UpdateGridVisibility()
MultiActionBar_Update()
UIParent_ManageFramePositions();
MultiActionBar_Update()
UpdateMicroButtons()
BarLayoutSize(pfUI.bars.actionmain, NUM_ACTIONBAR_BUTTONS, C.bars.actionmain.formfactor, C.bars.icon_size, default_border)
pfUI.bars.actionmain:SetWidth(pfUI.bars.actionmain._size[1])
@@ -419,6 +422,10 @@ pfUI:RegisterModule("actionbar", function ()
if SHOW_MULTI_ACTIONBAR_4 then
pfUI.bars.tworight:Show()
for i=1, NUM_ACTIONBAR_BUTTONS do
_G["MultiBarLeftButton"..i]:Show()
end
pfUI.bars.tworight:SetFrameStrata("LOW")
pfUI.bars.tworight:ClearAllPoints()
pfUI.bars.tworight:SetPoint("RIGHT", UIParent, "RIGHT", -5, 0)
+28 -22
View File
@@ -63,15 +63,14 @@ pfUI:RegisterModule("gui", function ()
category = {}
category[config] = tostring(_G[config] or 0)
local update = ufunc
ufunc = function()
_G[config] = this:GetChecked() and 1 or nil
UIOptionsFrame_Save()
-- refresh elements
MultiActionBar_Update()
MultiActionBar_UpdateGridVisibility();
UIParent_ManageFramePositions();
UpdateMicroButtons()
if update then
update()
end
end
end
@@ -967,6 +966,7 @@ pfUI:RegisterModule("gui", function ()
if not this.setup then
CreateConfig(nil, this, T["Icon Size"], C.bars, "icon_size")
CreateConfig(nil, this, T["Enable Action Bar Backgrounds"], C.bars, "background", "checkbox")
CreateConfig(MultiActionBar_UpdateGridVisibility, this, T["Always Show Action Bar Buttons"], "GVAR", "ALWAYS_SHOW_MULTIBARS", "checkbox")
CreateConfig(nil, this, T["Enable Range Display On Hotkeys"], C.bars, "glowrange", "checkbox")
CreateConfig(nil, this, T["Range Display Color"], C.bars, "rangecolor", "color")
CreateConfig(nil, this, T["Show Macro Text"], C.bars, "showmacro", "checkbox")
@@ -979,6 +979,28 @@ pfUI:RegisterModule("gui", function ()
end
end)
-- >> Layout
pfUI.gui.tabs.actionbar.tabs.layout = pfUI.gui.tabs.actionbar.tabs:CreateTabChild(T["Layout"], true)
pfUI.gui.tabs.actionbar.tabs.layout:SetScript("OnShow", function()
if not this.setup then
CreateConfig(UIParent_ManageFramePositions, this, T["Enable Second Actionbar (BottomLeft)"], "GVAR", "SHOW_MULTI_ACTIONBAR_1", "checkbox")
CreateConfig(UIParent_ManageFramePositions, this, T["Enable Left Actionbar (BottomRight)"], "GVAR", "SHOW_MULTI_ACTIONBAR_2", "checkbox")
CreateConfig(UIParent_ManageFramePositions, this, T["Enable Right Actionbar (Right)"], "GVAR", "SHOW_MULTI_ACTIONBAR_3", "checkbox")
CreateConfig(UIParent_ManageFramePositions, this, T["Enable Vertical Actionbar (TwoRight)"], "GVAR", "SHOW_MULTI_ACTIONBAR_4", "checkbox")
CreateConfig(update[c], this, T["Form Factor"], nil, nil, "header")
CreateConfig(nil, this, T["Main Actionbar (ActionMain)"], C.bars.actionmain, "formfactor", "dropdown", pfUI.gui.dropdowns.num_actionbar_buttons)
CreateConfig(nil, this, T["Second Actionbar (BottomLeft)"], C.bars.bottomleft, "formfactor", "dropdown", pfUI.gui.dropdowns.num_actionbar_buttons)
CreateConfig(nil, this, T["Left Actionbar (BottomRight)"], C.bars.bottomright, "formfactor", "dropdown", pfUI.gui.dropdowns.num_actionbar_buttons)
CreateConfig(nil, this, T["Right Actionbar (Right)"], C.bars.right, "formfactor", "dropdown", pfUI.gui.dropdowns.num_actionbar_buttons)
CreateConfig(nil, this, T["Vertical Actionbar (TwoRight)"], C.bars.tworight, "formfactor", "dropdown", pfUI.gui.dropdowns.num_actionbar_buttons)
CreateConfig(nil, this, T["Shapeshift Bar (BarShapeShift)"], C.bars.shapeshift, "formfactor", "dropdown", pfUI.gui.dropdowns.num_shapeshift_slots)
CreateConfig(nil, this, T["Pet Bar (BarPet)"], C.bars.pet, "formfactor", "dropdown", pfUI.gui.dropdowns.num_pet_action_slots)
CreateConfig(nil, this, T["Enable Actionbars"], nil, nil, "button", function() ShowUIPanel(UIOptionsFrame); UIOptionsFrameTab2:Click() end)
this.setup = true
end
end)
-- >> Autohide
pfUI.gui.tabs.actionbar.tabs.autohide = pfUI.gui.tabs.actionbar.tabs:CreateTabChild(T["Autohide"], true)
pfUI.gui.tabs.actionbar.tabs.autohide:SetScript("OnShow", function()
@@ -995,22 +1017,6 @@ pfUI:RegisterModule("gui", function ()
end
end)
-- >> Layout
pfUI.gui.tabs.actionbar.tabs.layout = pfUI.gui.tabs.actionbar.tabs:CreateTabChild(T["Layout"], true)
pfUI.gui.tabs.actionbar.tabs.layout:SetScript("OnShow", function()
if not this.setup then
CreateConfig(nil, this, T["Main Actionbar (ActionMain)"], C.bars.actionmain, "formfactor", "dropdown", pfUI.gui.dropdowns.num_actionbar_buttons)
CreateConfig(nil, this, T["Second Actionbar (BottomLeft)"], C.bars.bottomleft, "formfactor", "dropdown", pfUI.gui.dropdowns.num_actionbar_buttons)
CreateConfig(nil, this, T["Left Actionbar (BottomRight)"], C.bars.bottomright, "formfactor", "dropdown", pfUI.gui.dropdowns.num_actionbar_buttons)
CreateConfig(nil, this, T["Right Actionbar (Right)"], C.bars.right, "formfactor", "dropdown", pfUI.gui.dropdowns.num_actionbar_buttons)
CreateConfig(nil, this, T["Vertical Actionbar (TwoRight)"], C.bars.tworight, "formfactor", "dropdown", pfUI.gui.dropdowns.num_actionbar_buttons)
CreateConfig(nil, this, T["Shapeshift Bar (BarShapeShift)"], C.bars.shapeshift, "formfactor", "dropdown", pfUI.gui.dropdowns.num_shapeshift_slots)
CreateConfig(nil, this, T["Pet Bar (BarPet)"], C.bars.pet, "formfactor", "dropdown", pfUI.gui.dropdowns.num_pet_action_slots)
this.setup = true
end
end)
-- [[ Panel ]]
pfUI.gui.tabs.panel = pfUI.gui.tabs:CreateTabChild(T["Panel"], nil, nil, nil, true)
pfUI.gui.tabs.panel.tabs = CreateTabFrame(pfUI.gui.tabs.panel, "TOP", true)
+1 -1
View File
@@ -2,7 +2,7 @@
## Title: |cff33ffccpf|cffffffffUI
## Author: Shagu
## Notes: A complete user interface replacement.
## Version: 3.5.3
## Version: 3.6.0
## SavedVariables: pfUI_profiles, pfUI_gold
## SavedVariablesPerCharacter: pfUI_config, pfUI_init, pfUI_playerDB