Use third party lib for itemLevel of inspected.
Peter Eliasson [07-28-16 - 19:03]
Use third party lib for itemLevel of inspected.
diff --git a/.gitignore b/.gitignore
index 794341d..2cd9fef 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
-lib/Ace3
\ No newline at end of file
+lib/Ace3
+lib/LibItemUpgradeInfo-1.0
diff --git a/.pkgmeta b/.pkgmeta
index f4fa298..75b14e8 100644
--- a/.pkgmeta
+++ b/.pkgmeta
@@ -8,3 +8,6 @@ externals:
lib/Ace3:
url: svn://svn.wowace.com/wow/ace3/mainline/trunk
tag: Release-r1151
+ lib/LibItemUpgradeInfo-1.0
+ url: git://git.wowace.com/wow/libitemupgradeinfo-1-0/mainline.git
+ tag: Release-70000-24
diff --git a/lib/lib_include.xml b/lib/lib_include.xml
index 20388cd..eb8ea86 100644
--- a/lib/lib_include.xml
+++ b/lib/lib_include.xml
@@ -1,8 +1,7 @@
<Ui xsi:schemaLocation="http://www.blizzard.com/wow/ui/ ..\..\FrameXML\UI.xsd">
<Script file="Ace3\LibStub\LibStub.lua"/>
-
- <Include file="Ace3\CallbackHandler-1.0\CallbackHandler-1.0.xml"/>
+ <Include file="Ace3\CallbackHandler-1.0\CallbackHandler-1.0.xml"/>
<Include file="Ace3\AceAddon-3.0\AceAddon-3.0.xml"/>
<Include file="Ace3\AceConsole-3.0\AceConsole-3.0.xml"/>
<Include file="Ace3\AceDB-3.0\AceDB-3.0.xml"/>
@@ -10,6 +9,8 @@
<Include file="Ace3\AceGUI-3.0\AceGUI-3.0.xml"/>
<Include file="Ace3\AceHook-3.0\AceHook-3.0.xml"/>
<Include file="Ace3\AceTimer-3.0\AceTimer-3.0.xml"/>
-
<Include file="Ace3\AceConfig-3.0\AceConfig-3.0.xml"/>
+
+ <!-- http://www.wowace.com/addons/libitemupgradeinfo-1-0/ -->
+ <Include file="LibItemUpgradeInfo-1.0\LibItemUpgradeInfo-1.0.xml" />
</Ui>
\ No newline at end of file
diff --git a/src/inspect.lua b/src/inspect.lua
index c3d6330..002d331 100644
--- a/src/inspect.lua
+++ b/src/inspect.lua
@@ -23,6 +23,9 @@ local tinsert = tinsert;
local floor = floor;
local wipe = wipe;
+-- ItemUpgradeInfo, lib for information about item upgrades applied to items.
+local ItemUpgradeInfo = LibStub("LibItemUpgradeInfo-1.0")
+
-- Set up module
local addon = addonTable[1];
local inspect = addon:NewModule("inspect", "AceEvent-3.0", "AceTimer-3.0")
@@ -95,7 +98,7 @@ local function getItemLevel(unitName)
local itemLink = GetInventoryItemLink(unitName, slotId);
if itemLink then
- local _, _, _, itemLevel = GetItemInfo(itemLink)
+ itemLevel = ItemUpgradeInfo:GetUpgradedItemLevel(itemLink)
if itemLevel and itemLevel > 0 then
numItems = numItems + 1;
total = total + itemLevel;