Quantcast

Clean UP

Repooc [07-30-14 - 03:39]
Clean UP
Filename
ElvUI_SLE/modules/autorelease.lua
ElvUI_SLE/modules/backgrounds.lua
ElvUI_SLE/modules/baginfo.lua
ElvUI_SLE/modules/datatexts.lua
ElvUI_SLE/modules/equipmanager.lua
ElvUI_SLE/modules/exprepbar.lua
diff --git a/ElvUI_SLE/modules/autorelease.lua b/ElvUI_SLE/modules/autorelease.lua
index 79c550d..6da9c27 100644
--- a/ElvUI_SLE/modules/autorelease.lua
+++ b/ElvUI_SLE/modules/autorelease.lua
@@ -29,7 +29,7 @@ local function Releasing()
 	if (inInstance and (instanceType == "pvp")) then
 		if E.db.sle.pvpautorelease then Check(level, cd) end
 	end
-
+
 	-- auto resurrection for world PvP area...when active
 	if E.db.sle.pvpautorelease then
 		for index = 1, GetNumWorldPVPAreas() do
diff --git a/ElvUI_SLE/modules/backgrounds.lua b/ElvUI_SLE/modules/backgrounds.lua
index da604a1..5be70f0 100644
--- a/ElvUI_SLE/modules/backgrounds.lua
+++ b/ElvUI_SLE/modules/backgrounds.lua
@@ -9,21 +9,20 @@ local function CreateFrames()
 	BGl = CreateFrame('Frame', "LeftBG", E.UIParent);
 	BGr = CreateFrame('Frame', "RightBG", E.UIParent);
 	BGa = CreateFrame('Frame', "ActionBG", E.UIParent);
-
+
 	Fr = {
 		BottomBG = {BGb,"bottom"},
 		LeftBG = {BGl,"left"},
 		RightBG = {BGr,"right"},
 		ActionBG = {BGa,"action"},
-	}
-
+
 	for _,v in pairs(Fr) do
 		v[1]:SetFrameLevel(v[1]:GetFrameLevel() - 1)
 		v[1]:SetScript("OnShow", function() v[1]:SetFrameStrata('BACKGROUND') end)
 		v[1].tex = v[1]:CreateTexture(nil, 'OVERLAY')
 		v[1]:Hide()
 	end
-
+
 	BGb:EnableMouse(true) --Maybe add an option to actually allow change this click catching?
 	BGb.tex:SetAlpha(0.5)
 	--Also the problem. As long as bottom bg can be transparent it's no good in keeping fixed transparency for the texture.
@@ -82,7 +81,7 @@ function BG:UpdateFrames()
 	if not BGb then return end
 	local db = E.db.sle.backgrounds
 	for _,v in pairs(Fr) do
-				v[1]:SetTemplate(db[v[2]].template, true)
+		v[1]:SetTemplate(db[v[2]].template, true)
 	end
 	FramesSize()
 	FramesVisibility()
@@ -107,7 +106,7 @@ function BG:Initialize()
 	FramesPositions()
 	BG:UpdateFrames()
 	BG:RegisterHide()
-
+
 	E:CreateMover(BottomBG, "BottomBG_Mover", L["Bottom BG"], nil, nil, nil, "S&L,S&L BG")
 	E:CreateMover(LeftBG, "LeftBG_Mover", L["Left BG"], nil, nil, nil, "S&L,S&L BG")
 	E:CreateMover(RightBG, "RightBG_Mover", L["Right BG"], nil, nil, nil, "S&L,S&L BG")
diff --git a/ElvUI_SLE/modules/baginfo.lua b/ElvUI_SLE/modules/baginfo.lua
index b03b0f7..ac8209a 100644
--- a/ElvUI_SLE/modules/baginfo.lua
+++ b/ElvUI_SLE/modules/baginfo.lua
@@ -11,21 +11,24 @@ local infoArray = {}
 local equipmentMap = {}

 local function Utf8Sub(str, start, numChars)
-  local currentIndex = start
-  while numChars > 0 and currentIndex <= #str do
-    local char = byte(str, currentIndex)
-    if char > 240 then
-      currentIndex = currentIndex + 4
-    elseif char > 225 then
-      currentIndex = currentIndex + 3
-    elseif char > 192 then
-      currentIndex = currentIndex + 2
-    else
-      currentIndex = currentIndex + 1
-    end
-    numChars = numChars -1
-  end
-  return str:sub(start, currentIndex - 1)
+	local currentIndex = start
+	while numChars > 0 and currentIndex <= #str do
+		local char = byte(str, currentIndex)
+
+		if char > 240 then
+			currentIndex = currentIndex + 4
+		elseif char > 225 then
+			currentIndex = currentIndex + 3
+		elseif char > 192 then
+			currentIndex = currentIndex + 2
+		else
+			currentIndex = currentIndex + 1
+		end
+
+		numChars = numChars -1
+	end
+
+	return str:sub(start, currentIndex - 1)
 end

 local function MapKey(bag, slot)
@@ -44,9 +47,11 @@ local function BuildEquipmentMap(clear)
 	for k, v in pairs(equipmentMap) do
 		twipe(v)
 	end
