Quantcast

Another bunch of localized functions

Darthpred [11-17-13 - 23:07]
Another bunch of localized functions
Filename
ElvUI_SLE/modules/autorelease/autorelease.lua
ElvUI_SLE/modules/chat/chat.lua
ElvUI_SLE/modules/datatexts/lfr.lua
ElvUI_SLE/modules/datatexts/mail.lua
ElvUI_SLE/modules/datatexts/played.lua
ElvUI_SLE/modules/datatexts/version.lua
ElvUI_SLE/modules/equipmanager/equipmanager.lua
diff --git a/ElvUI_SLE/modules/autorelease/autorelease.lua b/ElvUI_SLE/modules/autorelease/autorelease.lua
index e1ca7b0..8b0a908 100755
--- a/ElvUI_SLE/modules/autorelease/autorelease.lua
+++ b/ElvUI_SLE/modules/autorelease/autorelease.lua
@@ -10,6 +10,7 @@ local GetSpellCooldown = GetSpellCooldown
 local level = 0
 local cd
 local GetTime = GetTime
+local RepopMe = RepopMe

 local function Check(level, cd)
 	if ((myclass ~= "SHAMAN") and not (soulstone and UnitBuff("player", soulstone))) then
diff --git a/ElvUI_SLE/modules/chat/chat.lua b/ElvUI_SLE/modules/chat/chat.lua
index 018c252..90e026c 100755
--- a/ElvUI_SLE/modules/chat/chat.lua
+++ b/ElvUI_SLE/modules/chat/chat.lua
@@ -32,16 +32,18 @@ local darth = "|TInterface\\AddOns\\ElvUI_SLE\\media\\textures\\SLE_Chat_LogoD.t
 local friend = "|TInterface\\AddOns\\ElvUI_SLE\\media\\textures\\Chat_Friend:13:13|t"
 local test = "|TInterface\\AddOns\\ElvUI_SLE\\media\\textures\\Chat_Test:13:13|t"
 local rpg = "|TInterface\\AddOns\\ElvUI_SLE\\media\\textures\\Chat_RPG:13:35|t"
