From 0713eaa157898b25c052c90fb1cfd04e7157b10f Mon Sep 17 00:00:00 2001 From: Darthpred Date: Fri, 2 Nov 2012 19:22:26 +0400 Subject: [PATCH] Fix for disappearing castbars and non updating healthbar while in vehicle Who the hell could think it was because of damn OnUpdate script --- ElvUI_SLE/modules/unitframes/units/player.lua | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/ElvUI_SLE/modules/unitframes/units/player.lua b/ElvUI_SLE/modules/unitframes/units/player.lua index ae1aa30..7aca9e2 100644 --- a/ElvUI_SLE/modules/unitframes/units/player.lua +++ b/ElvUI_SLE/modules/unitframes/units/player.lua @@ -1,23 +1,24 @@ local E, L, V, P, G, _ = unpack(ElvUI); --Inport: Engine, Locales, PrivateDB, ProfileDB, GlobalDB, Localize Underscore if not E.private.unitframe.enable then return end local UF = E:GetModule('UnitFrames'); +local SLE = E:GetModule('SLE'); local LSM = LibStub("LibSharedMedia-3.0"); + --Setting the variable for using classbar. Elv's function. local CAN_HAVE_CLASSBAR = (E.myclass == "PALADIN" or E.myclass == "DRUID" or E.myclass == "DEATHKNIGHT" or E.myclass == "WARLOCK" or E.myclass == "PRIEST" or E.myclass == "MONK" or E.myclass == 'MAGE') -ElvUF_Player:SetScript("OnUpdate", function() - if not E.db.sle.combatico.enable then - ElvUF_Player.Combat:Hide() - end -end) --Function to move damn combat indicator to topright part of the frame. Maybe i should create an option to make it placeble everywhere. function UF:Update_CombatIndicator() local CombatText = ElvUF_Player.Combat - - local x, y = self:GetPositionOffset(E.db.sle.combatico.pos) - CombatText:ClearAllPoints() - CombatText:Point(E.db.sle.combatico.pos, ElvUF_Player.Health, E.db.sle.combatico.pos, x, x) + if E.db.sle.combatico.pos == "NONE" then + CombatText:ClearAllPoints() + else + local x, y = UF:GetPositionOffset(E.db.sle.combatico.pos) + CombatText:ClearAllPoints() + CombatText:Point(E.db.sle.combatico.pos, ElvUF_Player.Health, E.db.sle.combatico.pos, x, x) + end + SLE:UnregisterEvent("PLAYER_REGEN_DISABLED") end UF.Update_PlayerFrameSLE = UF.Update_PlayerFrame -- 1.7.9.5