Quantcast

Removed unneeded code from art/honor bar. Also not messing around with show/hide.

Darth Predator [11-21-16 - 07:37]
Removed unneeded code from art/honor bar. Also not messing around with show/hide.
Reference #401
Filename
ElvUI_SLE/modules/databars/artifact.lua
ElvUI_SLE/modules/databars/honor.lua
diff --git a/ElvUI_SLE/modules/databars/artifact.lua b/ElvUI_SLE/modules/databars/artifact.lua
index d15b279..11606fe 100644
--- a/ElvUI_SLE/modules/databars/artifact.lua
+++ b/ElvUI_SLE/modules/databars/artifact.lua
@@ -16,25 +16,15 @@ DB.Art = {
 }

 local function UpdateArtifact(self, event)
+	if not E.db.databars.artifact.enable then return end
 	if not E.db.sle.databars.artifact.longtext then return end
 	local bar = self.artifactBar
-	local showArtifact = HasArtifactEquipped();
-	if not showArtifact or (event == "PLAYER_REGEN_DISABLED" and self.db.artifact.hideInCombat) then
-		bar:Hide()
-	elseif showArtifact and (not self.db.artifact.hideInCombat or not InCombatLockdown()) then
-		bar:Show()
-
-		if self.db.artifact.hideInVehicle then
-			E:RegisterObjectForVehicleLock(bar, E.UIParent)
-		else
-			E:UnregisterObjectForVehicleLock(bar)
-		end

+	local hasArtifact = HasArtifactEquipped();
+	if hasArtifact then
 		local text = ''
-		local itemID, altItemID, name, icon, totalXP, pointsSpent, quality, artifactAppearanceID, appearanceModID, itemAppearanceID, altItemAppearanceID, altOnTop = C_ArtifactUIGetEquippedArtifactInfo();
+		local totalXP, pointsSpent = T.select(5, C_ArtifactUIGetEquippedArtifactInfo());
 		local numPointsAvailableToSpend, xp, xpForNextPoint = MainMenuBar_GetNumArtifactTraitsPurchasableFromXP(pointsSpent, totalXP);
-		bar.statusBar:SetMinMaxValues(0, xpForNextPoint)
-		bar.statusBar:SetValue(xp)

 		local textFormat = self.db.artifact.textFormat
 		if textFormat == 'PERCENT' then
diff --git a/ElvUI_SLE/modules/databars/honor.lua b/ElvUI_SLE/modules/databars/honor.lua
index b1b2500..67778d7 100644
--- a/ElvUI_SLE/modules/databars/honor.lua
+++ b/ElvUI_SLE/modules/databars/honor.lua
@@ -33,35 +33,16 @@ DB.Honor ={
 }

 local function UpdateHonor(self, event, unit)
+	if not E.db.databars.honor.enable then return end
 	if not E.db.sle.databars.honor.longtext then return end
-	if event == "HONOR_PRESTIGE_UPDATE"  and unit ~= "player" then return end
+	if event == "HONOR_PRESTIGE_UPDATE" and unit ~= "player" then return end
 	local bar = self.honorBar
 	local showHonor = T.UnitLevel("player") >= MAX_PLAYER_LEVEL
-	if not showHonor then
-		bar:Hide()
-	else
-		bar:Show()
-
+	if showHonor then
 		local current = T.UnitHonor("player");
 		local max = T.UnitHonorMax("player");
 		local level = T.UnitHonorLevel("player");
-        local levelmax = T.GetMaxPlayerHonorLevel();
-
-
-        if (level == levelmax) then
-			-- Force the bar to full for the max level
-			bar.statusBar:SetMinMaxValues(0, 1)
-			bar.statusBar:SetValue(1)
-		else
-			bar.statusBar:SetMinMaxValues(0, max)
-			bar.statusBar:SetValue(current)
-		end
-
-		if self.db.honor.hideInVehicle then
-			E:RegisterObjectForVehicleLock(bar, E.UIParent)
-		else
-			E:UnregisterObjectForVehicleLock(bar)
-		end
+		local levelmax = T.GetMaxPlayerHonorLevel();

 		local text = ''
 		local textFormat = self.db.honor.textFormat