WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   oUF_DebuffHighlight (https://www.wowinterface.com/forums/showthread.php?t=56032)

zork 02-10-18 05:42 AM

oUF_DebuffHighlight
 
I needed a module to highlight textures if a unit is affected by a dispellable debuff with the option to show the glow even with the unit not being able dispell the debuff itself.

https://imgur.com/a/wUYYx

I revised oUF_DebuffHighlight for that case.
https://github.com/zorker/rothui/blo...fHighlight.lua

It either displays a texture, colors a texture or colors a backdrop.

My implementation for oUF_Simple is to use the health backdrop border as a highlight texture.
https://github.com/zorker/rothui/com...23f7eaa7f5f7cc

What I'm not sure about is this
Lua Code:
  1. local CanDispel = {
  2.   PRIEST = { Magic = true, Disease = true, },
  3.   SHAMAN = { Magic = true, Curse = true, },
  4.   PALADIN = { Magic = true, Poison = true, Disease = true, },
  5.   MAGE = { Curse = true, },
  6.   DRUID = { Magic = true, Curse = true, Poison = true, },
  7.   MONK = { Magic = true, Disease = true, Poison = true, }
  8. }

I bet that has changed.

*edit* That is odd. I thought I posted it in the oUF forum. Wlep!

Resike 02-10-18 12:47 PM

I don't think it would be this easy, since some dispels are spec based.

Rainrider 02-11-18 02:43 PM

If you want to use oUF_Dispellable for this, here is some sample code how to use backdrops with it. However, if the class cannot dispel at all (DKs, rogues, warriors), oUF_Dispellable will completely disable itself. While I don't understand why you want to highlight the whole frame based on a debuff type that is undispellable by the player, you could use a check like IsElementEnabled('Dispellable') and then use oUF's PostUpdateIcon to get the debuff type.

If you dislike this, oUF_Dispellable uses LibPlayerSpells-1.0 to fetch the list of possible dispel spells for the player's class. Feel free to use oUF_Dispellable's code if you want to use this approach but code your own DebuffHighlight element. If you consider the 616 KB static memory use of LPS a waste, you can just use it to build you own table with dispel spell IDs. The dispels are based on spec and honor talents, some are self-dispels only and for warlocks some depend on the currently summoned demon. Keep in mind that LPS does not differentiate between pet and player as a spell source, you have to read the code comments for those special cases for the warlock class.

zork 02-11-18 03:28 PM

I want it for the coloring because I really like that glow. Not sure how PostUpdateIcon would help here. I'm totally fine with a generic true/false for the optional dispell class table. It is fine in most cases.

Resike 02-11-18 04:10 PM

Quote:

Originally Posted by zork (Post 326826)
I want it for the coloring because I really like that glow. Not sure how PostUpdateIcon would help here. I'm totally fine with a generic true/false for the optional dispell class table. It is fine in most cases.

The unit frame glow is specially useful for raid frames or frames with no debuff frame.

Rainrider 02-12-18 05:23 AM

Then I don't understand. If you use a backdrop, use .UpdateColor. What is the problem with that?

zork 02-12-18 07:09 AM

I would totally do that if I wanted a module that only shows dispellable glows.

Rainrider 02-12-18 07:14 AM

What else should it display then?

thomasjohnshannon 02-12-18 07:48 AM

Quote:

Originally Posted by zork (Post 326801)
What I'm not sure about is this
Lua Code:
  1. local CanDispel = {
  2.   PRIEST = { Magic = true, Disease = true, },
  3.   SHAMAN = { Magic = true, Curse = true, },
  4.   PALADIN = { Magic = true, Poison = true, Disease = true, },
  5.   MAGE = { Curse = true, },
  6.   DRUID = { Magic = true, Curse = true, Poison = true, },
  7.   MONK = { Magic = true, Disease = true, Poison = true, }
  8. }

I bet that has changed.

It is mostly ok but only the healing specs can dispel magic debuffs and mages can't remove curses anymore. Just setup an OnEvent function to check for player spec and it will be fine.

zork 02-12-18 07:53 AM

Maybe the first post was misleading.

The old oUF_DebuffHighlight allowed to display a texture, color a texture/backdrop/backdropBorder if any unit was effected by a debuff of type (Magic, Curse, Disease, Poison). Optionally you could enable a filter so only classes that could dispel that debuffType would see it. That is exactly what I needed. I just updated the module.

My personal class of choice (prot warr) cannot dispell the debuff (well my Dwarf could) yet I still want to see that debuff glow. I used it in oUF_Diablo too. If I got poisoned the orb got a green glow that instantly told me that something just poisoned me. It is a nice touch.

Rainrider 02-12-18 01:39 PM

I didn't mean to advertise for my oUF element, I just thought I misunderstood your use case and failed to provide a common functionality desired by layout authors. I'm glad you have it as you like it now, thanks for taking the time to explain.


All times are GMT -6. The time now is 07:53 AM.

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