Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Bunny67 committed Sep 4, 2016
1 parent 0daf3b3 commit fc269a5
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 1,275 deletions.
4 changes: 1 addition & 3 deletions ElvUI_ExtraActionBars/ElvUI_ExtraActionBars.toc
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
## Interface: 30300
## Author: Bunny
## Author: Blazeflack
## Version: 1.00
## Title: |cffA11313E|r|cffC4C4C4lvUI|r |cffA11313E|r|cffC4C4C4xtra|r |cffA11313A|r|cffC4C4C4ction|r |cffA11313B|r|cffC4C4C4ars|r
## Notes: Adds 4 extra actionbars to ElvUI.
## RequiredDeps: ElvUI
## SavedVariablesPerCharacter: ExtraBar_ButtonEntries, ExtraBar_ButtonSettings

libs\AlternateButtonTemplate\AlternateButtonTemplate.xml
config.lua
core.lua
67 changes: 9 additions & 58 deletions ElvUI_ExtraActionBars/core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,57 +4,6 @@ local AB = E:GetModule("ActionBars");
local EP = LibStub("LibElvUIPlugin-1.0");
local addon, ns = ...;

local split = string.split;

local function CreateBar(id)
local bar = CreateFrame("Frame", "ElvUI_Bar" .. id, E.UIParent, "SecureHandlerBaseTemplate, SecureHandlerShowHideTemplate");
local point, anchor, attachTo, x, y = split(",", AB["barDefaults"]["bar" .. id].position);
bar:Point(point, anchor, attachTo, x, y);
bar.id = id;
bar:CreateBackdrop("Default");
bar:SetFrameStrata("LOW");

local offset = E.Spacing;
bar.backdrop:SetPoint("TOPLEFT", bar, "TOPLEFT", offset, -offset);
bar.backdrop:SetPoint("BOTTOMRIGHT", bar, "BOTTOMRIGHT", -offset, offset);

bar.buttons = {};
bar.bindButtons = AB["barDefaults"]["bar" .. id].bindButtons;

AB:HookScript(bar, "OnEnter", "Bar_OnEnter");
AB:HookScript(bar, "OnLeave", "Bar_OnLeave");

for i = 1, 12 do
bar.buttons[i] = CreateFrame("CheckButton", format(bar:GetName() .. "Button%d", i), bar, "AlternateButtonTemplate");
AB:StyleButton(bar.buttons[i]);

bar.buttons[i]:SetAttribute("saveentries", "ExtraBar_ButtonEntries");
bar.buttons[i]:SetAttribute("savesettings", "ExtraBar_ButtonSettings");

AB:HookScript(bar.buttons[i], "OnEnter", "Button_OnEnter");
AB:HookScript(bar.buttons[i], "OnLeave", "Button_OnLeave");
end

bar:Execute([[ebButtons = newtable(); owner:GetChildList(ebButtons);]]);
bar:SetAttribute("_onstate-page", [[
for i, button in ipairs(ebButtons) do
button:SetAttribute("actionpage", tonumber(newstate));
end
]]);
bar:SetAttribute("_onstate-show", [[
if(newstate == "hide") then
self:Hide();
else
self:Show();
end
]]);

AB["handledBars"]["bar"..id] = bar;
E:CreateMover(bar, "ElvAB_"..id, L["Bar "]..id, nil, nil, nil,"ALL,ACTIONBARS");
AB:PositionAndSizeBar("bar"..id);
return bar;
end

function EAB:UpdateButtonSettings()
for i = 7, 10 do
AB:PositionAndSizeBar("bar"..i);
Expand Down Expand Up @@ -88,15 +37,17 @@ function EAB:CreateBars()
};

for i = 7, 10 do
CreateBar(i);
AB:CreateBar(i);
end

if(not ExtraBar_ButtonEntries) then
ExtraBar_ButtonEntries = {};
ExtraBar_ButtonSettings = {};

for b, _ in pairs(AB["handledbuttons"]) do
AB:RegisterButton(b, true);
end
ExtraBar_ButtonEntries, ExtraBar_ButtonSettings = ABTMethods_UpdateSavedDataVersion(ExtraBar_ButtonEntries, ExtraBar_ButtonSettings);
ABTMethods_LoadAll(ExtraBar_ButtonEntries, ExtraBar_ButtonSettings);

AB:UpdateButtonSettings();
AB:ReassignBindings();

hooksecurefunc(AB, 'UpdateButtonSettings', EAB.UpdateButtonSettings)
end

function EAB:PLAYER_REGEN_ENABLED()
Expand Down
Loading

1 comment on commit fc269a5

@Crumdidlyumshis
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Holy shit! No way! Did you just really backport ElvUI_ExtraActionBars before I got back home? <3

Please sign in to comment.