Quantcast

Merge remote-tracking branch 'refs/remotes/origin/master'

Repooc [02-22-13 - 09:59]
Merge remote-tracking branch 'refs/remotes/origin/master'
Filename
ElvUI_SLE/config/sle_private.lua
ElvUI_SLE/locales/english.lua
ElvUI_SLE/locales/russian.lua
ElvUI_SLE/modules/autorelease/autorelease.lua
ElvUI_SLE/modules/equipmanager/equipmanager.lua
ElvUI_SLE/modules/equipmanager/load_equipmanager.xml
ElvUI_SLE/modules/equipmanager/options.lua
ElvUI_SLE/modules/load_modules.xml
ElvUI_SLE/modules/specswitch/load_specswitch.xml
ElvUI_SLE/modules/specswitch/options.lua
ElvUI_SLE/modules/specswitch/specswitch.lua
diff --git a/ElvUI_SLE/config/sle_private.lua b/ElvUI_SLE/config/sle_private.lua
index 1dadd26..5c2814b 100644
--- a/ElvUI_SLE/config/sle_private.lua
+++ b/ElvUI_SLE/config/sle_private.lua
@@ -44,11 +44,12 @@ V['sle'] = {
 		['seedtrash'] = false,
 	},

-	['specswitch'] = {
+	['equip'] = {
 		['enable'] = false,
-		['primary'] = "",
-		['secondary'] = "",
-		['instance'] = "",
-		['pvp'] = "",
+		['spam'] = false,
+		['primary'] = "NONE",
+		['secondary'] = "NONE",
+		['instance'] = "NONE",
+		['pvp'] = "NONE",
 	},
 }