+local tyrone = "|TInterface\\AddOns\\ElvUI\\media\\textures\\tyrone_biggums_chat_logo.tga:16:18|t"
+local heart = "|TInterface\\AddOns\\ElvUI\\media\\textures\\heart_chat_logo.tga:15:15|t"

 local specialChatIcons = {
 	["BleedingHollow"] = {
-		["Tirain"] = "|TInterface\\AddOns\\ElvUI\\media\\textures\\tyrone_biggums_chat_logo.tga:16:18|t"
+		["Tirain"] = tyrone
 	},
 	["Spirestone"] = {
 		["Elvz"] = elvui,
 		["Elv"] = elvui,
-		["Sinth"] = "|TInterface\\AddOns\\ElvUI\\media\\textures\\tyrone_biggums_chat_logo.tga:16:18|t",
-		["Athlina"] = "|TInterface\\AddOns\\ElvUI\\media\\textures\\heart_chat_logo.tga:15:15|t"
+		["Sinth"] = tyrone,
+		["Athlina"] = heart
 	},
 	["Illidan"] = {
 		--Original Stuff
diff --git a/ElvUI_SLE/modules/datatexts/lfr.lua b/ElvUI_SLE/modules/datatexts/lfr.lua
index 5c92383..cb4c4e7 100755
--- a/ElvUI_SLE/modules/datatexts/lfr.lua
+++ b/ElvUI_SLE/modules/datatexts/lfr.lua
@@ -2,6 +2,11 @@
 local E, L, V, P, G, _ = unpack(ElvUI); --Inport: Engine, Locales, PrivateDB, ProfileDB, GlobalDB, Localize Underscore
 local DT = E:GetModule('DataTexts')

+local GetLFGDungeonEncounterInfo = GetLFGDungeonEncounterInfo
+local AddLine = AddLine
+local AddDoubleLine = AddDoubleLine
+local GetMapNameByID = GetMapNameByID
+
 --For 4 boss raid
 function DT:FourKill(id)
 	local killNum = 0
diff --git a/ElvUI_SLE/modules/datatexts/mail.lua b/ElvUI_SLE/modules/datatexts/mail.lua
index eff62ab..8d441f9 100644
--- a/ElvUI_SLE/modules/datatexts/mail.lua
+++ b/ElvUI_SLE/modules/datatexts/mail.lua
@@ -5,6 +5,7 @@ local Mail_Icon = "|TInterface\\MINIMAP\\TRACKING\\Mailbox.blp:14:14|t";
 local OldShow = MiniMapMailFrame.Show

 local Read;
+local AddLine = AddLine


 local function MakeIconString()
diff --git a/ElvUI_SLE/modules/datatexts/played.lua b/ElvUI_SLE/modules/datatexts/played.lua
index 5c348a9..2aa9b98 100644
--- a/ElvUI_SLE/modules/datatexts/played.lua
+++ b/ElvUI_SLE/modules/datatexts/played.lua
@@ -5,9 +5,9 @@ local format, GetTime, ChatFrame_TimeBreakDown, InCombatLockdown = format, GetTi
 local PlayedTimeFormatFull = '%d D %02d:%02d:%02d'
 local PlayedTimeFormatNoDay = '%02d:%02d:%02d'
 local TotalPlayTime, LevelPlayTime, SessionPlayTime, LevelPlayedOffset, LastLevelTime
-local MyRealm = GetRealmName()
-local MyName = UnitName('player')
-local MyClass = select(2, UnitClass('player'))
+local MyRealm = E.myrealm
+local MyName = E.myname
+local MyClass = E.myclass

 local OnEnter = function(self)
 	if not InCombatLockdown() and SessionPlayTime then
diff --git a/ElvUI_SLE/modules/datatexts/version.lua b/ElvUI_SLE/modules/datatexts/version.lua
index b7e632a..d1f2f44 100755
--- a/ElvUI_SLE/modules/datatexts/version.lua
+++ b/ElvUI_SLE/modules/datatexts/version.lua
@@ -1,43 +1,46 @@
---Version datatext. Only in Russian for now.
-local E, L, V, P, G, _ = unpack(ElvUI); --Inport: Engine, Locales, PrivateDB, ProfileDB, GlobalDB, Localize Underscore
-local DT = E:GetModule('DataTexts')
-local SLE = E:GetModule('SLE')
-local ACD = LibStub("AceConfigDialog-3.0")
-
-local displayString = '';
-local lastPanel;
-local self = lastPanel
-local join = string.join
-E.version = GetAddOnMetadata("ElvUI", "Version");
-
-local function OnEvent(self, event, ...)
-	self.text:SetFormattedText(displayString, 'ElvUI v', E.version, SLE.version);
-end
-
-local function Click()
-	ElvConfigToggle:Click();
-	ACD:SelectGroup("ElvUI", "sle")
-end
-
-local function OnEnter(self)
-	DT:SetupTooltip(self)
-
-	DT.tooltip:AddDoubleLine("ElvUI "..L["Version"]..format(": |cff99ff33%s|r",E.version))
-	DT.tooltip:AddLine(L["SLE_AUTHOR_INFO"]..". "..L["Version"]..format(": |cff99ff33%s|r",SLE.version))
-	DT.tooltip:AddLine(" ")
-	DT.tooltip:AddLine(L['SLE_CONTACTS'])
-
-	DT.tooltip:Show()
-end
-
-local function ValueColorUpdate(hex, r, g, b)
-	displayString = join("", "%s", hex, "%.2f|r", " : Shadow & Light Edit v", hex, "%.2f|r")
-
-	if lastPanel ~= nil then
-		OnEvent(lastPanel)
-	end
-end
-E['valueColorUpdateFuncs'][ValueColorUpdate] = true
-
-DT:RegisterDatatext("Version", {'PLAYER_ENTERING_WORLD'}, OnEvent, Update, Click, OnEnter)
-
+--Version datatext. Only in Russian for now.
+local E, L, V, P, G, _ = unpack(ElvUI); --Inport: Engine, Locales, PrivateDB, ProfileDB, GlobalDB, Localize Underscore
+local DT = E:GetModule('DataTexts')
+local SLE = E:GetModule('SLE')
+local ACD = LibStub("AceConfigDialog-3.0")
+
+local displayString = '';
+local lastPanel;
+local self = lastPanel
+local join = string.join
+local AddLine = AddLine
+local AddDoubleLine =AddDoubleLine
+local Eversion = E.version
+local format = format
+
+local function OnEvent(self, event, ...)
+	self.text:SetFormattedText(displayString, 'ElvUI v', Eversion, SLE.version);
+end
+
+local function Click()
+	ElvConfigToggle:Click();
+	ACD:SelectGroup("ElvUI", "sle")
+end
+
+local function OnEnter(self)
+	DT:SetupTooltip(self)
+
+	DT.tooltip:AddDoubleLine("ElvUI "..L["Version"]..format(": |cff99ff33%s|r",Eversion))
+	DT.tooltip:AddLine(L["SLE_AUTHOR_INFO"]..". "..L["Version"]..format(": |cff99ff33%s|r",SLE.version))
+	DT.tooltip:AddLine(" ")
+	DT.tooltip:AddLine(L['SLE_CONTACTS'])
+
+	DT.tooltip:Show()
+end
+
+local function ValueColorUpdate(hex, r, g, b)
+	displayString = join("", "%s", hex, "%.2f|r", " : Shadow & Light Edit v", hex, "%.2f|r")
+
+	if lastPanel ~= nil then
+		OnEvent(lastPanel)
+	end
+end
+E['valueColorUpdateFuncs'][ValueColorUpdate] = true
+
+DT:RegisterDatatext("Version", {'PLAYER_ENTERING_WORLD'}, OnEvent, Update, Click, OnEnter)
+
diff --git a/ElvUI_SLE/modules/equipmanager/equipmanager.lua b/ElvUI_SLE/modules/equipmanager/equipmanager.lua
index a7b994c..e9a5617 100755
--- a/ElvUI_SLE/modules/equipmanager/equipmanager.lua
+++ b/ElvUI_SLE/modules/equipmanager/equipmanager.lua
@@ -1,88 +1,97 @@
---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()
-	EM:SpamThrottle()
-	if not E.private.sle.equip.enable then return end
-	EM:FillTable()
-	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
-
+--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');
+
+local GetEquipmentSetInfo = GetEquipmentSetInfo
+local GetSpecialization = GetSpecialization
+local IsInInstance = IsInInstance
+local GetActiveSpecGroup = GetActiveSpecGroup
+local UseEquipmentSet = UseEquipmentSet
+local GetNumWorldPVPAreas = GetNumWorldPVPAreas
+local GetWorldPVPAreaInfo = GetWorldPVPAreaInfo
+local gsub, strfind = string.gsub, string.find, string.sub
+
+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()
+	EM:SpamThrottle()
+	if not E.private.sle.equip.enable then return end
+	EM:FillTable()
+	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