Quantcast

new option + don't call attribute setting on leveling up in attempt to fix #137

Darthpred [06-13-15 - 16:34]
new option + don't call attribute setting on leveling up in attempt to fix #137
Filename
ElvUI_SLE/defaults/profile.lua
ElvUI_SLE/locales/russian.lua
ElvUI_SLE/modules/auras.lua
ElvUI_SLE/options/auras_c.lua
diff --git a/ElvUI_SLE/defaults/profile.lua b/ElvUI_SLE/defaults/profile.lua
index d2e6a22..c99c2ab 100644
--- a/ElvUI_SLE/defaults/profile.lua
+++ b/ElvUI_SLE/defaults/profile.lua
@@ -13,6 +13,7 @@ P['sle'] = {
 		['tempenchants'] = {
 			['hideTimer'] = false,
 		},
+		['consolidatedMark'] = false,
 	},
 	--Background frames
 	['backgrounds'] = {
diff --git a/ElvUI_SLE/locales/russian.lua b/ElvUI_SLE/locales/russian.lua
index 43fc0bb..57a1559 100644
--- a/ElvUI_SLE/locales/russian.lua
+++ b/ElvUI_SLE/locales/russian.lua
@@ -131,6 +131,8 @@ L["Hide Buff Timer"] = "Спрятать таймеры баффов"
 L["This hides the time remaining for your buffs."] = "Скрывает текст оставшегося времени действия около баффов"
 L["Hide Debuff Timer"] = "Спрятать таймеры дебаффов"
 L["This hides the time remaining for your debuffs."] = "Скрывает текст оставшегося времени действия около дебаффов"
+L["Mark Your Consolidated Buffs"] = "Отмечать ваши объединенные эффекты"
+L["Create a mark bar on a consolidated buffs bar's icons for buffs your class can provide."] = "Создавать метку в полосе объединенных эффектов на иконках, бафф которых может предоставить ваш класс."

 --Autoreleas--
 L["PvP Auto Release"] = "Автоматический выход из тела"
diff --git a/ElvUI_SLE/modules/auras.lua b/ElvUI_SLE/modules/auras.lua
index f8886fb..43527b4 100644
--- a/ElvUI_SLE/modules/auras.lua
+++ b/ElvUI_SLE/modules/auras.lua
@@ -142,6 +142,19 @@ function A:CreateButton(i)
 	button:SetScript("OnEnter", function(self) ConsOnEnter(self) end)
 	button:SetScript("OnLeave", function(self) ConsOnLeave() end)

+	button.icon = CreateFrame("Frame", "ElvUIConsolidatedBuff"..i.."CanCast", button)
+	local icon = button.icon
+	icon:SetWidth(2)
+	icon:SetPoint("TOPRIGHT", button, -1, -1)
+	icon:SetPoint("BOTTOMRIGHT", button, -1, 1)
+	local overlay = icon:CreateTexture(nil, "OVERLAY")
+	overlay:SetTexture(E['media'].blankTex)
+	overlay:SetAllPoints(icon)
+	local classColor = RAID_CLASS_COLORS[E.myclass]
+	overlay:SetVertexColor(classColor.r, classColor.g, classColor.b)
+	icon:SetFrameLevel(button:GetFrameLevel() + 3)
+	icon:Hide()
+
 	return button
 end

@@ -193,7 +206,14 @@ function AT:BuildCasts(event, unit)
 		local button = _G["ElvUIConsolidatedBuff"..i]
 		if AT.Spells[E.myclass] then
 			local name = AT.Spells[E.myclass][i]
-			if name then button:SetAttribute("spell1", name) end
+			if name then
+				button:SetAttribute("spell1", name)
+				if E.db.sle.auras.consolidatedMark then
+					button.icon:Show()
+				else
+					button.icon:Hide()
+				end
+			end
 		end
 	end
 	AT:UpdateAuraStandings(nil, "player")
@@ -231,7 +251,7 @@ function AT:Initialize()
 	self:RegisterEvent("UNIT_AURA", "UpdateAuraStandings")
 	self:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED", "BuildCasts")
 	self:RegisterEvent("PLAYER_SPECIALIZATION_CHANGED", "BuildCasts")
-	self:RegisterEvent("UNIT_LEVEL", "BuildCasts")
+	-- self:RegisterEvent("UNIT_LEVEL", "BuildCasts")
 	self:RegisterEvent("PLAYER_REGEN_DISABLED", "UpdateAuraStandings")

 	AT:BuildCasts()
diff --git a/ElvUI_SLE/options/auras_c.lua b/ElvUI_SLE/options/auras_c.lua
index 606ee5a..641c0d4 100644
--- a/ElvUI_SLE/options/auras_c.lua
+++ b/ElvUI_SLE/options/auras_c.lua
@@ -1,5 +1,5 @@
 local E, L, V, P, G = unpack(ElvUI);
---local AT = E:GetModule('SLE_AuraTimers')
+local AT = E:GetModule('SLE_AuraTimers')

 local function configTable()
 	E.Options.args.sle.args.options.args.general.args.auras = {
@@ -52,6 +52,20 @@ local function configTable()
 				get = function(info) return E.db.sle.auras.debuffs.hideTimer end,
 				set = function(info, value) E.db.sle.auras.debuffs.hideTimer = value end,
 			},
+			space3 = {
+				order = 8,
+				type = 'description',
+				name = "",
+			},
+			consolidatedMark = {
+				order = 9,
+				type = "toggle",
+				name = L["Mark Your Consolidated Buffs"],
+				desc = L["Create a mark bar on a consolidated buffs bar's icons for buffs your class can provide."],
+				disabled = function() return (E.private.general.minimap.enable ~= true or E.private.auras.disableBlizzard ~= true) end,
+				get = function(info) return E.db.sle.auras.consolidatedMark end,
+				set = function(info, value) E.db.sle.auras.consolidatedMark = value; AT:BuildCasts() end,
+			},
 		},
 	}
 end