diff --git a/ElvUI_SLE/locales/english.lua b/ElvUI_SLE/locales/english.lua
index 05d93ce..531733d 100644
--- a/ElvUI_SLE/locales/english.lua
+++ b/ElvUI_SLE/locales/english.lua
@@ -62,7 +62,6 @@ L["Set the texture to use in this frame.  Requirements are the same as the chat
 L["Backdrop Template"] = true
 L["Change the template used for this backdrop."] = true
 L["Default"] = true
-L["Transparent"] = true
 L["Hide in Pet Batlle"] = true
 L["Show/Hide this frame during Pet Battles."] = true

@@ -123,9 +122,20 @@ L["Changes the way text is shown on exp bar."] = true
 L["Full value on Rep Bar"] = true
 L["Changes the way text is shown on rep bar."] = true

+--Equip Manager--
+L['Equipment manager'] = true
+L["EM_DESC"] = "This module provides different options to automatically change your equipment sets on spec change or entering certain locations."
+L['Spam Throttling'] = true
+L["Here you can choose what equipment sets to use in different situations."] = true
+L["Equip this set when switching to primary talents."] = true
+L["Equip this set when switching to secondary talents."] =true
+L["Equip this set after entering dungeons or raids."] = true
+L["Equip this set after entering battlegrounds or arens."] = true
+
 --Farm--
 L['Farm'] = true
-L["FARM_DESC"] = true
+L["FARM_DESC"] = [[Additional actionbars for the Sunsong Ranch containing seeds, tools and portals.
+They will appear only if you are on the Ranch or The Halfhill Market.]]
 L['Only active buttons'] = true
 L['Only show the buttons for the seeds, portals, tools you have in your bags.'] = true
 L["Seed Bars"] = true
diff --git a/ElvUI_SLE/locales/russian.lua b/ElvUI_SLE/locales/russian.lua
index 4bd0254..d16d6e6 100644
--- a/ElvUI_SLE/locales/russian.lua
+++ b/ElvUI_SLE/locales/russian.lua
@@ -62,7 +62,6 @@ L["Set the texture to use in this frame.  Requirements are the same as the chat
 L["Backdrop Template"] = "Тип фона"
 L["Change the template used for this backdrop."] = "Измените шаблон, используемый при создании этого фона"
 L["Default"] = "Обычный"
-L["Transparent"] = "Прозрачный"
 L["Hide in Pet Batlle"] = "Прятать в битвах питомцев"
 L["Show/Hide this frame during Pet Battles."] = "Показать/скрыть этот фрейм в битвах питомцев"

@@ -123,9 +122,20 @@ L["Changes the way text is shown on exp bar."] = "Изменяет отобра
 L["Full value on Rep Bar"] = "Полное значение репутации"
 L["Changes the way text is shown on rep bar."] = "Изменяет отображение значений репутации на полосе."

+--Equip Manager--
+L['Equipment manager'] = "Менеджер экипировки"
+L["EM_DESC"] = "Этот модуль предоставляет различные опции для автоматической смены комплектов экипировки при переключении набора талантов или попадании в определенную локацию."
+L['Spam Throttling'] = "Подавление спама"
+L["Here you can choose what equipment sets to use in different situations."] = "Здесь Вы можете выбрать какие комплекты экипировки использовать в различных случаях."
+L["Equip this set when switching to primary talents."] = "Надеть этот набор при переключении на основной набор талантов."
+L["Equip this set when switching to secondary talents."] = "Надеть этот набор при переключении на дополнительный набор талантов."
+L["Equip this set after entering dungeons or raids."] = "Надеть этот набор при попадании в подземелье или рейд."
+L["Equip this set after entering battlegrounds or arens."] = "Надеть этот набор при попадании на поля боя или арены."
+
 --Farm--
 L['Farm'] = "Ферма"
-L["FARM_DESC"] = true
+L["FARM_DESC"] = [[Дополнительные панели с семенами, инструментами и порталами для Фермы Солнечной Песни.
+Они будут отображаться только если Вы находитесь на ферме или рынке Полугорья.]]
 L['Only active buttons'] = "Только активные"
 L['Only show the buttons for the seeds, portals, tools you have in your bags.'] = "Отображать только кнопки для тех семян/инструментов/порталов, которые есть у Вас в сумках."
 L["Seed Bars"] = "Панели семян"
diff --git a/ElvUI_SLE/modules/autorelease/autorelease.lua b/ElvUI_SLE/modules/autorelease/autorelease.lua
index 7996296..7946ab1 100644
--- a/ElvUI_SLE/modules/autorelease/autorelease.lua
+++ b/ElvUI_SLE/modules/autorelease/autorelease.lua
@@ -1,33 +1,33 @@
---Credit to Repooc.
---Remade his auto release featule to module which allows profile setting of the function not the global one.
-local E, L, V, P, G, _ = unpack(ElvUI); --Inport: Engine, Locales, PrivateDB, ProfileDB, GlobalDB, Localize Underscore
-local AR = E:NewModule('AutoRelease', 'AceHook-3.0', 'AceEvent-3.0');
-
-function AR:Releasing()
-	local inInstance, instanceType = IsInInstance()
-	if (inInstance and (instanceType == "pvp")) then
-		if E.db.sle.pvpautorelease then
-			local soulstone = GetSpellInfo(20707)
-				if ((E.myclass ~= "SHAMAN") and not (soulstone and UnitBuff("player", soulstone))) then
-					RepopMe()
-				end
-		end
-	end
-
-	-- auto resurrection for world PvP area...when active
-	if E.db.sle.pvpautorelease then
-		for index = 1, GetNumWorldPVPAreas() do
-			local pvpID, localizedName, isActive, canQueue, startTime, canEnter = GetWorldPVPAreaInfo(index)
-
-			if (GetRealZoneText() == localizedName and isActive) then
-				RepopMe()
-			end
-		end
-	end
-end
-
-function AR:Initialize()
-	self:RegisterEvent("PLAYER_DEAD", "Releasing");
-end
-
+--Credit to Repooc.
+--Remade his auto release featule to module which allows profile setting of the function not the global one.
+local E, L, V, P, G, _ = unpack(ElvUI); --Inport: Engine, Locales, PrivateDB, ProfileDB, GlobalDB, Localize Underscore
+local AR = E:NewModule('AutoRelease', 'AceHook-3.0', 'AceEvent-3.0');
+
+function AR:Releasing()
+	local inInstance, instanceType = IsInInstance()
+	if (inInstance and (instanceType == "pvp")) then
+		if E.db.sle.pvpautorelease then
+			local soulstone = GetSpellInfo(20707)
+				if ((E.myclass ~= "SHAMAN") and not (soulstone and UnitBuff("player", soulstone))) then
+					RepopMe()
+				end
+		end
+	end
+
+	-- auto resurrection for world PvP area...when active
+	if E.db.sle.pvpautorelease then
+		for index = 1, GetNumWorldPVPAreas() do
+			local _, localizedName, isActive = GetWorldPVPAreaInfo(index)
+
+			if (GetRealZoneText() == localizedName and isActive) then
+				RepopMe()
+			end
+		end
+	end
+end
+
+function AR:Initialize()
+	self:RegisterEvent("PLAYER_DEAD", "Releasing");
+end
+
 E:RegisterModule(AR:GetName())
\ No newline at end of file
diff --git a/ElvUI_SLE/modules/equipmanager/equipmanager.lua b/ElvUI_SLE/modules/equipmanager/equipmanager.lua
new file mode 100644
index 0000000..c22d1b0
--- /dev/null
+++ b/ElvUI_SLE/modules/equipmanager/equipmanager.lua
@@ -0,0 +1,88 @@
+--Raid mark bar. Similar to quickmark which just semms to be impossible to skin
+local E, L, V, P, G, _ = unpack(ElvUI); --Inport: Engine, Locales, PrivateDB, ProfileDB, GlobalDB, Localize Underscore
+local EM = E:NewModule('EquipManager', 'AceHook-3.0', 'AceEvent-3.0');
+
+EM.equipSets = {
+["NONE"] = NONE,
+}
+
+function EM:FillTable()
+	for i = 1, GetNumEquipmentSets() do
+		local name, icon, lessIndex = GetEquipmentSetInfo(i)
+		if name then
+			EM.equipSets[name] = name
+		end
+	end
+end
+
+function EM:Equip(event)
+	local primary = GetSpecialization()
+	if primary ~= nil then
+		local inInstance, instanceType = IsInInstance()
+		if (event == "ACTIVE_TALENT_GROUP_CHANGED") then
+			if GetActiveSpecGroup() == 1 then
+				UseEquipmentSet(E.private.sle.equip.primary)
+			else
+				UseEquipmentSet(E.private.sle.equip.secondary)
+			end
+		end
+		if (instanceType == "party" or instanceType == "raid") then
+			UseEquipmentSet(E.private.sle.equip.instance)
+		end
+		if (instanceType == "pvp" or instanceType == "arena") then
+			UseEquipmentSet(E.private.sle.equip.pvp)
+		end
+		if E.private.sle.equip.pvp ~= "NONE" then
+			for i = 1, GetNumWorldPVPAreas() do
+				local _, localizedName, isActive = GetWorldPVPAreaInfo(i)
+
+				if (GetRealZoneText() == localizedName and isActive) then
+					UseEquipmentSet(E.private.sle.equip.pvp)
+				end
+			end
+		end
+	end
+end
+
+function EM:EquipSpamFilter(event, msg, ...)
+	if strfind(msg, string.gsub(ERR_LEARN_ABILITY_S:gsub('%.', '%.'), '%%s', '(.*)')) then
+		return true
+	elseif strfind(msg, string.gsub(ERR_LEARN_SPELL_S:gsub('%.', '%.'), '%%s', '(.*)')) then
+		return true
+	elseif strfind(msg, string.gsub(ERR_SPELL_UNLEARNED_S:gsub('%.', '%.'), '%%s', '(.*)')) then
+		return true
+	elseif strfind(msg, string.gsub(ERR_LEARN_PASSIVE_S:gsub('%.', '%.'), '%%s', '(.*)')) then
+		return true
+	end
+
+	return false, msg, ...
+end
+
+function EM:EnableSpamFilter()
+	ChatFrame_AddMessageEventFilter("CHAT_MSG_SYSTEM", EM.EquipSpamFilter)
+end
+
+function EM:DisableSpamFilter()
+	ChatFrame_RemoveMessageEventFilter("CHAT_MSG_SYSTEM", EM.EquipSpamFilter)
+end
+
+function EM:SpamThrottle()
+	if E.private.sle.equip.spam then
+		EM:EnableSpamFilter()
+	else
+		EM:DisableSpamFilter()
+	end
+end
+
+function EM:Initialize()
+	if not E.private.sle.equip.enable then return end
+	EM:FillTable()
+	EM:SpamThrottle()
+	self:RegisterEvent("PLAYER_ENTERING_WORLD", "Equip")
+	self:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED", "Equip")
+	self:RegisterEvent("PLAYER_TALENT_UPDATE", "Equip")
+	self:RegisterEvent("ZONE_CHANGED", "Equip")
+	self:RegisterEvent("EQUIPMENT_SETS_CHANGED", "FillTable")
+end
+
+E:RegisterModule(EM:GetName())
\ No newline at end of file
diff --git a/ElvUI_SLE/modules/equipmanager/load_equipmanager.xml b/ElvUI_SLE/modules/equipmanager/load_equipmanager.xml
new file mode 100644
index 0000000..da2a31a
--- /dev/null
+++ b/ElvUI_SLE/modules/equipmanager/load_equipmanager.xml
@@ -0,0 +1,4 @@
+<Ui xmlns="http://www.blizzard.com/wow/ui/">
+	<Script file='equipmanager.lua'/>
+	<Script file='options.lua'/>
+</Ui>
\ No newline at end of file
diff --git a/ElvUI_SLE/modules/equipmanager/options.lua b/ElvUI_SLE/modules/equipmanager/options.lua
new file mode 100644
index 0000000..2f08f87
--- /dev/null
+++ b/ElvUI_SLE/modules/equipmanager/options.lua
@@ -0,0 +1,90 @@
+local E, L, V, P, G, _ = unpack(ElvUI); --Inport: Engine, Locales, PrivateDB, ProfileDB, GlobalDB, Localize Underscore
+local EM = E:GetModule('EquipManager')
+
+local function configTable()
+
+E.Options.args.sle.args.equipmanager = {
+	type = 'group',
+	order = 2,
+	name = L['Equipment manager'],
+	args = {
+		intro = {
+			order = 1,
+			type = 'description',
+			name = L["EM_DESC"],
+		},
+		enable = {
+			type = "toggle",
+			order = 2,
+			name = L['Enable'],
+			get = function(info) return E.private.sle.equip.enable end,
+			set = function(info, value) E.private.sle.equip.enable = value; E:StaticPopup_Show("PRIVATE_RL") end
+		},
+		spam = {
+			type = "toggle",
+			order = 3,
+			name = L['Spam Throttling'],
+			disabled = function() return not E.private.sle.equip.enable end,
+			get = function(info) return E.private.sle.equip.spam end,
+			set = function(info, value) E.private.sle.equip.spam = value; EM:SpamThrottle() end
+		},
+		equipsets = {
+			type = "group",
+			name = PAPERDOLL_EQUIPMENTMANAGER,
+			order = 4,
+			disabled = function() return not E.private.sle.equip.enable end,
+			guiInline = true,
+			args = {
+				intro = {
+					order = 1,
+					type = 'description',
+					name = L["Here you can choose what equipment sets to use in different situations."],
+				},
+				primary = {
+					order = 2,
+					type = "select",
+					name = SPECIALIZATION_PRIMARY,
+					desc = L["Equip this set when switching to primary talents."],
+					get = function(info) return E.private.sle.equip.primary end,
+					set = function(info, value) E.private.sle.equip.primary = value; end,
+					values = EM.equipSets
+				},
+				secondary = {
+					order = 3,
+					type = "select",
+					name = SPECIALIZATION_SECONDARY,
+					desc = L["Equip this set when switching to secondary talents."],
+					get = function(info) return E.private.sle.equip.secondary end,
+					set = function(info, value) E.private.sle.equip.secondary = value end,
+					values = EM.equipSets
+				},
+				spacer = {
+					type = "description",
+					order = 4,
+					name = "",
+				},
+				instance = {
+					order = 5,
+					type = "select",
+					name = DUNGEONS,
+					desc = L["Equip this set after entering dungeons or raids."],
+					get = function(info) return E.private.sle.equip.instance end,
+					set = function(info, value) E.private.sle.equip.instance = value end,
+					values = EM.equipSets
+				},
+				pvp = {
+					order = 6,
+					type = "select",
+					name = PVP,
+					desc = L["Equip this set after entering battlegrounds or arens."],
+					get = function(info) return E.private.sle.equip.pvp end,
+					set = function(info, value) E.private.sle.equip.pvp = value end,
+					values = EM.equipSets
+				},
+			},
+		},
+	},
+}
+end
+
+table.insert(E.SLEConfigs, configTable)
\ No newline at end of file
diff --git a/ElvUI_SLE/modules/load_modules.xml b/ElvUI_SLE/modules/load_modules.xml
index 7be1620..ed2a179 100644
--- a/ElvUI_SLE/modules/load_modules.xml
+++ b/ElvUI_SLE/modules/load_modules.xml
@@ -7,13 +7,13 @@
 	<Include file='characterframe\load_characterframe.xml'/>
 	<Include file='chat\load_chat.xml'/>
 	<Include file='datatexts\load_datatexts.xml'/>
+	<Include file='equipmanager\load_equipmanager.xml'/>
 	<Include file='errors\load_errors.xml'/>
 	<Include file='exprepbar\load_exprepbar.xml'/>
 	<Include file='farm\load_farm.xml'/>
 	<Include file='marks\load_marks.xml'/>
 	<Include file='minimap\load_minimap.xml'/>
 	<Include file='raidutility\load_raidutility.xml'/>
-	<Include file='specswitch\load_specswitch.xml'/>
 	<Include file='tooltip\load_tooltip.xml'/>
 	<Include file='uibuttons\load_uibuttons.xml'/>
 	<Include file='unitframes\load_unitframes.xml'/>
diff --git a/ElvUI_SLE/modules/specswitch/load_specswitch.xml b/ElvUI_SLE/modules/specswitch/load_specswitch.xml
deleted file mode 100644
index df31ee9..0000000
--- a/ElvUI_SLE/modules/specswitch/load_specswitch.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-<Ui xmlns="http://www.blizzard.com/wow/ui/">
-	<Script file='specswitch.lua'/>
-	<Script file='options.lua'/>
-</Ui>
\ No newline at end of file
diff --git a/ElvUI_SLE/modules/specswitch/options.lua b/ElvUI_SLE/modules/specswitch/options.lua
deleted file mode 100644
index 49ec35c..0000000
--- a/ElvUI_SLE/modules/specswitch/options.lua
+++ /dev/null
@@ -1,2 +0,0 @@
-local E, L, V, P, G, _ = unpack(ElvUI); --Inport: Engine, Locales, PrivateDB, ProfileDB, GlobalDB, Localize Underscore
-local SS = E:GetModule('SpecSwitch')
\ No newline at end of file
diff --git a/ElvUI_SLE/modules/specswitch/specswitch.lua b/ElvUI_SLE/modules/specswitch/specswitch.lua
deleted file mode 100644
index 9b161e0..0000000
--- a/ElvUI_SLE/modules/specswitch/specswitch.lua
+++ /dev/null
@@ -1,57 +0,0 @@
---Raid mark bar. Similar to quickmark which just semms to be impossible to skin
-local E, L, V, P, G, _ = unpack(ElvUI); --Inport: Engine, Locales, PrivateDB, ProfileDB, GlobalDB, Localize Underscore
-local SS = E:NewModule('SpecSwitch', 'AceHook-3.0', 'AceEvent-3.0');
-
-function SS:Equip(event)
-	print("1")
-	SS:EnableSpecSwitcherSpamFilter()
-	local primary = GetSpecialization()
-	if primary ~= nil then
-		local inInstance, instanceType = IsInInstance()
-		if (event == "ACTIVE_TALENT_GROUP_CHANGED") then
-			if GetActiveSpecGroup() == 1 then
-				UseEquipmentSet(E.private.sle.specswitch.primary)
-			else
-				UseEquipmentSet(E.private.sle.specswitch.secondary)
-			end
-		end
-		if (instanceType == "party" or instanceType == "raid") then
-			UseEquipmentSet(E.private.sle.specswitch.instance)
-		end
-		if (instanceType == "pvp" or instanceType == "arena") then
-			UseEquipmentSet(E.private.sle.specswitch.pvp)
-		end
-	end
-end
-
-function SS:SpecSwitcherSpamFilter(event, msg, ...)
-	if strfind(msg, string.gsub(ERR_LEARN_ABILITY_S:gsub('%.', '%.'), '%%s', '(.*)')) then
-		return true
-	elseif strfind(msg, string.gsub(ERR_LEARN_SPELL_S:gsub('%.', '%.'), '%%s', '(.*)')) then
-		return true
-	elseif strfind(msg, string.gsub(ERR_SPELL_UNLEARNED_S:gsub('%.', '%.'), '%%s', '(.*)')) then
-		return true
-	elseif strfind(msg, string.gsub(ERR_LEARN_PASSIVE_S:gsub('%.', '%.'), '%%s', '(.*)')) then
-		return true
-	end
-
-	return false, msg, ...
-end
-
-function SS:EnableSpecSwitcherSpamFilter()
-	ChatFrame_AddMessageEventFilter("CHAT_MSG_SYSTEM", SS.SpecSwitcherSpamFilter)
-end
-
-function SS:DisableSpecSwitcherSpamFilter()
-	ChatFrame_RemoveMessageEventFilter("CHAT_MSG_SYSTEM", SpecSwitcherSpamFilter)
-end
-
-
-function SS:Initialize()
-	if not E.private.sle.specswitch.enable then return end
-	self:RegisterEvent("PLAYER_ENTERING_WORLD", "Equip")
-	self:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED", "Equip")
-	self:RegisterEvent("PLAYER_TALENT_UPDATE", "Equip")
-end
-
-E:RegisterModule(SS:GetName())
\ No newline at end of file