Quantcast

- Changed position of Power Text for Target Frame

Lanerra [05-05-11 - 21:45]
- Changed position of Power Text for Target Frame
- Added option for Vertical Healthbar toggle for Focus Frame
- Added functionality that hides pet's name with either or both Health/Power displayed on that frame
Filename
Tags.lua
oUF_Lanerra.lua
oUF_Lanerra_Config.lua
diff --git a/Tags.lua b/Tags.lua
index 5e00a1a..66956fb 100644
--- a/Tags.lua
+++ b/Tags.lua
@@ -11,6 +11,29 @@ oUF.Tags['LanThreat'] = function()
 	return perc and ('%s%d%%|r'):format(hex(GetThreatStatusColor(UnitThreatSituation('player', 'target'))), perc)
 end

+oUF.TagEvents['LanClassification'] = 'UNIT_CLASSIFICATION_CHANGED'
+oUF.Tags['LanClassification'] = function(unit)
+    local level = UnitLevel(unit)
+    local colorL = GetQuestDifficultyColor(level)
+
+    if (level < 0) then
+        r, g, b = 1, 0, 0
+    else
+        r, g, b = colorL.r, colorL.g, colorL.b
+    end
+
+    local c = UnitClassification(unit)
+    if(c == 'rare') then
+        return format('|cff%02x%02x%02x%s|r', r*255, g*255, b*255, 'R')
+    elseif(c == 'eliterare') then
+        return format('|cff%02x%02x%02x%s|r', r*255, g*255, b*255, 'R+')
+    elseif(c == 'elite') then
+        return format('|cff%02x%02x%02x%s|r', r*255, g*255, b*255, '+')
+    elseif(c == 'worldboss') then
+        return format('|cff%02x%02x%02x%s|r', r*255, g*255, b*255, 'B')
+    end
+end
+
 oUF.Tags['LanLevel'] = function(unit)
     local level = UnitLevel(unit)
     local colorL = GetQuestDifficultyColor(level)
diff --git a/oUF_Lanerra.lua b/oUF_Lanerra.lua
index df3d886..a33d08a 100644
--- a/oUF_Lanerra.lua
+++ b/oUF_Lanerra.lua
@@ -40,6 +40,11 @@ do
     end
 end

+-------------------------------------------------
+-- Variables for defining colors and appearance
+-------------------------------------------------
+
+
 local colors = oUF.colors

 local playerClass = select(2, UnitClass('player'))
@@ -129,6 +134,12 @@ local function ShortValue(value)
 	end
 end

+------------------------------------------
+-- Functions used to build Unit Frames
+------------------------------------------
+
+
+-- Build dropdown menus
 local dropdown = CreateFrame('Frame', 'oUF_LanerraDropDown', UIParent, 'UIDropDownMenuTemplate')

 UIDropDownMenu_Initialize(dropdown, function(self)
@@ -560,11 +571,9 @@ local Stylish = function(self, unit, isSingle)
 	self.Power.Value:SetFont(Settings.Media.Font, Settings.Media.FontSize)
 	self.Power.Value:SetShadowOffset(1, -1)
     if (unit == 'target') then
-        self.Power.Value:SetPoint('BOTTOM', self, 0, 2)
+        self.Power.Value:SetPoint('TOPRIGHT', self.Power, 'BOTTOMRIGHT', 0, -5)
     elseif (unit == 'player') then
         self.Power.Value:SetPoint('LEFT', self.Health.Value, 'RIGHT', -195, 0)
-    elseif (unit == 'pet') then
-        self.Power.Value:SetPoint('CENTER', self.Health)
     end

 	self.Power.Value:SetTextColor(1, 1, 1)
@@ -577,7 +586,7 @@ local Stylish = function(self, unit, isSingle)
 		self.Health:SetAllPoints(self)
 	end

-    if (unit == 'focus') then
+    if (unit == 'focus' and Settings.Units.Focus.VerticalHealth) then
 		self.Power:Hide()
 		self.Power.Show = self.Power.Hide
 		self.Health:SetAllPoints(self)
@@ -586,6 +595,8 @@ local Stylish = function(self, unit, isSingle)
 		self.Health:SetOrientation('HORIZONTAL')
 	end

+    self.Power.PostUpdate = UpdatePower
+
     -- Improve border drawing
     self.Overlay = CreateFrame('Frame', nil, self)
 	self.Overlay:SetAllPoints(self)
@@ -742,6 +753,11 @@ local Stylish = function(self, unit, isSingle)
             self:Tag(self.Info, '[LanShortName]')
 		elseif (unit == 'pet' and Settings.Units.Pet.ShowPowerText) then
             name:Hide()
+
+            if (Settings.Units.Pet.Health.Percent or Settings.Units.Pet.Health.Deficit or Settings.Units.Pet.Health.Current) then
+                self.Power.Value:SetPoint('RIGHT', self.Health, -2, 0)
+                self.Health.Value:SetPoint('LEFT', self.Health, -40, -1)
+            end
         elseif (unit == 'pet' and not Settings.Units.Pet.ShowPowerText) then
             name:SetPoint('CENTER', self.Health)
             self:Tag(self.Info, '[LanName]')
@@ -750,15 +766,13 @@ local Stylish = function(self, unit, isSingle)
         elseif (unit == 'target') then
             name:SetPoint('LEFT', self.Health, 'LEFT', 1, 0)
 			name:SetJustifyH('LEFT')
-            self:Tag(self.Info, '[LanLevel][shortclassification] [LanName]')
+            self:Tag(self.Info, '[LanLevel][LanClassification] [LanName]')
         else
 			name:SetPoint('LEFT', self.Health, 'LEFT', 1, 0)
 			name:SetJustifyH('LEFT')
             self:Tag(self.Info, '[LanName]')
 		end
     end
-
-    self.Power.PostUpdate = UpdatePower

     if (isHealer) then
         if (unit == 'target') then
diff --git a/oUF_Lanerra_Config.lua b/oUF_Lanerra_Config.lua
index 13bd8e8..4698cb9 100644
--- a/oUF_Lanerra_Config.lua
+++ b/oUF_Lanerra_Config.lua
@@ -68,6 +68,7 @@ Settings = {
                 Deficit = false,
                 Current = false,
             },
+            VerticalHealth = true,
         },
         Party = {
             Height = 20,