Thread Tools Display Modes
05-17-09, 01:10 AM   #1
PerfectH
A Flamescale Wyrmkin
 
PerfectH's Avatar
AddOn Compiler - Click to view compilations
Join Date: Jan 2008
Posts: 137
Fullscreen Glow For Debuffs - Need Help

So I'm considering writing my first AddOn and I have an idea of what I want it to do.

Pretty simple; if I have a poison debuff, disease debuff, or a hostile magic effect, I want the screen to tint a certain color accordingly.

Normal view of the UI:


Poison effect:



Disease effect:


Magic effect:


Of course these are really poorly drawn out examples, but I do want it to look something like that. If you remember playing Diablo 2 and if you got a chill effect or a poison effect, your screen would tint accordingly. I want this to happen for WoW. Eventually, I will incorporate configurations for the AddOn such as minimal duration (Ignore debuffs that are less than X seconds). But first, I need to get this AddOn off the ground...

...I just don't know how. I did the tutorial that Blizzard provides and it does have me get a small understanding on how AddOns work, but I need to know where to get references for this kind of thing. I have no idea where to start, what to write, or any of that. If any of you AddOn authors could generously help me start my first AddOn, I will donate a small amount of US Dollars to you via PayPal.

Thank you.
__________________
I might fail at AddOn creativity...but damn do I love Coca-Cola!
  Reply With Quote
05-17-09, 09:25 AM   #2
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,925
You might want to see if you can utilise SetBackdropColor function on UIParent to color the screen that way.

http://www.wowwiki.com/API_Frame_SetBackdropColor

I've not tried it myself but I assume UIParent is based on Frame of some sort and should be able to use this function.
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
  Reply With Quote
05-17-09, 10:08 AM   #3
kraftman
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Dec 2008
Posts: 63
hook the UNIT_AURA event and check for the debufftype

something like

Code:
local DebuffColor = {"none"	= { r = 0.80, g = 0, b = 0 },
					"Magic"	= { r = 0.20, g = 0.60, b = 1.00 },
					"Curse"	= { r = 0.60, g = 0.00, b = 1.00 },
					"Disease"	= { r = 0.60, g = 0.40, b = 0 },
					"Poison"	= { r = 0.00, g = 0.60, b = 0 },
					""	= DebuffTypeColor["none"] }

local frame = CreateFrame("Frame")
local function ScanDebuffs(self, event, unit, ...)
	if unit == "player" then
	local found
		for i = 1, DEBUFF_MAX_DISPLAY do
			debufftype = select(5, UnitAura("player", i, "HARMFUL"))
			if debufftype then
				found = true
				local c = DebuffColor[debufftype]
				--change the color of whatever to c.r, c.g, c.b
			end
		end
		if not found then
			--no debuffs so reset the colour to normal
		end
	end
end
might work. However if you had mutliple debuffs, the colour would be changed to the last debuff found every time.

I guess you'll have to decide how you would like it to handle multiple debuff types.
  Reply With Quote
05-17-09, 10:43 PM   #4
Exawatt
An Aku'mai Servant
AddOn Author - Click to view addons
Join Date: Feb 2009
Posts: 36
Continuing from kraftman; you could use four individual frames to achieve multiple colors, then control whether they're hidden or not with the checks (instead of changing colors on a single frame).

(But red+green won't look so hot. D2 knew that. One color at a time.)
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Fullscreen Glow For Debuffs - Need Help

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off