Quantcast

Added an actual text with energy value on classbar.

Darthpred [06-30-12 - 12:50]
Added an actual text with energy value on classbar.
Still not sure if it was good idea to put value updating to the pvp text status update.
Filename
ElvUI_SLE/config/profile.lua
ElvUI_SLE/modules/unitframes/units/player.lua
ElvUI_SLE/modules/unitframes/update_elements.lua
diff --git a/ElvUI_SLE/config/profile.lua b/ElvUI_SLE/config/profile.lua
index 7d63ea1..b0732f2 100644
--- a/ElvUI_SLE/config/profile.lua
+++ b/ElvUI_SLE/config/profile.lua
@@ -48,6 +48,9 @@ P['sle'] = {
 		['size'] = 18,
 	},

+	--Balance text
+	['bpenable'] = false;
+
 	--Auto release
 	['pvpautorelease'] = true,

diff --git a/ElvUI_SLE/modules/unitframes/units/player.lua b/ElvUI_SLE/modules/unitframes/units/player.lua
index 9688d74..0fb028d 100644
--- a/ElvUI_SLE/modules/unitframes/units/player.lua
+++ b/ElvUI_SLE/modules/unitframes/units/player.lua
@@ -69,6 +69,17 @@ function UF:Update_PlayerFrame(frame, db)
 		power.value:Hide()
 	end

+	--Testing for druid text
+	if E.myclass == "DRUID" then
+		local eclipseBar = frame.EclipseBar
+		local lunarBar = eclipseBar.LunarBar
+
+		local spower = UnitPower( PlayerFrame.unit, SPELL_POWER_ECLIPSE );
+		eclipseBar.powtext = lunarBar:CreateFontString(nil, 'OVERLAY')
+		eclipseBar.powtext:SetPoint("CENTER", eclipseBar, "CENTER")
+		eclipseBar.powtext:SetFont("Fonts\\FRIZQT__.TTF", 10, "OUTLINE")
+	end
+
 	if not E.db.unitframe.units.player.classbar.offset then return end --Checking for offset option enabled
 	--All this crap is needed to be copied from Elv's player.lua to avoid graphical bugs
 	--Adjust some variables
diff --git a/ElvUI_SLE/modules/unitframes/update_elements.lua b/ElvUI_SLE/modules/unitframes/update_elements.lua
index 97d2a9d..45fa844 100644
--- a/ElvUI_SLE/modules/unitframes/update_elements.lua
+++ b/ElvUI_SLE/modules/unitframes/update_elements.lua
@@ -273,4 +273,14 @@ function UF:UpdatePvPText(frame)
 	local x, y = self:GetPositionOffset(E.db.sle.pvp.pos)
 	PvPText:ClearAllPoints()
 	PvPText:Point(E.db.sle.pvp.pos, health, E.db.sle.pvp.pos, x, y)
+
+	if E.myclass == "DRUID" then
+		local eclipseBar = ElvUF_Player.EclipseBar
+		local spower = UnitPower( PlayerFrame.unit, SPELL_POWER_ECLIPSE );
+		if E.db.sle.bpenable then
+			eclipseBar.powtext:SetText(spower)
+		else
+			eclipseBar.powtext:SetText('')
+		end
+	end
 end
\ No newline at end of file