WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   oUF (Otravi Unit Frames) (https://www.wowinterface.com/forums/forumdisplay.php?f=87)
-   -   oUF Phanx modifications, new to lua (https://www.wowinterface.com/forums/showthread.php?t=43377)

ampere 04-30-12 08:18 PM

oUF Phanx modifications, new to lua
 
Hi, I was looking for some help at modifying the code for the addon oUF Phanx (found here). I am not particularly familiar with lua editing, the extent of what I have done in the past is editing the Yorsahj raid warnings addon to say the messages I wanted.

A summary of the things I wanted to change so that people can advise me better:

Add a threat percentage attached to the target frame (similar to the optional one on standard Blizzard frames).
When out of combat, display all buffs such as mounts, costumes, etc on the target frame.

I understand why the addon author chose to not include certain features, but I really like the basic set up of the addon and just want to make a few modifications so that it works for me.

Any advice or tips are much appreciated, thanks.

edit: Suppose I should also mention that I would like to change some of the buffs/debuffs that display for certain classes while in combat.

Phanx 04-30-12 10:19 PM

Quote:

Originally Posted by ampere (Post 256041)
Add a threat percentage attached to the target frame (similar to the optional one on standard Blizzard frames).

This is actually something I plan to add. I just haven't gotten around to it yet.

Quote:

Originally Posted by ampere (Post 256041)
When out of combat, display all buffs such as mounts, costumes, etc on the target frame.

You'd need to register the PLAYER_REGEN_DISABLED and PLAYER_REGEN_ENABLED events on the target frame's Buff element, and handle them with a function that removed the filter while out of combat, and reapplied it when entering combat. This is also something I've considered, but haven't decided whether I want to add, or in what form.

Quote:

Originally Posted by ampere (Post 256041)
I should also mention that I would like to change some of the buffs/debuffs that display for certain classes while in combat.

The aura filtering uses simple lists, which you can see in the auras.lua file. To add more buffs or debuffs, just add them to the list with the relevant value to control how you want it filtered (there's an explanation at the top of the file). To find the correct spell ID for the buff or debuff, look it up on Wowhead and copy the number in the URL.

Mordekai03 10-11-12 12:39 AM

Quote:

Originally Posted by Phanx (Post 256042)
You'd need to register the PLAYER_REGEN_DISABLED and PLAYER_REGEN_ENABLED events on the target frame's Buff element, and handle them with a function that removed the filter while out of combat, and reapplied it when entering combat. This is also something I've considered, but haven't decided whether I want to add, or in what form.

Just wanted to say that I would be in favor of this change. It would make your unit frames pretty much perfect for me. I definitely don't know enough about coding to do it myself.

Lysiander 10-17-12 12:04 AM

Quote:

You'd need to register the PLAYER_REGEN_DISABLED and PLAYER_REGEN_ENABLED events on the target frame's Buff element, and handle them with a function that removed the filter while out of combat, and reapplied it when entering combat. This is also something I've considered, but haven't decided whether I want to add, or in what form.
Just out of curiosity, since i use something similar in my layout, wouldn't it be more efficient to just add a combat check to the filter itself instead of changing the filter? Both ways work fine obviously, im just wondering about performance here.

Phanx 10-17-12 03:20 AM

Quote:

Originally Posted by Lysiander (Post 266958)
... wouldn't it be more efficient to just add a combat check to the filter itself instead of changing the filter?

No, that would just add an extra function call on every single aura change for every unit. That's a lot of extra function calls. Much simpler to just change one table value per frame when entering or leaving combat.

Lysiander 10-17-12 02:02 PM

Interesting. Thanks for the info. I do believe I have some updating to do now. ;)


All times are GMT -6. The time now is 10:14 AM.

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