I'm using Enumerate also to attach text to every button, some of them can be from Bartender, ElvUI etc (this is short version, just added another call to also attach hooks). Full addon code at http://www.curse.com/addons/wow/lasteffect So enumerating every addon manually would enlarge this section too much. Everything was fine until HookScript.
Lua errors enabled and I have no errors at all. I'll try BugSack.
local frame = EnumerateFrames()
while frame do
local fname = frame:GetName()
if frame.IsProtected and frame:IsProtected() --exists and true
and frame.GetObjectType and frame.GetScript and fname
and frame:GetObjectType() == "CheckButton" then
local script = frame:GetScript("OnClick")
if (script == ActionButton1:GetScript("OnClick")) and frame.action and (frame.action < 120) then
if not(string.find(fname, "Override", 1, true)) then
CheckAddOnClickHook(frame)
local action = frame.action
local atype, id, _ = GetActionInfo(action)
print(action, atype, fname, id)
end
end
end
frame = EnumerateFrames(frame)
end
and if function CheckAddOnClickHook contains HookScript like
local function CheckAddOnClickHook(btn)
if not(btn.lasteffecthook) then
btn:HookScript("OnClick", ButtonOnClick)
btn.lasteffecthook = true
end
end
all I can see is only first action button. If I comment HookScript I can see all buttons. ButtonOnClick simple local function that prints button name for now.
Why that happens and can it be solved?
And just as a pointer, I see a lot of authors calling something like...
Happens because there is no full example in docs. Only pure API, like msdn where you can see lot of functions but probability to make own Iocp handler without example how to put functions together near zero.
I found there is Masque instead of Button Facade. My addon supports BF only still and support made by monkey copying from another addon (and I'm not sure is addon author understood what he doing also).
Lets imagine my buttons inherited from SecureActionButtonTemplate and ActionButtonTemplate - can you please provide short example (not as short as "do something here") what should I do to support Masque?
I'm catching not only OnShow/OnHide of MacroFrame, but also PetJournal, SpellBookFrame, PaperDollFrame - i.e. frame from which player can drag spells, mounts etc to put my addon in proper state. Last 2 frames was easy, MacroFrame and PetJournal harder.
Also I'm hooking OnHide to leave that state, so OnLoad not enough.
not works because probably it called after destroying frame and MacroFrame_OnHide not exists at this moment.
How to catch OnHide or OnClose? Or some other solution exists?
elseif actBtnName:match("^BT4Button%d+$") then
local atype, action = actBtn:GetAction()
if atype == "action" then
FlyoutButton_SetCursor(self.command, self.value, self.subValue)
PlaceAction(action)
actBtn:UpdateAction(true)
ClearCursor()
end
How to call OnReceiveDrag for this buttons (is nil)? Or at least is this possible to implement PlaceAction for this buttons?
I'm trying from my addon (FlyoutButton Custom) to put into parent BT4 button another spell on right click while not in combat. It works for Blizzard buttons through
function My_FindSpellID(spellName)
local i = 1;
while true do
local spellAndRank = My_GetSpellName(i, BOOKTYPE_SPELL);
if (not spellAndRank) then
break;
end
if (spellName == spellAndRank) then
--print at this point like "Fireball(Rank 13)"
return i;
end
i = i + 1;
end
return nil;
end
function My_GetSpellName(spell, ...)
local name, rank = GetSpellName(spell, ...);
if (name) then
return name.."("..rank..")", name, rank;
end
return nil, nil, nil;
end
I guess SpellBook lookup isn't best technique, but thats from wowwiki.
and to set tooltip
local spellId = My_FindSpellID(value);
if (spellId and GameTooltip:SetSpell(spellId, BOOKTYPE_SPELL)) then
...
About ranks removal - how about spells like Polymorph(Pig), Polymorph(Rabbit) etc? Those "Pig" and "Rabbit" is ranks.
When I using GameTooltip:SetSpell(spellId, , BOOKTYPE_SPELL) tooltip works, except there is no spell rank. How to show spell ranks? Am I doing something wrong?
Did. Filename there "ExtraBarsSpsh v1.10b". In "Facts" "Filename ExtraBarsSpsh1.10b.zip". However on my download page "Download ExtraBarsShapeshift ExtraBarsShapeshift ExtraBarsSpsh v1.10b" still.
0
0
Lua errors enabled and I have no errors at all. I'll try BugSack.
P.S. also you forgot several Blizzard's bars :)
Edit: no bugs with BugSack :confused:
0
and if function CheckAddOnClickHook contains HookScript like
all I can see is only first action button. If I comment HookScript I can see all buttons. ButtonOnClick simple local function that prints button name for now.
Why that happens and can it be solved?
0
Happens because there is no full example in docs. Only pure API, like msdn where you can see lot of functions but probability to make own Iocp handler without example how to put functions together near zero.
I found there is Masque instead of Button Facade. My addon supports BF only still and support made by monkey copying from another addon (and I'm not sure is addon author understood what he doing also).
Lets imagine my buttons inherited from SecureActionButtonTemplate and ActionButtonTemplate - can you please provide short example (not as short as "do something here") what should I do to support Masque?
0
I'm catching not only OnShow/OnHide of MacroFrame, but also PetJournal, SpellBookFrame, PaperDollFrame - i.e. frame from which player can drag spells, mounts etc to put my addon in proper state. Last 2 frames was easy, MacroFrame and PetJournal harder.
Also I'm hooking OnHide to leave that state, so OnLoad not enough.
0
But how to catch OnClose or OnHide for such frames? Code not works because probably it called after destroying frame and MacroFrame_OnHide not exists at this moment.
How to catch OnHide or OnClose? Or some other solution exists?
0
I'm googling something like "wow ui sources tekkub", first link to GitHub, there by link branches with MoP Beta. Downloadable as zip.
0
0
I'm trying from my addon (FlyoutButton Custom) to put into parent BT4 button another spell on right click while not in combat. It works for Blizzard buttons through
and for Button Forge through
Thanks.
0
Edit: fix is DEFAULT_CHAT_FRAME.editBox:Show()
0
I guess SpellBook lookup isn't best technique, but thats from wowwiki.
and to set tooltip
About ranks removal - how about spells like Polymorph(Pig), Polymorph(Rabbit) etc? Those "Pig" and "Rabbit" is ranks.
0
0
0
0
How I should fix that? Thx.