From 451a8ad33bd306e6c918237d16621c013d87a8b6 Mon Sep 17 00:00:00 2001 From: Adrian L Lange Date: Tue, 19 Aug 2014 18:47:42 +0200 Subject: [PATCH] Simplify the eclipse element --- oUF_P3lim.lua | 37 +++++-------------------------------- 1 file changed, 5 insertions(+), 32 deletions(-) diff --git a/oUF_P3lim.lua b/oUF_P3lim.lua index 8ef44b3..081524d 100644 --- a/oUF_P3lim.lua +++ b/oUF_P3lim.lua @@ -54,28 +54,6 @@ local function UpdateEmbersVisibility(self) end end -local function PostUpdateEclipse(element) - local direction = GetEclipseDirection() - if(direction == 'sun') then - element.SolarBar:SetStatusBarColor(1/4, 2/5, 5/6) - element.LunarBar:SetStatusBarColor(1/3, 1/3, 1/3) - elseif(direction == 'moon') then - element.LunarBar:SetStatusBarColor(4/5, 3/5, 0) - element.SolarBar:SetStatusBarColor(1/3, 1/3, 1/3) - else - element.LunarBar:SetStatusBarColor(4/5, 3/5, 0) - element.SolarBar:SetStatusBarColor(1/4, 2/5, 5/6) - end -end - -local function UpdateEclipseVisibility(self) - if(UnitHasVehicleUI('player') or UnitIsDeadOrGhost('player')) then - self.EclipseBar:Hide() - else - self.EclipseBar:ForceUpdate() - end -end - local function UpdateAura(self, elapsed) if(self.expiration) then if(self.expiration < 60) then @@ -223,27 +201,22 @@ local UnitSpecific = { self.colors.runes[4] = {0.5, 0.27, 0.68} elseif(playerClass == 'DRUID') then local EclipseBar = CreateFrame('Frame', nil, self) - EclipseBar:SetPoint('BOTTOM', 0, -10) + EclipseBar:SetPoint('TOPLEFT', self, 'BOTTOMLEFT', 0, -4) EclipseBar:SetSize(230, 6) EclipseBar:SetBackdrop(BACKDROP) EclipseBar:SetBackdropColor(0, 0, 0) - EclipseBar.PostDirectionChange = PostUpdateEclipse self.EclipseBar = EclipseBar local LunarBar = CreateFrame('StatusBar', nil, EclipseBar) LunarBar:SetPoint('LEFT') LunarBar:SetSize(230, 6) LunarBar:SetStatusBarTexture(TEXTURE) + LunarBar:SetStatusBarColor(4/5, 3/5, 0) EclipseBar.LunarBar = LunarBar - local SolarBar = CreateFrame('StatusBar', nil, EclipseBar) - SolarBar:SetPoint('LEFT', LunarBar:GetStatusBarTexture(), 'RIGHT') - SolarBar:SetSize(230, 6) - SolarBar:SetStatusBarTexture(TEXTURE) - EclipseBar.SolarBar = SolarBar - - self:RegisterEvent('UNIT_EXITED_VEHICLE', UpdateEclipseVisibility) - self:RegisterEvent('UNIT_ENTERED_VEHICLE', UpdateEclipseVisibility) + local SolarBar = Eclipse:CreateTexture(nil, 'BORDER') + SolarBar:SetAllPoints() + SolarBar:SetTexture(1/4, 2/5, 5/6) elseif(playerClass == 'WARLOCK') then local BurningEmbers = CreateFrame('Frame', nil, self) BurningEmbers:SetPoint('BOTTOM', 0, -10) -- 1.7.9.5