• 0

    posted a message on ButtonFacade (was LibButtonSkin-1.0)
    Quote from StormFX
    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.

    **edit: I fixed it.
    Posted in: General AddOns
  • 0

    posted a message on ButtonFacade (was LibButtonSkin-1.0)
    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.
    Posted in: General AddOns
  • 0

    posted a message on ButtonFacade (was LibButtonSkin-1.0)
    Quote from StormFX
    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).
    Posted in: General AddOns
  • 0

    posted a message on ButtonFacade (was LibButtonSkin-1.0)
    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.
    Posted in: General AddOns
  • 0

    posted a message on ButtonFacade (was LibButtonSkin-1.0)
    You can get it directly from GitHub:

    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.
    Posted in: General AddOns
  • 0

    posted a message on ButtonFacade (was LibButtonSkin-1.0)
    Quote from StormFX
    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.
    Posted in: General AddOns
  • 0

    posted a message on ButtonFacade (was LibButtonSkin-1.0)
    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)


    All my buttons are being added to the group with:
    bfButtons:AddButton(btn, { Icon = btn.tx, Cooldown = btn.cd } )


    And the skin change callback function:
    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.
    Posted in: General AddOns
  • 0

    posted a message on ButtonFacade (was LibButtonSkin-1.0)
    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..
    Posted in: General AddOns
  • 0

    posted a message on ClosetGnome - Wear it or lose it.
    There is no ignore option for me in the flyout, only an empty slot option.
    Posted in: General AddOns
  • 0

    posted a message on Dual Spec and "Gear Manager" coming in 3.1 PTR
    Assumed I would need a list of the items (item links) contained in each set for one of my addons, how would I do that?

    Thanks in advance,
    Luzzifus.
    Posted in: General Chat
  • 0

    posted a message on ClassTimer - Official thread
    Quote from dragonwang
    Luzzifus:

    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.
    Posted in: General AddOns
  • 0

    posted a message on ClassTimer - Official thread
    Quote from dragonwang
    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..
    Posted in: General AddOns
  • 0

    posted a message on ClassTimer - Official thread
    Quote from waallen
    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:
    local name, _, texture, count, _, duration, endTime, [B]isMine [/B]= UnitBuff(unit, i)
    Change it to:

    local name, _, texture, count, _, duration, endTime, [B]isMineStr[/B] = UnitBuff(unit, i)
    The following lines are:

    if not name then
      break
    end
    After these, add:
    local isMine = (isMineStr == 'player')
    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.).
    Posted in: General AddOns
  • 0

    posted a message on Broker XP
    Works great now, thanks alot!
    Posted in: Data Broker AddOns
  • 0

    posted a message on Broker XP
    Quote from cpw11
    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>
    Posted in: Data Broker AddOns
  • To post a comment, please or register a new account.