• 0

    posted a message on kgPanels Offical Thread
    Bah. For some reason, it seems weapon imbues do not work today. I am printing the amount of buffs caught from UnitBuff, and it obviously is not counting shaman weapon imbues (tested). So, I will turn to Satrina's Buff Frame's author to help me a bit here, as you suggested. Will post the result here eventually.
    Posted in: General AddOns
  • 0

    posted a message on kgPanels Offical Thread
    Either self:RegisterEvent( "UNIT_AURASTATE" ) did the trick or simply ui reload was needed. The other RegisterEvent doesn't hurt there, so too lazy to test without :)
    Posted in: General AddOns
  • 0

    posted a message on kgPanels Offical Thread
    Quote from ImpalerCore
    This code is untested since I'm not at a wow client, but it would be my first stab at trying to do it.


    Consider it tested - and you, sir, are my hero :)
    The width works like a dream now, only need to tweak it for perfection. Also, thank you for pointing out, that I had completely missed the fact, that the API-function I tried to use had been removed recently.

    One minor tweak, which I might overlook and let it stay elsewhere with other "buff"-frame is shaman weapon imbues, since at least those are not counted with UnitBuff-function. Also, have not been able to test out, how does Wintergrasp work, but I assume the function doesn't count that as a buff either.

    So, if I don't find out how to include those into buff count, I will just ignore it, make another buff frame for rest of the non-buff-buffs, and treat them separately without a kgPanels-background.

    Thank you for your thorough input and swift reply!
    Posted in: General AddOns
  • 0

    posted a message on kgPanels Offical Thread
    I tried searching from this thread as well as with Google, but either I am blind or maybe my problem has not been encountered with yet.

    So, I am trying to create a background frame with KgPanels for Satrinas Buff Frames - Buffs and Debufs separately. I would like the width of the frames be dynamic depending of the amount of the buffs / debuffs.

    I have added script for OnLoad:
    self:RegisterEvent("UNIT_AURA")

    -- do i also need self:RegisterEvent("UNIT_AURASTATE") or does Unit_aura already include shorter duration buffs too?

    on OnEvent I have (modified from http://forums.curseforge.com/archive/index.php/t-11276-p-3.html)

    local buffIndex

    if event == "UNIT_AURA" and arg1 == "player" then
    self:Hide()
    for index = 1, 40 do
    buffIndex = GetPlayerBuff(index, "HELPFUL")
    end
    end

    if buffIndex < 1 then
    self:Hide()
    else
    self:SetWidth(buffIndex * 50)
    self:Show()
    end


    The OnEvent script onviously doesn't work, giving error message of:
    [string "buffs1_OnEvent"]:6: attempt to call global 'GetPlayerBuff' (a nil value)

    I am also wondering arg1 - should it be declared or is it common API command or something?

    I also tried with following OnEvent script, with as poor results:
    local buffs, i = { }, 1;
    local buff = UnitBuff("player", i);
    while buff do
    buffs[#buffs + 1] = buff;
    i = i + 1;
    buff = UnitBuff("player", i);
    end;

    if #buffs < 1 then
    self:Hide()
    else
    self:SetWidth(buffs[1] * 50)
    self:Show()
    end


    would anyone care to lend me a hand and point me to right / better direction, pretty please with sugar on the top?
    Posted in: General AddOns
  • To post a comment, please or register a new account.