WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   oUF (Otravi Unit Frames) (https://www.wowinterface.com/forums/forumdisplay.php?f=87)
-   -   Cancel Aura (https://www.wowinterface.com/forums/showthread.php?t=38479)

MMOGames 01-19-11 07:43 PM

Cancel Aura
 
There is no way to cancelaura by right clicking the buff using Ouf anymore?

Freebaser 01-20-11 03:24 AM

With 4.0.6 we will be able to when out of combat. Right now, no.

Pyrates 01-20-11 04:03 AM

You could kinda worka around that by overwriting the function UpdateAllBuffAnchors (that's not protected), and anchor all the buffs to your player frame, make them look the way you want, hide some and stuff... then they'll be right-clickable even in combat.

MMOGames 01-22-11 10:58 AM

Quote:

Originally Posted by Pyrates (Post 227206)
You could kinda worka around that by overwriting the function UpdateAllBuffAnchors (that's not protected), and anchor all the buffs to your player frame, make them look the way you want, hide some and stuff... then they'll be right-clickable even in combat.

Can you give me an example?

MMOGames 01-22-11 10:59 AM

Quote:

Originally Posted by Freebaser (Post 227205)
With 4.0.6 we will be able to when out of combat. Right now, no.

Isnt there a workaroung since i dont want the addon to cancel for me. I want to click and cancel it

haste 01-22-11 04:53 PM

You have to use the SecureAuraHeader. There isn't an element for it in oUF yet, because the API is cumbersome to work with, and it doesn't provide too much flexibility for layout others.

Right now it's better to manage it all from the layout. Unless I get some great idea for a solution.

Pyrates 01-24-11 07:15 AM

Quote:

Originally Posted by MMOGames (Post 227440)
Can you give me an example?

Ok, this is c&p from a working addon, so it might not actually work, but give you the idea. I think I was wrong with UpdateAllBuffAnchors being not protected, by one can securehook it and then just redo everything it does anyways. The lines marked with "--SAF" are new code, they change the anchors because some of the buffs might be hidden, and you don't want an empty space (this is done in another portion of the code). But what you can do is just replace the "SetPoint" executions by some that you like (maybe you'd need to use ClearAllPoint() first) and anchor the buffs to your ouf_player frame:

Code:


local function MyBuffFrame_UpdateAllBuffAnchors()
        local buff, previousBuff, aboveBuff;
        local numBuffs = 0;
        local hidden = 0; -- SAF
        local slack = BuffFrame.numEnchant or 0
        local inde = 0;
       
        if ( BuffFrame.numConsolidated > 0 ) then
                slack = slack + 1;        -- one icon for all consolidated buffs
        end
       
        for i = 1, BUFF_ACTUAL_DISPLAY do
                buff = _G["BuffButton"..i];
                if not buff:IsShown() then --SAF
                        hidden = hidden + 1 --SAF
                        numBuffs = numBuffs + 1; --SAF
                else
                        if ( buff.consolidated ) then       
                                if ( buff.parent == BuffFrame ) then
                                        buff:SetParent(ConsolidatedBuffsContainer);
                                        buff.parent = ConsolidatedBuffsContainer;
                                end
                        else
                                numBuffs = numBuffs + 1;
                                inde = numBuffs + slack;
                                if ( buff.parent ~= BuffFrame ) then
                                        buff.count:SetFontObject(NumberFontNormal);
                                        buff:SetParent(BuffFrame);
                                        buff.parent = BuffFrame;
                                end
                                buff:ClearAllPoints();
                                if ( (inde > 1) and (mod(inde, BUFFS_PER_ROW) == 1) ) then
                                        -- New row
                                        if ( inde == BUFFS_PER_ROW+1 ) then
                                                buff:SetPoint("TOP", ConsolidatedBuffs, "BOTTOM", 0, -BUFF_ROW_SPACING);
                                        else
                                                buff:SetPoint("TOP", aboveBuff, "BOTTOM", 0, -BUFF_ROW_SPACING);
                                        end
                                        aboveBuff = buff;
                                elseif ( inde == 1 ) then
                                        buff:SetPoint("TOPRIGHT", BuffFrame, "TOPRIGHT", 0, 0);
                                else
                                        if ( numBuffs == 1 ) then
                                                if ( BuffFrame.numEnchants > 0 ) then
                                                        buff:SetPoint("TOPRIGHT", "TemporaryEnchantFrame", "TOPLEFT", -5, 0);
                                                else
                                                        buff:SetPoint("TOPRIGHT", ConsolidatedBuffs, "TOPLEFT", -5, 0);
                                                end
                                        else
                                                buff:SetPoint("RIGHT", previousBuff, "LEFT", -5, 0);
                                        end
                                end
                                previousBuff = buff;
                        end
                end --SAF
        end

        if ( ConsolidatedBuffsTooltip:IsShown() ) then
                ConsolidatedBuffs_UpdateAllAnchors();
        end
end

hooksecurefunc("BuffFrame_UpdateAllBuffAnchors",MyBuffFrame_UpdateAllBuffAnchors)



All times are GMT -6. The time now is 07:39 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI