diff --git a/ElvUI_ExtraActionBars/ElvUI_ExtraActionBars.toc b/ElvUI_ExtraActionBars/ElvUI_ExtraActionBars.toc new file mode 100644 index 0000000..813e33c --- /dev/null +++ b/ElvUI_ExtraActionBars/ElvUI_ExtraActionBars.toc @@ -0,0 +1,9 @@ +## Interface: 30300 +## Author: Blazeflack +## Version: 1.00 +## Title: |cff1784d1E|r|cffe5e3e3lvUI|r |cff1784d1E|r|cffe5e3e3xtra|r |cff1784d1A|r|cffe5e3e3ction|r |cff1784d1B|r|cffe5e3e3ars|r +## Notes: Adds 4 extra actionbars to ElvUI. +## RequiredDeps: ElvUI + +config.lua +core.lua \ No newline at end of file diff --git a/ElvUI_ExtraActionBars/LICENSE.txt b/ElvUI_ExtraActionBars/LICENSE.txt new file mode 100644 index 0000000..ba36dcc --- /dev/null +++ b/ElvUI_ExtraActionBars/LICENSE.txt @@ -0,0 +1,19 @@ +ElvUI_ExtraActionBars License + Copyright ©2012-2015 + + The contents of this addon, excluding third-party resources, are + copyrighted to their authors with all rights reserved. + + The author of this addon hereby grants you the following rights: + + 1. You may make modifications to this addon for private use only, you + must have the authors express written consent to publicize any portion + of this addon. + + 2. Do not modify the name of this addon, including the addon folders. + + 3. This copyright notice shall be included in all copies or substantial + portions of the Software. + + All rights not explicitly addressed in this license are reserved by + the copyright holders. \ No newline at end of file diff --git a/ElvUI_ExtraActionBars/config.lua b/ElvUI_ExtraActionBars/config.lua new file mode 100644 index 0000000..a7f8d46 --- /dev/null +++ b/ElvUI_ExtraActionBars/config.lua @@ -0,0 +1,264 @@ +local E, L, V, P, G, _ = unpack(ElvUI) +local EAB = E:NewModule("ExtraActionBars", "AceEvent-3.0") +local AB = E:GetModule("ActionBars") + +local points = { + ["TOPLEFT"] = "TOPLEFT", + ["TOPRIGHT"] = "TOPRIGHT", + ["BOTTOMLEFT"] = "BOTTOMLEFT", + ["BOTTOMRIGHT"] = "BOTTOMRIGHT" +} + +P["actionbar"]["bar7"] = { + ["enabled"] = false, + ["mouseover"] = false, + ["buttons"] = 12, + ["buttonsPerRow"] = 12, + ["point"] = "BOTTOMLEFT", + ["backdrop"] = true, + ["heightMult"] = 1, + ["widthMult"] = 1, + ["buttonsize"] = 32, + ["buttonspacing"] = 2, + ["backdropSpacing"] = 2, + ["alpha"] = 1, + ["inheritGlobalFade"] = false, + ["showGrid"] = true, + ["paging"] = {}, + ["visibility"] = "[vehicleui] hide; show" +} + +P["actionbar"]["bar8"] = { + ["enabled"] = false, + ["mouseover"] = false, + ["buttons"] = 12, + ["buttonsPerRow"] = 12, + ["point"] = "BOTTOMLEFT", + ["backdrop"] = true, + ["heightMult"] = 1, + ["widthMult"] = 1, + ["buttonsize"] = 32, + ["buttonspacing"] = 2, + ["backdropSpacing"] = 2, + ["alpha"] = 1, + ["inheritGlobalFade"] = false, + ["showGrid"] = true, + ["paging"] = {}, + ["visibility"] = "[vehicleui] hide; show" +} + +P["actionbar"]["bar9"] = { + ["enabled"] = false, + ["mouseover"] = false, + ["buttons"] = 12, + ["buttonsPerRow"] = 12, + ["point"] = "BOTTOMLEFT", + ["backdrop"] = true, + ["heightMult"] = 1, + ["widthMult"] = 1, + ["buttonsize"] = 32, + ["buttonspacing"] = 2, + ["backdropSpacing"] = 2, + ["alpha"] = 1, + ["inheritGlobalFade"] = false, + ["showGrid"] = true, + ["paging"] = {}, + ["visibility"] = "[vehicleui] hide; show" +} + +P["actionbar"]["bar10"] = { + ["enabled"] = false, + ["mouseover"] = false, + ["buttons"] = 12, + ["buttonsPerRow"] = 12, + ["point"] = "BOTTOMLEFT", + ["backdrop"] = true, + ["heightMult"] = 1, + ["widthMult"] = 1, + ["buttonsize"] = 32, + ["buttonspacing"] = 2, + ["backdropSpacing"] = 2, + ["alpha"] = 1, + ["inheritGlobalFade"] = false, + ["showGrid"] = true, + ["paging"] = {}, + ["visibility"] = "[vehicleui] hide; show" +} + +function EAB:InsertOptions() + local group = E.Options.args.actionbar.args + for i = 7, 10 do + local name = L["Bar "]..i + group["bar" .. i] = { + order = 200 + i, + type = "group", + name = name, + disabled = function() return not E.private.actionbar.enable end, + get = function(info) return E.db.actionbar["bar" .. i][ info[#info] ] end, + set = function(info, value) E.db.actionbar["bar" .. i][ info[#info] ] = value AB:PositionAndSizeBar("bar" .. i) end, + args = { + info = { + order = 1, + type = "header", + name = name + }, + enabled = { + order = 2, + type = "toggle", + name = L["Enable"], + set = function(info, value) + E.db.actionbar["bar"..i][ info[#info] ] = value + AB:PositionAndSizeBar("bar"..i) + end + }, + restorePosition = { + order = 3, + type = "execute", + name = L["Restore Bar"], + desc = L["Restore the actionbars default settings"], + func = function() E:CopyTable(E.db.actionbar["bar"..i], P.actionbar["bar"..i]) E:ResetMovers(L["Bar "..i]) AB:PositionAndSizeBar("bar"..i) end, + disabled = function() return not E.db.actionbar["bar" .. i].enabled end + }, + spacer = { + order = 4, + type = "description", + name = " " + }, + backdrop = { + order = 5, + type = "toggle", + name = L["Backdrop"], + desc = L["Toggles the display of the actionbars backdrop."], + disabled = function() return not E.db.actionbar["bar" .. i].enabled end + }, + showGrid = { + order = 6, + type = "toggle", + name = L["Show Empty Buttons"], + set = function(info, value) E.db.actionbar["bar" .. i][ info[#info] ] = value AB:UpdateButtonSettingsForBar("bar" .. i) end, + disabled = function() return not E.db.actionbar["bar" .. i].enabled end + }, + mouseover = { + order = 7, + type = "toggle", + name = L["Mouse Over"], + desc = L["The frame is not shown unless you mouse over the frame."], + disabled = function() return not E.db.actionbar["bar" .. i].enabled end + }, + inheritGlobalFade = { + order = 8, + type = "toggle", + name = L["Inherit Global Fade"], + desc = L["Inherit the global fade, mousing over, targetting, setting focus, losing health, entering combat will set the remove transparency. Otherwise it will use the transparency level in the general actionbar settings for global fade alpha."], + disabled = function() return not E.db.actionbar["bar" .. i].enabled end + }, + point = { + order = 9, + type = "select", + name = L["Anchor Point"], + desc = L["The first button anchors itself to this point on the bar."], + values = points, + disabled = function() return not E.db.actionbar["bar" .. i].enabled end + }, + buttons = { + order = 10, + type = "range", + name = L["Buttons"], + desc = L["The amount of buttons to display."], + min = 1, max = NUM_ACTIONBAR_BUTTONS, step = 1, + disabled = function() return not E.db.actionbar["bar" .. i].enabled end + }, + buttonsPerRow = { + order = 11, + type = "range", + name = L["Buttons Per Row"], + desc = L["The amount of buttons to display per row."], + min = 1, max = NUM_ACTIONBAR_BUTTONS, step = 1, + disabled = function() return not E.db.actionbar["bar" .. i].enabled end + }, + buttonsize = { + order = 12, + type = "range", + name = L["Button Size"], + desc = L["The size of the action buttons."], + min = 15, max = 60, step = 1, + disabled = function() return not E.db.actionbar["bar" .. i].enabled end + }, + buttonspacing = { + order = 13, + type = "range", + name = L["Button Spacing"], + desc = L["The spacing between buttons."], + min = -1, max = 10, step = 1, + disabled = function() return not E.db.actionbar["bar" .. i].enabled end + }, + backdropSpacing = { + order = 14, + type = "range", + name = L["Backdrop Spacing"], + desc = L["The spacing between the backdrop and the buttons."], + min = 0, max = 10, step = 1, + disabled = function() return not E.db.actionbar["bar" .. i].enabled end + }, + heightMult = { + order = 15, + type = "range", + name = L["Height Multiplier"], + desc = L["Multiply the backdrops height or width by this value. This is usefull if you wish to have more than one bar behind a backdrop."], + min = 1, max = 5, step = 1, + disabled = function() return not E.db.actionbar["bar" .. i].enabled end + }, + widthMult = { + order = 16, + type = "range", + name = L["Width Multiplier"], + desc = L["Multiply the backdrops height or width by this value. This is usefull if you wish to have more than one bar behind a backdrop."], + min = 1, max = 5, step = 1, + disabled = function() return not E.db.actionbar["bar" .. i].enabled end + }, + alpha = { + order = 17, + type = "range", + name = L["Alpha"], + isPercent = true, + min = 0, max = 1, step = 0.01, + disabled = function() return not E.db.actionbar["bar" .. i].enabled end + }, + paging = { + order = 18, + type = "input", + name = L["Action Paging"], + desc = L["This works like a macro, you can run different situations to get the actionbar to page differently.\n Example: '[combat] 2'"], + width = "full", + multiline = true, + get = function(info) return E.db.actionbar["bar" .. i]["paging"][E.myclass] end, + set = function(info, value) + if(not E.db.actionbar["bar" .. i]["paging"][E.myclass]) then + E.db.actionbar["bar" .. i]["paging"][E.myclass] = {} + end + + E.db.actionbar["bar"..i]["paging"][E.myclass] = value + AB:UpdateButtonSettings() + end, + disabled = function() return not E.db.actionbar["bar" .. i].enabled end + }, + visibility = { + order = 19, + type = "input", + name = L["Visibility State"], + desc = L["This works like a macro, you can run different situations to get the actionbar to show/hide differently.\n Example: '[combat] showhide'"], + width = "full", + multiline = true, + set = function(info, value) + E.db.actionbar["bar" .. i]["visibility"] = value + AB:UpdateButtonSettings() + end, + disabled = function() return not E.db.actionbar["bar" .. i].enabled end + } + } + } + end +end + + +E:RegisterModule(EAB:GetName()) \ No newline at end of file diff --git a/ElvUI_ExtraActionBars/core.lua b/ElvUI_ExtraActionBars/core.lua new file mode 100644 index 0000000..704c7b9 --- /dev/null +++ b/ElvUI_ExtraActionBars/core.lua @@ -0,0 +1,73 @@ +local E, L, V, P, G, _ = unpack(ElvUI) +local EAB = E:GetModule("ExtraActionBars") +local AB = E:GetModule("ActionBars") +local EP = LibStub("LibElvUIPlugin-1.0") +local addon, ns = ... + +function EAB:UpdateButtonSettings() + for i = 7, 10 do + AB:PositionAndSizeBar("bar"..i) + end +end + +function EAB:CreateBars() + AB["barDefaults"]["bar7"] = { + ["page"] = 7, + ["bindButtons"] = "EXTRABAR7BUTTON", + ["conditions"] = "", + ["position"] = "BOTTOM,ElvUI_Bar1,TOP,0,82" + } + AB["barDefaults"]["bar8"] = { + ["page"] = 8, + ["bindButtons"] = "EXTRABAR8BUTTON", + ["conditions"] = "", + ["position"] = "BOTTOM,ElvUI_Bar1,TOP,0,122" + } + AB["barDefaults"]["bar9"] = { + ["page"] = 9, + ["bindButtons"] = "EXTRABAR9BUTTON", + ["conditions"] = "", + ["position"] = "BOTTOM,ElvUI_Bar1,TOP,0,162" + } + AB["barDefaults"]["bar10"] = { + ["page"] = 10, + ["bindButtons"] = "EXTRABAR10BUTTON", + ["conditions"] = "", + ["position"] = "BOTTOM,ElvUI_Bar1,TOP,0,202" + } + + for i = 7, 10 do + AB:CreateBar(i) + end + + for b, _ in pairs(AB["handledbuttons"]) do + AB:RegisterButton(b, true) + end + + AB:UpdateButtonSettings() + AB:ReassignBindings() + + hooksecurefunc(AB, 'UpdateButtonSettings', EAB.UpdateButtonSettings) +end + +function EAB:PLAYER_REGEN_ENABLED() + self:UnregisterEvent("PLAYER_REGEN_ENABLED") + + EAB:CreateBars() +end + +function EAB:PLAYER_ENTERING_WORLD() + self:UnregisterEvent("PLAYER_ENTERING_WORLD") + + if(InCombatLockdown()) then self:RegisterEvent("PLAYER_REGEN_ENABLED") return end + + EAB:CreateBars() +end + +function EAB:OnInitialize() + EP:RegisterPlugin(addon, EAB.InsertOptions) + + if(E.private.actionbar.enable ~= true) then return end + + self:RegisterEvent("PLAYER_ENTERING_WORLD") +end \ No newline at end of file