Go to Page... |
Updated: | 10-18-10 01:00 PM |
Created: | unknown |
Downloads: | 29,928 |
Favorites: | 157 |
MD5: |
This is an addon that adds Debuff Highlighting to the oUF unitframes.
Whenever a unit has a debuff it will highlight the frame in the debuff color. This can be done either on
the unitframe background or a specially created frame for the task.
To use this in your oUF layout you will need one of the following:
self.DebuffHighlightBackdrop = true
local dbh = self:CreateTexture(nil, "OVERLAY") dbh:SetAllPoints(self) dbh:SetTexture("SomeKindOfTexturepath") dbh:SetBlendMode("ADD") dbh:SetVertexColor(0,0,0,0) -- set alpha to 0 to hide the texture self.DebuffHighlight = dbh
local dbh = hp:CreateTexture(nil, "OVERLAY")
self.DebuffHighlightAlpha = .5
self.DebuffHighlightFilter = true
local dbh = hp:CreateTexture(nil, "OVERLAY") dbh:SetWidth(32) dbh:SetHeight(32) dbh:SetPoint("CENTER", self, "CENTER") self.DebuffHighlight = dbh
self.DebuffHighlightUseTexture = true
Comment Options |
03-02-11, 04:40 PM | |
A Defias Bandit
Forum posts: 3
File comments: 25
Uploads: 0
|
And these talent checks do not work currently for me (german client)
|
|
ylarion |
View Public Profile |
Send a private message to ylarion |
Find More Posts by ylarion |
Add ylarion to Your Buddy List |
memnoch |
View Public Profile |
Send a private message to memnoch |
Find More Posts by memnoch |
Add memnoch to Your Buddy List |
02-27-11, 04:37 AM | |
A Defias Bandit
Forum posts: 3
File comments: 25
Uploads: 0
|
On a german client i cannot get my resto shaman to highlight magic debuffs. If i change the value in the CanDispel to true it works, but somehow the Talentcheck doesnt seem to work.
|
|
ylarion |
View Public Profile |
Send a private message to ylarion |
Find More Posts by ylarion |
Add ylarion to Your Buddy List |
12-15-10, 07:18 AM | ||
|
Here's the code for my layout's raid frame: lua Code:
Last edited by drakull : 12-15-10 at 07:27 AM.
|
|
|
drakull |
View Public Profile |
Send a private message to drakull |
Find More Posts by drakull |
Add drakull to Your Buddy List |
11-23-10, 10:27 PM | |
A Kobold Labourer
Forum posts: 0
File comments: 5
Uploads: 0
|
Quick question..
Does it matter what unitframe your using? Also, i'm new at this but what do you do to make the health frame light up when a debuff is on you? |
|
Xposed |
View Public Profile |
Send a private message to Xposed |
Find More Posts by Xposed |
Add Xposed to Your Buddy List |
11-17-10, 03:44 AM | ||
|
|
|
|
Ammo |
View Public Profile |
Send a private message to Ammo |
Find More Posts by Ammo |
Add Ammo to Your Buddy List |
10-28-10, 04:36 AM | |
A Kobold Labourer
Forum posts: 0
File comments: 1
Uploads: 0
|
I currently have borders around my health and power frames. For some reason the backdrop/backdrop border doesn't get highlighted properly and sometimes don't show up at all. But if i get rid of the borders it works fine. Any help would be appreciated. Thx
|
|
monkie |
View Public Profile |
Send a private message to monkie |
Find More Posts by monkie |
Add monkie to Your Buddy List |
10-17-10, 11:37 AM | |
|
The "CanDispel" table is not updated to 4.0.
Code:
local CanDispel = { PRIEST = { Magic = true, Disease = true, }, SHAMAN = { Poison = true, Disease = true, Curse = true, }, PALADIN = { Magic = true, Poison = true, Disease = true, }, MAGE = { Curse = true, }, DRUID = { Curse = true, Poison = true, } } Code:
local CanDispel = { PRIEST = { Magic = true, Disease = true }, SHAMAN = { Magic = true, Curse = true }, PALADIN = { Magic = true, Poison = true, Disease = true }, MAGE = { Curse = true }, DRUID = { Magic = true, Curse = true, Poison = true } } Edit: took too long to post. Elv22 was faster.
Last edited by drakull : 10-17-10 at 11:39 AM.
|
|
drakull |
View Public Profile |
Send a private message to drakull |
Find More Posts by drakull |
Add drakull to Your Buddy List |
10-17-10, 10:45 AM | |
|
Update
Hi there, I went ahead and updated this myself when I was on the PTR, because some classes like paladin, shaman, druid don't get dispel magic unless they are a healer spec, this can cause the debuff highlight to become inaccurate. I went ahead and made it so we check everytime you fill in new talent points, respec, ect.. it checks if you have a certain talent point in your spec in order to show magic for a few select classes.
Paladin: You need Sacred Cleansing Shaman: You need Improved Cleanse Spirit Druid: You need natures cure Code:
if not oUF then return end local playerClass = select(2,UnitClass("player")) local CanDispel = { PRIEST = { Magic = true, Disease = true, }, SHAMAN = { Magic = false, Curse = true, }, PALADIN = { Magic = false, Poison = true, Disease = true, }, MAGE = { Curse = true, }, DRUID = { Magic = false, Curse = true, Poison = true, } } local dispellist = CanDispel[playerClass] or {} local origColors = {} local origBorderColors = {} local origPostUpdateAura = {} local function GetDebuffType(unit, filter) if not UnitCanAssist("player", unit) then return nil end local i = 1 while true do local _, _, texture, _, debufftype = UnitAura(unit, i, "HARMFUL") if not texture then break end if debufftype and not filter or (filter and dispellist[debufftype]) then return debufftype, texture end i = i + 1 end end -- Return true if the talent matching the name of the spell given by (Credit Pitbull4) -- spellid has at least one point spent in it or false otherwise function CheckForKnownTalent(spellid) local wanted_name = GetSpellInfo(spellid) if not wanted_name then return nil end local num_tabs = GetNumTalentTabs() for t=1, num_tabs do local num_talents = GetNumTalents(t) for i=1, num_talents do local name_talent, _, _, _, current_rank = GetTalentInfo(t,i) if name_talent and (name_talent == wanted_name) then if current_rank and (current_rank > 0) then return true else return false end end end end return false end local function CheckSpec(self, event, levels) -- Not interested in gained points from leveling if event == "CHARACTER_POINTS_CHANGED" and levels > 0 then return end --Check for certain talents to see if we can dispel magic or not if playerClass == "PALADIN" then --Check to see if we have the 'Sacred Cleansing' talent. if CheckForKnownTalent(53551) then dispellist.Magic = true else dispellist.Magic = false end elseif playerClass == "SHAMAN" then --Check to see if we have the 'Improved Cleanse Spirit' talent. if CheckForKnownTalent(77130) then dispellist.Magic = true else dispellist.Magic = false end elseif playerClass == "DRUID" then --Check to see if we have the 'Nature's Cure' talent. if CheckForKnownTalent(88423) then dispellist.Magic = true else dispellist.Magic = false end end end local function Update(object, event, unit) if object.unit ~= unit then return end local debuffType, texture = GetDebuffType(unit, object.DebuffHighlightFilter) if debuffType then local color = DebuffTypeColor[debuffType] if object.DebuffHighlightBackdrop then object:SetBackdropColor(color.r, color.g, color.b, object.DebuffHighlightAlpha or 1) elseif object.DebuffHighlightUseTexture then object.DebuffHighlight:SetTexture(texture) else object.DebuffHighlight:SetVertexColor(color.r, color.g, color.b, object.DebuffHighlightAlpha or .5) end else if object.DebuffHighlightBackdrop then local color = origColors[object] object:SetBackdropColor(color.r, color.g, color.b, color.a) color = origBorderColors[object] object:SetBackdropBorderColor(color.r, color.g, color.b, color.a) elseif object.DebuffHighlightUseTexture then object.DebuffHighlight:SetTexture(nil) else local color = origColors[object] object.DebuffHighlight:SetVertexColor(color.r, color.g, color.b, color.a) end end end local function Enable(object) -- if we're not highlighting this unit return if not object.DebuffHighlightBackdrop and not object.DebuffHighlight then return end -- if we're filtering highlights and we're not of the dispelling type, return if object.DebuffHighlightFilter and not CanDispel[playerClass] then return end -- make sure aura scanning is active for this object object:RegisterEvent("UNIT_AURA", Update) object:RegisterEvent("PLAYER_TALENT_UPDATE", CheckSpec) object:RegisterEvent("CHARACTER_POINTS_CHANGED", CheckSpec) if object.DebuffHighlightBackdrop then local r, g, b, a = object:GetBackdropColor() origColors[object] = { r = r, g = g, b = b, a = a} r, g, b, a = object:GetBackdropBorderColor() origBorderColors[object] = { r = r, g = g, b = b, a = a} elseif not object.DebuffHighlightUseTexture then -- color debuffs -- object.DebuffHighlight local r, g, b, a = object.DebuffHighlight:GetVertexColor() origColors[object] = { r = r, g = g, b = b, a = a} end return true end local function Disable(object) if object.DebuffHighlightBackdrop or object.DebuffHighlight then object:UnregisterEvent("UNIT_AURA", Update) object:UnregisterEvent("PLAYER_TALENT_UPDATE", CheckSpec) object:UnregisterEvent("CHARACTER_POINTS_CHANGED", CheckSpec) end end oUF:AddElement('DebuffHighlight', Update, Enable, Disable) for i, frame in ipairs(oUF.objects) do Enable(frame) end
Last edited by Elv22 : 10-17-10 at 10:47 AM.
|
|
Elv22 |
View Public Profile |
Send a private message to Elv22 |
Find More Posts by Elv22 |
Add Elv22 to Your Buddy List |
09-11-09, 01:07 PM | |
A Deviate Faerie Dragon
Forum posts: 14
File comments: 61
Uploads: 0
|
hey
sry, i am a total lua noob.... in which file i have to put "self.DebuffHighlightFilter = true" for filtering the debuffs? thx xark |
|
Xark |
View Public Profile |
Send a private message to Xark |
Find More Posts by Xark |
Add Xark to Your Buddy List |
08-24-09, 02:30 AM | |
|
Has anyone had any issues getting this working lately with the Pitbull-esque glow texture?
I tried messing around for a bit with no success, though verifying the texture was loaded and in the proper place. I also tried installing Ammo's layout just to see if it worked and had no luck. |
|
Subere |
View Public Profile |
Send a private message to Subere |
Find More Posts by Subere |
Add Subere to Your Buddy List |
06-26-09, 09:11 AM | ||
|
-Ammo |
|
|
Ammo |
View Public Profile |
Send a private message to Ammo |
Find More Posts by Ammo |
Add Ammo to Your Buddy List |
06-25-09, 05:44 AM | |
|
Hi, thanks anyway. I duplicated the addon, did a search replace on "DebuffHighlight" for "HOTHightlight" and then just changed your UnitAura's checking to only check for specific spells, and force a single color.
I then just added it to my layout, so I use 1 overlay texture for debuffs, and a second one (that doesn't overlap with the debuff one) for the HOT one. :-) Thanks for this addon though. ^_^ |
|
Elariah |
View Public Profile |
Send a private message to Elariah |
Find More Posts by Elariah |
Add Elariah to Your Buddy List |
06-24-09, 07:31 AM | ||
|
Try oUF_Indicators or something. |
|
|
Ammo |
View Public Profile |
Send a private message to Ammo |
Find More Posts by Ammo |
Add Ammo to Your Buddy List |
06-23-09, 01:09 PM | |
|
Is it possible to have another version for tracking when a unit has a Heal over Time on them?
|
|
Elariah |
View Public Profile |
Send a private message to Elariah |
Find More Posts by Elariah |
Add Elariah to Your Buddy List |