Quantcast

one more tonight

Steven Jackson [09-09-14 - 06:25]
one more tonight
Filename
Interface/AddOns/SVUI/libs/oUF/elements/health.lua
Interface/AddOns/SVUI/packages/aura/SVAura.lua
Interface/AddOns/SVUI_ConfigOMatic/modules/aura.lua
diff --git a/Interface/AddOns/SVUI/libs/oUF/elements/health.lua b/Interface/AddOns/SVUI/libs/oUF/elements/health.lua
index 570cab3..3019292 100644
--- a/Interface/AddOns/SVUI/libs/oUF/elements/health.lua
+++ b/Interface/AddOns/SVUI/libs/oUF/elements/health.lua
@@ -102,7 +102,7 @@ local Update = function(self, event, unit)
 		health:SetOrientation("VERTICAL")
 	end

-	if(health.percent < 6 and health.LowAlertFunc and UnitIsEnemy("target", "player") and not health.lowAlerted) then
+	if(health.LowAlertFunc and UnitIsPlayer("target") and health.percent < 6 and UnitIsEnemy("target", "player") and not health.lowAlerted) then
 		health.lowAlerted = true
 		health.LowAlertFunc(self)
 	end
@@ -185,7 +185,7 @@ local CustomUpdate = function(self, event, unit)
 		health:SetValue(-current)
 	end

-	if(health.percent < 6 and health.LowAlertFunc and UnitIsEnemy("target", "player") and not health.lowAlerted) then
+	if(health.LowAlertFunc and UnitIsPlayer("target") and health.percent < 6 and UnitIsEnemy("target", "player") and not health.lowAlerted) then
 		health.lowAlerted = true
 		health.LowAlertFunc(self)
 	end
diff --git a/Interface/AddOns/SVUI/packages/aura/SVAura.lua b/Interface/AddOns/SVUI/packages/aura/SVAura.lua
index c05b410..04e485b 100644
--- a/Interface/AddOns/SVUI/packages/aura/SVAura.lua
+++ b/Interface/AddOns/SVUI/packages/aura/SVAura.lua
@@ -441,9 +441,9 @@ do
 	end
 end

-function MOD:UpdateAuraHeader(auraHeader)
+function MOD:UpdateAuraHeader(auraHeader, auraType)
 	if(InCombatLockdown() or not auraHeader) then return end
-	local db = MOD.db.debuffs
+	local db = MOD.db[auraType]
 	local showBy = db.showBy
 	local font = SV.Shared:Fetch("font", MOD.db.font)
 	if auraHeader:GetAttribute("filter") == "HELPFUL" then
@@ -457,6 +457,7 @@ function MOD:UpdateAuraHeader(auraHeader)
 	auraHeader:SetAttribute("maxWraps", db.maxWraps)
 	auraHeader:SetAttribute("wrapAfter", db.wrapAfter)
 	auraHeader:SetAttribute("point", invertMap1[showBy])
+
 	if(showBy == "RIGHT_DOWN" or showBy == "RIGHT_UP" or showBy == "LEFT_DOWN" or showBy == "LEFT_UP") then
 		auraHeader:SetAttribute("minWidth", ((db.wrapAfter == 1 and 0 or db.wrapXOffset) + db.size) * db.wrapAfter)
 		auraHeader:SetAttribute("minHeight", (db.wrapYOffset + db.size) * db.maxWraps)
@@ -471,7 +472,8 @@ function MOD:UpdateAuraHeader(auraHeader)
 		auraHeader:SetAttribute("yOffset", showMap2[showBy] * (db.wrapYOffset + db.size))
 		auraHeader:SetAttribute("wrapOffsetH", showMap1[showBy] * (db.wrapXOffset + db.size))
 		auraHeader:SetAttribute("wrapOffsetV", 0)
-	end
+	end
+
 	auraHeader:SetAttribute("template", ("SVUI_AuraTemplate%d"):format(db.size))
 	local i = 1;
 	local auraChild = select(i, auraHeader:GetChildren())
@@ -494,8 +496,8 @@ function MOD:UpdateAuraHeader(auraHeader)
 end

 local function CreateAuraHeader(filter)
