From 84fedd43c3e24c3a10818d24808c0b75887bd863 Mon Sep 17 00:00:00 2001 From: Adrian L Lange Date: Sun, 22 Jun 2014 15:23:33 +0200 Subject: [PATCH] Hide Eclipse and Embers while in a vehicle --- oUF_P3lim.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/oUF_P3lim.lua b/oUF_P3lim.lua index 33402ab..fdf6bf4 100644 --- a/oUF_P3lim.lua +++ b/oUF_P3lim.lua @@ -130,6 +130,14 @@ local function PostUpdateEclipse(element) 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 @@ -316,6 +324,9 @@ local UnitSpecific = { SolarBar:SetSize(230, 6) SolarBar:SetStatusBarTexture(TEXTURE) EclipseBar.SolarBar = SolarBar + + self:RegisterEvent('UNIT_EXITED_VEHICLE', UpdateEclipseVisibility) + self:RegisterEvent('UNIT_ENTERED_VEHICLE', UpdateEclipseVisibility) elseif(playerClass == 'WARLOCK') then local BurningEmbers = CreateFrame('Frame', nil, self) BurningEmbers:SetPoint('BOTTOM', 0, -10) -- 1.7.9.5