Quantcast

Replacing tooltip scanning in armory with shiny new api from 7.1

Darthpred [10-19-16 - 17:19]
Replacing tooltip scanning in armory with shiny new api from 7.1
Filename
ElvUI_SLE/modules/Armory/CharacterArmory/CharacterArmory.lua
ElvUI_SLE/modules/Armory/Constants.lua
ElvUI_SLE/modules/Armory/InspectArmory/InspectArmory.lua
diff --git a/ElvUI_SLE/modules/Armory/CharacterArmory/CharacterArmory.lua b/ElvUI_SLE/modules/Armory/CharacterArmory/CharacterArmory.lua
index d4f0511..2f463a7 100644
--- a/ElvUI_SLE/modules/Armory/CharacterArmory/CharacterArmory.lua
+++ b/ElvUI_SLE/modules/Armory/CharacterArmory/CharacterArmory.lua
@@ -668,17 +668,14 @@ function CA:Update_Gear()
 						end
 					end

-					_, _, ItemRarity, BasicItemLevel, _, _, _, _, ItemType, ItemTexture = T.GetItemInfo(ItemLink)
+					_, _, ItemRarity, _, _, _, _, _, ItemType, ItemTexture = T.GetItemInfo(ItemLink)
+					TrueItemLevel, _, BasicItemLevel = GetDetailedItemLevelInfo(ItemLink)
 					R, G, B = T.GetItemQualityColor(ItemRarity)

 					--<< Enchant Parts >>--
 					for i = 1, self.ScanTT:NumLines() do
 						CurrentLineText = _G["Knight_CharacterArmory_ScanTTTextLeft"..i]:GetText()
-						if CurrentLineText:find(Info.Armory_Constants.ItemLevelKey_Alt) then
-								TrueItemLevel = T.tonumber(CurrentLineText:match(Info.Armory_Constants.ItemLevelKey_Alt))
-						elseif CurrentLineText:find(Info.Armory_Constants.ItemLevelKey) then
-							TrueItemLevel = T.tonumber(CurrentLineText:match(Info.Armory_Constants.ItemLevelKey))
-						elseif CurrentLineText:find(Info.Armory_Constants.EnchantKey) then
+						if CurrentLineText:find(Info.Armory_Constants.EnchantKey) then
 							if E.db.sle.Armory.Character.Enchant.Display ~= 'Hide' then
 								CurrentLineText = CurrentLineText:match(Info.Armory_Constants.EnchantKey) -- Get enchant string
 								CurrentLineText = T.gsub(CurrentLineText, ITEM_MOD_AGILITY_SHORT, AGI)
diff --git a/ElvUI_SLE/modules/Armory/Constants.lua b/ElvUI_SLE/modules/Armory/Constants.lua
index bad80f8..a696850 100644
--- a/ElvUI_SLE/modules/Armory/Constants.lua
+++ b/ElvUI_SLE/modules/Armory/Constants.lua
@@ -5,8 +5,6 @@ local KF, Info, Timer = unpack(ElvUI_KnightFrame)
 local gsub = gsub

 Info.Armory_Constants = {
-	ItemLevelKey = ITEM_LEVEL:gsub('%%d', '(.+)'),
-	ItemLevelKey_Alt = ITEM_LEVEL_ALT:gsub('%%d', '.+'):gsub('%(.+%)', '%%((.+)%%)'),
 	EnchantKey = ENCHANTED_TOOLTIP_LINE:gsub('%%s', '(.+)'),
 	ItemSetBonusKey = ITEM_SET_BONUS:gsub('%%s', '(.+)'),
 	--TransmogrifiedKey = TRANSMOGRIFIED:gsub('%%s', '(.+)'),
diff --git a/ElvUI_SLE/modules/Armory/InspectArmory/InspectArmory.lua b/ElvUI_SLE/modules/Armory/InspectArmory/InspectArmory.lua
index e4c296a..4e109a0 100644
--- a/ElvUI_SLE/modules/Armory/InspectArmory/InspectArmory.lua
+++ b/ElvUI_SLE/modules/Armory/InspectArmory/InspectArmory.lua
@@ -1833,7 +1833,8 @@ function IA:InspectFrame_DataSetting(DataTable)
 							end
 						end

-						_, _, ItemRarity, BasicItemLevel, _, _, _, _, ItemType, ItemTexture = T.GetItemInfo(Slot.Link)
+						_, _, ItemRarity, _, _, _, _, _, ItemType, ItemTexture = T.GetItemInfo(Slot.Link)
+						TrueItemLevel, _, BasicItemLevel = GetDetailedItemLevelInfo(Slot.Link)
 						R, G, B = T.GetItemQualityColor(ItemRarity)

 						ItemUpgradeID = Slot.Link:match(":(%d+)\124h%[")
@@ -1841,12 +1842,7 @@ function IA:InspectFrame_DataSetting(DataTable)
 						--<< Enchant Parts >>--
 						for i = 1, self.ScanTT:NumLines() do
 							CurrentLineText = _G["InspectArmoryScanTTTextLeft"..i]:GetText()
-
-							if CurrentLineText:find(Info.Armory_Constants.ItemLevelKey_Alt) then
-								TrueItemLevel = T.tonumber(CurrentLineText:match(Info.Armory_Constants.ItemLevelKey_Alt))
-							elseif CurrentLineText:find(Info.Armory_Constants.ItemLevelKey) then
-								TrueItemLevel = T.tonumber(CurrentLineText:match(Info.Armory_Constants.ItemLevelKey))
-							elseif CurrentLineText:find(Info.Armory_Constants.EnchantKey) then
+							if CurrentLineText:find(Info.Armory_Constants.EnchantKey) then
 								if E.db.sle.Armory.Inspect.Enchant.Display ~= 'Hide' then
 									CurrentLineText = CurrentLineText:match(Info.Armory_Constants.EnchantKey) -- Get enchant string
 									CurrentLineText = gsub(CurrentLineText, ITEM_MOD_AGILITY_SHORT, AGI)