10-22-10, 10:21 AM | #1 |
Lunar/Solar eclipse glowing border
I wanted to create a visual hint when the player gains the Eclipse buff so I tried to make eclipseBar's border to glow blue or yellow (depending on the buff) while the player has it. The way i found do accomplish this was to hook the UNIT_AURA event and check eclipsebar's properties "hasSolarEclipse" and "hasLunarEclipse".
The problem is, the moment I get the eclipse buff and the UNIT_AURA event is triggered, the corresponding property isn't yet set to true and so the border color isn't changed. If I trigger the aura event again after that (e.g. by buffing myself) the properties are already set. It seems that the event is triggered before oUF updates eclipsebar's properties. I wonder if there's a better way to do this. I tried finding a better event but all i got was "ECLIPSE_DIRECTION_CHANGE", which just triggers when the player gains the buff, but not when he loses it. Here's my eclipsebar code: lua Code:
|
|
10-22-10, 11:01 AM | #2 |
You should try reading the eclipsebar element code. I added post-event functionality that you can use in your layout for just such a scenario:
Code:
self.EclipseBar.PostUpdatePower = function(element, unit) -- do stuff here after UNIT_POWER has been processed end Code:
self.EclipseBar.PostUpdateVisibility = function(element, unit) -- do stuff here after PLAYER_TALENT_UPDATE or UPDATE_SHAPESHIFT_FORM has been processed end Code:
self.EclipseBar.PostUnitAura = function(element, unit) -- do stuff here after UNIT_AURA has been processed end Code:
self.EclipseBar.PostDirectionChange = function(element, unit) -- do stuff here after ECLIPSE_DIRECTION_CHANGE has been processed end Make use of these and you should not have to add your own event handlers. p.s. Yes, I know this info should be on the wiki. I'll get around to it soon(tm) |
|
10-22-10, 11:49 AM | #3 | |
Working fine now, ty!!! Last edited by drakull : 10-22-10 at 11:52 AM. |
||
10-23-10, 07:28 AM | #4 |
Was thinking about adding the same functionality to my layout, thanks for the hints. That's awesome.
__________________
My oUF Layout: oUF Lumen |
|
10-25-10, 09:13 AM | #5 |
Hello i have problem, after change form to cat or travel form glowing at icon (when i have eclipse) stay's (don't hide) i don't no why, mayby someone sees error ?
ss from my problem : http://yfrog.com/71wowscrnshot102510171614j my full code Code:
if playerClass == "DRUID" then self.Name:SetPoint("TOPLEFT", self.Health, "TOPLEFT", 18, 40) self.Debuffs:SetPoint(cfg.PlayerDebufAnchor1, self.Health, cfg.PlayerDebufAnchor2, cfg.PlayerDebufOffset_X, cfg.PlayerDebufOffset_Y+20) local eclipseBar = CreateFrame('Frame', nil, self) eclipseBar:SetPoint('TOPLEFT', self, 'BOTTOMLEFT', 23, 56) eclipseBar:SetSize(cfg.widthP-45, 12) eclipseBar:SetBackdrop{edgeFile = cfg.glowtex2, edgeSize = 5, insets = {left = 3, right = 3, top = 3, bottom = 3}} eclipseBar:SetBackdropColor(0, 0, 0, 0) eclipseBar:SetBackdropBorderColor(0, 0, 0, 0.8) local lunarBar = CreateFrame('StatusBar', nil, eclipseBar) lunarBar:SetPoint('LEFT', eclipseBar, 'LEFT', 0, 0) lunarBar:SetSize(cfg.widthP-42, 12) lunarBar:SetStatusBarTexture(cfg.PPtex) lunarBar:SetStatusBarColor(1, 3/5, 0) eclipseBar.LunarBar = lunarBar local solarBar = CreateFrame('StatusBar', nil, eclipseBar) solarBar:SetPoint('LEFT', lunarBar:GetStatusBarTexture(), 'RIGHT', 0, 0) solarBar:SetSize(cfg.widthP-42, 12) solarBar:SetStatusBarTexture(cfg.PPtex) solarBar:SetStatusBarColor(0, 0, 1) eclipseBar.SolarBar = solarBar local eclipseBarText = solarBar:CreateFontString(nil, 'OVERLAY') eclipseBarText:SetPoint('CENTER', eclipseBar, 'CENTER', 0, 0) eclipseBarText:SetFont(cfg.NumbFont, cfg.NumbFS, "THINOUTLINE") self:Tag(eclipseBarText, '[eecc]') self.Glow.eclipseBar = CreateFrame("Frame", nil, eclipseBar) self.Glow.eclipseBar:SetPoint("TOPLEFT", eclipseBar, "TOPLEFT", -5, 5) self.Glow.eclipseBar:SetPoint("BOTTOMRIGHT", eclipseBar, "BOTTOMRIGHT", 5, -5) self.Glow.eclipseBar:SetBackdrop{edgeFile = cfg.glowtex2, edgeSize = 5, insets = {left = 3, right = 3, top = 3, bottom = 3}} self.Glow.eclipseBar:SetBackdropColor(0, 0, 0, 0) self.Glow.eclipseBar:SetBackdropBorderColor(0, 0, 0, 0.8) self.iconS = eclipseBar:CreateTexture(nil, 'OVERLAY') self.iconS:SetPoint("LEFT", eclipseBar, "RIGHT", 4, 2) self.iconS:SetHeight(20) self.iconS:SetWidth(20) self.iconS:SetTexture(select(3,GetSpellInfo(48517))) self.iconS:SetVertexColor(unpack(cfg.trdcolor)) self.iconL = eclipseBar:CreateTexture(nil, 'OVERLAY') self.iconL:SetPoint("RIGHT", eclipseBar, "LEFT", -4, 2) self.iconL:SetHeight(20) self.iconL:SetWidth(20) self.iconL:SetTexture(select(3,GetSpellInfo(48518))) self.iconL:SetVertexColor(unpack(cfg.trdcolor)) local bgl = CreateFrame("Frame", nil, iconL) bgl:SetPoint("TOPLEFT", self.iconL, "TOPLEFT", -10, 10) bgl:SetPoint("BOTTOMRIGHT", self.iconL, "BOTTOMRIGHT", 10, -10) bgl:SetBackdrop{edgeFile = cfg.glowtex, edgeSize = 10, insets = {left = 3, right = 3, top = 3, bottom = 3}} bgl:SetBackdropColor(0,0,0,0) bgl:SetBackdropBorderColor(1,1,1,0) local bgs = CreateFrame("Frame", nil, iconL) bgs:SetPoint("TOPLEFT", self.iconS, "TOPLEFT", -10, 10) bgs:SetPoint("BOTTOMRIGHT", self.iconS, "BOTTOMRIGHT", 10, -10) bgs:SetBackdrop{edgeFile = cfg.glowtex, edgeSize = 10, insets = {left = 3, right = 3, top = 3, bottom = 3}} bgs:SetBackdropColor(0,0,0,0) bgs:SetBackdropBorderColor(1,1,1,0) local eclipseBarSpark = solarBar:CreateFontString(nil, 'OVERLAY') eclipseBarSpark:SetFont(cfg.NumbFont, cfg.NumbFS+4, "THINOUTLINE") local eclipseBarBuff = function(self, unit) if self.hasSolarEclipse then self.bgs:SetBackdropBorderColor(1,1,1,1) elseif self.hasLunarEclipse then self.bgl:SetBackdropBorderColor(1,1,1,1) else self.bgs:SetBackdropBorderColor(1,1,1,0) self.bgl:SetBackdropBorderColor(1,1,1,0) end if(self.directionIsLunar) then eclipseBarSpark:SetPoint('CENTER', eclipseBar, 'LEFT', 18, -1) eclipseBarSpark:SetText(">>>") else eclipseBarSpark:SetPoint('CENTER', eclipseBar, 'RIGHT', -12, -1) eclipseBarSpark:SetText("<<<") end end eclipseBar.bgs = bgs eclipseBar.bgl = bgl self.EclipseBar = eclipseBar self.EclipseBar.PostUnitAura = eclipseBarBuff end Last edited by azsh : 10-25-10 at 09:18 AM. |
|
10-25-10, 10:55 AM | #6 |
10-25-10, 11:46 AM | #7 |
YeY not to self.icon but to eclipseBar and it's working Thanks for the idea
|
|
WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Lunar/Solar eclipse glowing border |
«
Previous Thread
|
Next Thread
»
|
Display Modes |
Linear Mode |
Switch to Hybrid Mode |
Switch to Threaded Mode |
|
|