Those line numbers in nivBuffs don't match up to r20. As far as I know, none of the functions LBF uses are protected, but I'll try to see if I can reproduce the error when I get time.
They do, GitHub messes them up.
And the one protected function BF uses is SetFrameLevel(). It's protected in my case because the icons of the SecureAuraHeader are protected frames.
When I'm grouped with others (and only then), I'll get some kind of taint error in combat now:
9x <event>ADDON_ACTION_BLOCKED:AddOn 'ButtonFacade' tried to call the protected function 'UNKNOWN()'.
<in C code>: ?
<in C code>: in function `SetFrameLevel'
...uttonFacade\Libs\LibButtonFacade\LibButtonFacade.lua:664: in function <...uttonFacade\Libs\LibButtonFacade\LibButtonFacade.lua:586>:
...uttonFacade\Libs\LibButtonFacade\LibButtonFacade.lua:763: in function `AddButton':
nivBuffs\nivBuffs.lua:102: in function <nivBuffs\nivBuffs.lua:39>
nivBuffs\nivBuffs.lua:198: in function <nivBuffs\nivBuffs.lua:197>
nivBuffs\nivBuffs.lua:303: in function <nivBuffs\nivBuffs.lua:300>
<in C code>: ?
I already googled and tried to search this thread here.. The only thing I found was a comment concerning XBar from 2008. The author said he fixed it but didn't say how. I also don't see anything special in his BF integration code other than not executing AddButton() in combat. But I somehow need to be able to do that, or else aura icons created in combat are not skinned..
I tried not to add the (secure) button but only my btn.icon subframe. That works for skinnig but it completely breaks interactivity (removing buffs on right click and showing the tooltip on mouseover). Moreover I wasn't able to test if that fixes the taint error yet.
PS: If you need to play around with the code again, use the r20 tagged version at GitHub, not the latest commit.
Alright, I'm going to bury my head in sand. Well, actually, it feels that way already. The first issue, that the skin is not sticking between reloads is actually my fault. When I was doing some tweaking, I adjusted the skinning function the GUI uses so the GUI was actually pre-skinning all of its children with the global skin (instead of just setting the global skin) and I forgot to change it back to the correct function. :p That's fixed in the latest alpha.
Thanks alot, it's working now! :D
Though I wonder why it did work for other addons, but not mine..
And also thanks for all your suggestions how to make the groups visible in the UI! However, since I really only need very basic support, I went back to the most simple solution which is perfectly fine for me (skinning the addon level).
First thank you for your efforts to help me! :) Unfortunately I need more of it.
I tried the easiest ways first, since I need only one group. So:
1. Adding buttons to the addon level group. Nothing changes.
2. Your first suggestion. Still nothing.
3. Your second suggestion. Nope.
In all three cases, there's still one resetting callback for each, the addon level and my "auras" group (both are set to "Blizzard"!). They appear right after the skinning calls (which still seem to work fine and hand the correct skin values to my callback function), but before adding buttons. Behaviour stays the same: My buttons are not skinned after relog/reloadui, but setting the skin manually works fine. I committed the current code to GitHub again.
You have to register the callback before creating the group and/or skinning it.
Sorry for the late reply but I've been kinda busy lately. So what I'm doing now is this:
nivBuffs = CreateFrame("FRAME", "nivBuffs", UIParent)
nivBuffs:SetScript('OnEvent', function(self, event, ...) self[event](self, event, ...) end)
nivBuffs:RegisterEvent("ADDON_LOADED")
local LBF = LibStub('LibButtonFacade', true)
local bfButtons = {}
local BF = LBF and nivBuffDB.useButtonFacade
-- more addon related stuff here --
function nivBuffs:ADDON_LOADED(event, addon)
if (addon ~= 'nivBuffs') then return end
self:UnregisterEvent(event)
ChatFrame1:AddMessage(LBF and "OK" or "LBF missing!")
ChatFrame1:AddMessage(nivBuffDB.useButtonFacade and "OK" or "LBF deactivated!")
-- buttonfacade
if not nivBuffs_BF then nivBuffs_BF = {} end
if BF then
ChatFrame1:AddMessage(nivBuffs_BF.skinID or "?")
LBF:RegisterSkinCallback("nivBuffs", self.BFSkinCallBack, self)
ChatFrame1:AddMessage(nivBuffs_BF.skinID or "?")
bfButtons = LBF:Group("nivBuffs", "auras")
ChatFrame1:AddMessage(nivBuffs_BF.skinID or "?")
bfButtons:Skin(nivBuffs_BF.skinID, nivBuffs_BF.gloss, nivBuffs_BF.backdrop, nivBuffs_BF.colors)
ChatFrame1:AddMessage(nivBuffs_BF.skinID or "?")
end
end
function nivBuffs:BFSkinCallBack(skinID, gloss, backdrop, group, button, colors)
nivBuffs_BF.skinID = skinID
nivBuffs_BF.gloss = gloss
nivBuffs_BF.backdrop = backdrop
nivBuffs_BF.colors = colors
ChatFrame1:AddMessage("Callback: " .. (nivBuffs_BF.skinID or "?"))
end
The output is:
OK
OK
Serenity
Serenity
Serenity
Callback: Serenity
Serenity
Callback: Blizzard
Callback: Blizzard
The buttons are still not being skinned at this point (but they are when I set the skin manually in the BF config). So I think the two resetting callbacks appear before I add my buttons to the group. And now I'm kinda lost again.
**edit:
It's always exactly two resetting callbacks, independent of how many buttons there are to be skinned.
Well I wanted to have that basic thing answered first because posting my code wouldn't make sense if it would be required. Ok so lets start..
In the global namespace of my addon I'm doing this:
local LBF = LibStub('LibButtonFacade', true)
local bfButtons = {}
Then on Player login that:
if not nivBuffs_BF then nivBuffs_BF = {} end
bfButtons = LBF:Group("nivBuffs", "auras")
bfButtons:Skin(nivBuffs_BF.skinID, nivBuffs_BF.gloss, nivBuffs_BF.backdrop, nivBuffs_BF.colors)
LBF:RegisterSkinCallback("nivBuffs", self.BFSkinCallBack, self)
function nivBuffs:BFSkinCallBack(skinID, gloss, backdrop, group, button, colors)
nivBuffs_BF.skinID = skinID
nivBuffs_BF.gloss = gloss
nivBuffs_BF.backdrop = backdrop
nivBuffs_BF.colors = colors
end
nivBuffs_BF is added to the SavedVariables. Checking what is being saved, it contains the settings I picked in ButtonFacade (that would be BF_Serenity skin). Skinning also works good so far.
Now on reloadui / relog, nivBuffs_BF will be loaded correctly with what was saved. I checked that with the table browsing feature of LuaConsole (after commenting out the RegisterSkinCallback call). However, when the callback is active, LuaConsole tells me that the SkinID has been set to "Blizzard". It looks to me that BF set it back to default and called my SkinCallback function which then overwrites my config array with the default values.
Does my addon have to use Ace3 to properly save ButtonFacade settings? Currently I don't use Ace3 and whenever I try to set my saved skin config with Group:Skin() on login, ButtonFacade resets the skin to default..
Do you remember what version you modified it from? Maybe that has something to do with it. I modified r300, but now timer bars disappeared. Thanks.
I modified r294. I'm gonna paste you the whole modified function (all changes bold):
function ClassTimer:GetBuffs(unit, db)
local currentTime = GetTime()
if db.buffs then
local i=1
while true do
local name, _, texture, count, _, duration, endTime, [B]isMineStr[/B] = UnitBuff(unit, i)
if not name then
break
end
[B] local isMine = (isMineStr == 'player')[/B]
if duration and duration > 0 and self.db.profile.Abilities[name] and isMine then
local t = new()
if self.db.profile.Units.sticky.enable and self.db.profile.Sticky[name] then
t.startTime = endTime - duration
t.endTime = endTime
stickyset = true
t.unitname = UnitName(unit)
number = sticky[name..t.unitname] or #sticky+1
sticky[number] = t
sticky[name..t.unitname] = number
elseif isMine then
tmp[#tmp+1] = t
end
t.name = name
t.unit = unit
t.remaining = endTime-currentTime
t.texture = texture
t.duration = duration
t.endTime = endTime
t.count = count
t.isbuff = true
end
i=i+1
end
end
if db.debuffs then
local i=1
while true do
local name, _, texture, count, debuffType, duration, endTime, [B]isMineStr[/B] = UnitDebuff(unit, i)
if not name then
break
end
[B]local isMine = (isMineStr == 'player')[/B]
if duration and duration > 0 and self.db.profile.Abilities[name] and isMine then
local t = new()
if self.db.profile.Units.sticky.enable and self.db.profile.Sticky[name] and isMine then
t.startTime = endTime - duration
t.endTime = endTime
stickyset = true
t.unitname = UnitName(unit)
number = sticky[name..t.unitname] or #sticky+1
sticky[number] = t
sticky[name..t.unitname] = number
elseif isMine then
tmp[#tmp+1] = t
end
t.name = name
t.unit = unit
t.texture = texture
t.duration = duration
t.remaining = endTime-currentTime
t.endTime = endTime
t.count = count
t.dispelType = debuffType
end
i=i+1
end
end
end
Due to broken SPELL_AURA_REFRESH in combat log event bugs may occur in raids or parties where you got someone same as your class, still fine in solo.
Further development is halted until blizzard fix this. I've no intention to invent magic tricks to overcome api problems.
** I guess this explains the duplicate DOTs that I see prior to the fix.
No, as I said, the double DoTs appearing (DoTs from other people) are caused by the changed parameter list of UnitBuff() and UnitDebuff(). Check WoW-Wiki, there's a history of what has been changed in 3.1 for those functions. And my fix doesn't have anything magical in it. :D
The return value "isMine" of both functions has been changed from boolean to string. Since this string is never empty, checking it for boolean always returns true and doesn't filter your own buffs/debuffs.
Hello, thanks for the fix above. I'm not sure if I did something wrong, but there is no more timer bar when I cast DOTs on mobs. I double-checked everything for the fix above. Did you happen to miss something? Thanks.
It works perfectly for me. I have been at Ulduar some hours now and no missing DoTs or DoTs from other people..
Has anyone managed to get this working in 3.1 PTR? It now displays everyone's debuff on the target rather than just your own.
This is a result of the changed return value "isMine" of UnitBuff() and UnitDebuff() in 3.1. It's not simply true or false anymore but a string containing the owner.
How to fix it for yourself:
Open "classtimer.lua", line 362. It looks like this:
Do exactly the same steps at line 395 and the following (note that line 395 calls "UnitDebuff" instead of "UnitBuff", so don't replace the whole line.).
I'll add rested XP in next. Probably in the form of "time till it's all gone" :) As well as the usual numbers..
I'm glad to hear that. :D
Anyways in r5 I'm getting the following error whenever I hover over the display. The tooltip doesn't show.
[23:30:34] Interface\AddOns\Broker_XP\Broker_XP.lua:233: bad argument #3 to 'format' (number expected, got nil)
[C]: ?
[C]: in function `format'
Interface\AddOns\Broker_XP\Broker_XP.lua:233: in function `Tooltip'
Interface\AddOns\Broker_XP\Broker_XP.lua:246: in function `OnTooltipShow'
Interface\AddOns\Broker2FuBar\pluginPrototype.lua:73: in function `OnUpdateFuBarTooltip'
...FuBar\libs\LibFuBarPlugin-3.0\LibFuBarPlugin-3.0.lua:709: in function `UpdateFuBarTooltip'
...FuBar\libs\LibFuBarPlugin-3.0\LibFuBarPlugin-3.0.lua:1309: in function <...FuBar\libs\LibFuBarPlugin-3.0\LibFuBarPlugin-3.0.lua:1304>
Interface\AddOns\FuBar\FuBar.lua:1233: in function <Interface\AddOns\FuBar\FuBar.lua:1230>
0
They do, GitHub messes them up.
And the one protected function BF uses is SetFrameLevel(). It's protected in my case because the icons of the SecureAuraHeader are protected frames.
**edit: I fixed it.
0
I already googled and tried to search this thread here.. The only thing I found was a comment concerning XBar from 2008. The author said he fixed it but didn't say how. I also don't see anything special in his BF integration code other than not executing AddButton() in combat. But I somehow need to be able to do that, or else aura icons created in combat are not skinned..
I tried not to add the (secure) button but only my btn.icon subframe. That works for skinnig but it completely breaks interactivity (removing buffs on right click and showing the tooltip on mouseover). Moreover I wasn't able to test if that fixes the taint error yet.
PS: If you need to play around with the code again, use the r20 tagged version at GitHub, not the latest commit.
0
Thanks alot, it's working now! :D
Though I wonder why it did work for other addons, but not mine..
And also thanks for all your suggestions how to make the groups visible in the UI! However, since I really only need very basic support, I went back to the most simple solution which is perfectly fine for me (skinning the addon level).
0
I tried the easiest ways first, since I need only one group. So:
1. Adding buttons to the addon level group. Nothing changes.
2. Your first suggestion. Still nothing.
3. Your second suggestion. Nope.
In all three cases, there's still one resetting callback for each, the addon level and my "auras" group (both are set to "Blizzard"!). They appear right after the skinning calls (which still seem to work fine and hand the correct skin values to my callback function), but before adding buttons. Behaviour stays the same: My buttons are not skinned after relog/reloadui, but setting the skin manually works fine. I committed the current code to GitHub again.
0
https://github.com/nivaya/nivBuffs
**edit:
I also made sure that the buttons are actually added AFTER the group initialisation (latest commit), but still the same behaviour.
0
Sorry for the late reply but I've been kinda busy lately. So what I'm doing now is this:
The output is:
OK
OK
Serenity
Serenity
Serenity
Callback: Serenity
Serenity
Callback: Blizzard
Callback: Blizzard
The buttons are still not being skinned at this point (but they are when I set the skin manually in the BF config). So I think the two resetting callbacks appear before I add my buttons to the group. And now I'm kinda lost again.
**edit:
It's always exactly two resetting callbacks, independent of how many buttons there are to be skinned.
0
In the global namespace of my addon I'm doing this:
Then on Player login that:
All my buttons are being added to the group with:
And the skin change callback function:
nivBuffs_BF is added to the SavedVariables. Checking what is being saved, it contains the settings I picked in ButtonFacade (that would be BF_Serenity skin). Skinning also works good so far.
Now on reloadui / relog, nivBuffs_BF will be loaded correctly with what was saved. I checked that with the table browsing feature of LuaConsole (after commenting out the RegisterSkinCallback call). However, when the callback is active, LuaConsole tells me that the SkinID has been set to "Blizzard". It looks to me that BF set it back to default and called my SkinCallback function which then overwrites my config array with the default values.
0
0
0
Thanks in advance,
Luzzifus.
0
I modified r294. I'm gonna paste you the whole modified function (all changes bold):
No, as I said, the double DoTs appearing (DoTs from other people) are caused by the changed parameter list of UnitBuff() and UnitDebuff(). Check WoW-Wiki, there's a history of what has been changed in 3.1 for those functions. And my fix doesn't have anything magical in it. :D
The return value "isMine" of both functions has been changed from boolean to string. Since this string is never empty, checking it for boolean always returns true and doesn't filter your own buffs/debuffs.
0
It works perfectly for me. I have been at Ulduar some hours now and no missing DoTs or DoTs from other people..
0
This is a result of the changed return value "isMine" of UnitBuff() and UnitDebuff() in 3.1. It's not simply true or false anymore but a string containing the owner.
How to fix it for yourself:
Open "classtimer.lua", line 362. It looks like this:
Change it to:
The following lines are:
After these, add:
Do exactly the same steps at line 395 and the following (note that line 395 calls "UnitDebuff" instead of "UnitBuff", so don't replace the whole line.).
0
0
I'm glad to hear that. :D
Anyways in r5 I'm getting the following error whenever I hover over the display. The tooltip doesn't show.