Can someone help me
I cannot figure out why the self:GetID() is return nil in Amf.ActionButton_OnLoad (self)
I set the id in Amf.ActionButton_CreateButton(state,index) and the Amf.defualts.totalButtons is returning the right value.
Code:
function Amf.ActionButton_CreateButton(state,index)
local button
button = CreateFrame("CheckButton", "ActionButton"..state .."_"..index, _G["MainBarFrame"], "AmfBarButtonTemplate")
Amf.defualts.totalButtons = (Amf.defualts.totalButtons + 1)
button:SetID(Amf.defualts.totalButtons)
return button
end
function Amf.ActionButton_OnLoad (self)
self.action = self:GetID()
self.flashing = 0;
self.flashtime = 0;
self:SetAttribute("showgrid", 0);
self:SetAttribute("type", "action");
self:SetAttribute("checkselfcast", true);
self:SetAttribute("checkfocuscast", true);
self:RegisterForDrag("LeftButton", "RightButton");
self:RegisterForClicks("AnyDown");
self:RegisterEvent("PLAYER_ENTERING_WORLD");
self:RegisterEvent("ACTIONBAR_SHOWGRID");
self:RegisterEvent("ACTIONBAR_HIDEGRID");
self:RegisterEvent("ACTIONBAR_PAGE_CHANGED");
self:RegisterEvent("ACTIONBAR_SLOT_CHANGED");
Amf.ActionButton_Update (self)
Amf.ActionButton_UpdateHotkeys(self, self.buttonType);
end