-	local frameName = "SVUI_PlayerDebuffs"
-	if filter == "HELPFUL" then frameName = "SVUI_PlayerBuffs" end
+	local frameName, auraType = "SVUI_PlayerDebuffs", "debuffs"
+	if filter == "HELPFUL" then frameName = "SVUI_PlayerBuffs"; auraType = "buffs" end
 	local auraHeader = CreateFrame("Frame", frameName, SVUI_AurasAnchor, "SecureAuraHeaderTemplate")
 	auraHeader:SetClampedToScreen(true)
 	auraHeader:SetAttribute("unit", "player")
@@ -506,7 +508,7 @@ local function CreateAuraHeader(filter)
 		auraHeader:SetAttribute("consolidateDuration", -1)
 		auraHeader:SetAttribute("includeWeapons", 1)
 	end
-	MOD:UpdateAuraHeader(auraHeader)
+	MOD:UpdateAuraHeader(auraHeader, auraType)
 	auraHeader:Show()
 	return auraHeader
 end
@@ -516,8 +518,8 @@ function MOD:ReLoad()
 	CB_WIDTH = (CB_HEIGHT / 5) + 4
 	SVUI_AurasAnchor:SetSize(CB_WIDTH, CB_HEIGHT)
 	AURA_FADE_TIME = MOD.db.fadeBy
-	MOD:UpdateAuraHeader(SVUI_PlayerBuffs);
-	MOD:UpdateAuraHeader(SVUI_PlayerDebuffs);
+	MOD:UpdateAuraHeader(SVUI_PlayerBuffs, "buffs");
+	MOD:UpdateAuraHeader(SVUI_PlayerDebuffs, "debuffs");
 end

 function MOD:Load()
diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/aura.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/aura.lua
index a201c73..27443d2 100644
--- a/Interface/AddOns/SVUI_ConfigOMatic/modules/aura.lua
+++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/aura.lua
@@ -162,8 +162,8 @@ SV.Options.args.SVAura = {
 	get = function(a)return SV.db.SVAura[a[#a]]end,
 	set = function(a,b)
 		MOD:ChangeDBVar(b,a[#a]);
-		MOD:UpdateAuraHeader(SVUI_PlayerBuffs)
-		MOD:UpdateAuraHeader(SVUI_PlayerDebuffs)
+		MOD:UpdateAuraHeader(SVUI_PlayerBuffs, "buffs")
+		MOD:UpdateAuraHeader(SVUI_PlayerDebuffs, "debuffs")
 	end,
 	args = {
 		intro = {
@@ -271,7 +271,7 @@ SV.Options.args.SVAura = {
 					type = "group",
 					name = L["Hyper Buffs"],
 					get = function(b)return SV.db.SVAura.hyperBuffs[b[#b]]end,
-					set = function(a,b)MOD:ChangeDBVar(b,a[#a],"hyperBuffs");MOD:ToggleConsolidatedBuffs();MAP:ReLoad();MOD:UpdateAuraHeader(SVUI_PlayerBuffs)end,
+					set = function(a,b)MOD:ChangeDBVar(b,a[#a],"hyperBuffs");MOD:ToggleConsolidatedBuffs();MAP:ReLoad();MOD:UpdateAuraHeader(SVUI_PlayerBuffs, "buffs")end,
 					args = {
 						enable = {
 							order = 1,
@@ -294,7 +294,7 @@ SV.Options.args.SVAura = {
 					type = "group",
 					name = L["Buffs"],
 					get = function(b)return SV.db.SVAura.buffs[b[#b]]end,
-					set = function(a,b)MOD:ChangeDBVar(b,a[#a],"buffs");MOD:UpdateAuraHeader(SVUI_PlayerBuffs)end,
+					set = function(a,b)MOD:ChangeDBVar(b,a[#a],"buffs");MOD:UpdateAuraHeader(SVUI_PlayerBuffs, "buffs")end,
 					args = auraOptionsTemplate
 				},
 				debuffs = {
@@ -302,7 +302,7 @@ SV.Options.args.SVAura = {
 					type = "group",
 					name = L["Debuffs"],
 					get = function(b)return SV.db.SVAura.debuffs[b[#b]]end,
-					set = function(a,b)MOD:ChangeDBVar(b,a[#a],"debuffs");MOD:UpdateAuraHeader(SVUI_PlayerDebuffs)end,
+					set = function(a,b)MOD:ChangeDBVar(b,a[#a],"debuffs");MOD:UpdateAuraHeader(SVUI_PlayerDebuffs, "debuffs")end,
 					args = auraOptionsTemplate
 				}
 			}