+
 	if clear then return end
-
+
 	local name, player, bank, bags, slot, bag, key
+
 	for i = 1, GetNumEquipmentSets() do
 		name = GetEquipmentSetInfo(i)
 		GetEquipmentSetLocations(name, infoArray)
@@ -129,6 +134,6 @@ function BI:Initialize()
 		tinsert(containers, _G["ElvUI_BankContainerFrame"])
 		BI:ToggleSettings()
 	end)
-
+
 	BI:ToggleSettings()
 end
\ No newline at end of file
diff --git a/ElvUI_SLE/modules/datatexts.lua b/ElvUI_SLE/modules/datatexts.lua
index dad003f..df12d9a 100644
--- a/ElvUI_SLE/modules/datatexts.lua
+++ b/ElvUI_SLE/modules/datatexts.lua
@@ -45,8 +45,9 @@ local function AddPanels()
 	for _,v in pairs(panels) do
 		CreateDataPanels(v[5], v[2], v[3], v[4], v[6], v[1])
 	end
+
 	PanelResize()
-
+
 	for _,v in pairs(panels) do
 		E:CreateMover(v[5], v[2].."_Mover", L[v[2]], nil, nil, nil, "ALL,S&L,S&L DT")
 	end
diff --git a/ElvUI_SLE/modules/equipmanager.lua b/ElvUI_SLE/modules/equipmanager.lua
index dfd4098..0309b93 100644
--- a/ElvUI_SLE/modules/equipmanager.lua
+++ b/ElvUI_SLE/modules/equipmanager.lua
@@ -7,8 +7,10 @@ local gsub, strfind = string.gsub, string.find, string.sub

 local function 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)
@@ -16,16 +18,19 @@ local function Equip(event)
 				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
@@ -44,7 +49,7 @@ function EM:EquipSpamFilter(event, msg, ...)
 	elseif strfind(msg, string.gsub(ERR_LEARN_PASSIVE_S:gsub('%.', '%.'), '%%s', '(.*)')) then
 		return true
 	end
-
+
 	return false, msg, ...
 end

diff --git a/ElvUI_SLE/modules/exprepbar.lua b/ElvUI_SLE/modules/exprepbar.lua
index bd09887..f93289f 100644
--- a/ElvUI_SLE/modules/exprepbar.lua
+++ b/ElvUI_SLE/modules/exprepbar.lua
@@ -33,15 +33,15 @@ function M:UpdateExperience(event)
 		bar.statusBar:SetMinMaxValues(0, max)
 		bar.statusBar:SetValue(cur - 1 >= 0 and cur - 1 or 0)
 		bar.statusBar:SetValue(cur)
-
+
 		local rested = GetXPExhaustion()
 		local text = ''
 		local textFormat = E.db.general.experience.textFormat
-
+
 		if rested and rested > 0 then
 			bar.rested:SetMinMaxValues(0, max)
 			bar.rested:SetValue(math.min(cur + rested, max))
-
+
 			if E.db.sle.exprep.explong then
 				if textFormat == 'PERCENT' then
 					text = format('%d%%  '..L['Rested:']..' %d%%', cur / max * 100, rested / max * 100)
@@ -84,13 +84,12 @@ function M:UpdateExperience(event)

 		bar.text:SetText(text)
 	end
-
+
 	self:UpdateExpRepAnchors()
 end

 function M:UpdateReputation(event)
 	local bar = self.repBar
-
 	local ID = 100
 	local name, reaction, min, max, value = GetWatchedFactionInfo()
 	local numFactions = GetNumFactions();
@@ -107,7 +106,7 @@ function M:UpdateReputation(event)

 		bar.statusBar:SetMinMaxValues(0, max - min)
 		bar.statusBar:SetValue(value - min)
-
+
 		for i=1, numFactions do
 			local factionName, _, standingID,_,_,_,_,_,_,_,_,_,_, factionID = GetFactionInfo(i);
 			local friendID, friendRep, friendMaxRep, _, _, _, friendTextLevel = GetFriendshipReputation(factionID);
@@ -120,8 +119,7 @@ function M:UpdateReputation(event)
 				end
 			end
 		end
-
-
+
 		if E.db.sle.exprep.replong then
 			if textFormat == 'PERCENT' then
 				text = format('%d%% [%s]', ((value - min) / (max - min) * 100), isFriend and friendText or _G['FACTION_STANDING_LABEL'..ID])
@@ -139,10 +137,9 @@ function M:UpdateReputation(event)
 				text = format('%s: %s - %d%% [%s]', name, E:ShortValue(value - min), ((value - min) / (max - min) * 100), isFriend and friendText or _G['FACTION_STANDING_LABEL'..ID])
 			end
 		end
-
 		bar.text:SetText(text)
 	end
-
+
 	self:UpdateExpRepAnchors()
 end

@@ -216,6 +213,7 @@ function M:PlayerRepLogin()
 		end
 	end
 end
+
 function M:PlayerGuildRosterUpdate()
 	if IsInGuild() then
 		guildName = (GetGuildInfo("player"))