Untitled diff

생성일 비교 결과 만료 없음
1 삭제
716 행
35 추가
744 행
-- InspectEquip
-- InspectEquip


InspectEquip = LibStub("AceAddon-3.0"):NewAddon("InspectEquip", "AceConsole-3.0", "AceHook-3.0", "AceTimer-3.0", "AceEvent-3.0")
InspectEquip = LibStub("AceAddon-3.0"):NewAddon("InspectEquip", "AceConsole-3.0", "AceHook-3.0", "AceTimer-3.0", "AceEvent-3.0")
local L = LibStub("AceLocale-3.0"):GetLocale("InspectEquip")
local L = LibStub("AceLocale-3.0"):GetLocale("InspectEquip")
local IE = InspectEquip
local IE = InspectEquip
local IS = InspectEquip_ItemSources --> ItemSources.lua
local IS = InspectEquip_ItemSources --> ItemSources.lua
local WIN = InspectEquip_InfoWindow --> InfoWindow.xml
local WIN = InspectEquip_InfoWindow --> InfoWindow.xml
local TITLE = InspectEquip_InfoWindowTitle
local TITLE = InspectEquip_InfoWindowTitle
local AVGIL = InspectEquip_InfoWindowAvgItemLevel
local AVGIL = InspectEquip_InfoWindowAvgItemLevel
local exMod = nil
local exMod = nil


local mop = select(4, GetBuildInfo()) >= 50000
local mop = select(4, GetBuildInfo()) >= 50000


local ItemUpgradeInfo = LibStub("LibItemUpgradeInfo-1.0")
local ItemUpgradeInfo = LibStub("LibItemUpgradeInfo-1.0")


local slots = { "HeadSlot", "NeckSlot", "ShoulderSlot", "BackSlot", "ChestSlot",
local slots = { "HeadSlot", "NeckSlot", "ShoulderSlot", "BackSlot", "ChestSlot",
"WristSlot", "HandsSlot", "WaistSlot", "LegsSlot", "FeetSlot",
"WristSlot", "HandsSlot", "WaistSlot", "LegsSlot", "FeetSlot",
"Finger0Slot", "Finger1Slot", "Trinket0Slot", "Trinket1Slot", "MainHandSlot",
"Finger0Slot", "Finger1Slot", "Trinket0Slot", "Trinket1Slot", "MainHandSlot",
"SecondaryHandSlot" } -- TabardSlot, ShirtSlot
"SecondaryHandSlot" } -- TabardSlot, ShirtSlot
local noEnchantWarningSlots = {
local noEnchantWarningSlots = {
["NeckSlot"] = true, ["WaistSlot"] = true, ["Finger0Slot"] = true, ["Finger1Slot"] = true,
["NeckSlot"] = true, ["WaistSlot"] = true, ["Finger0Slot"] = true, ["Finger1Slot"] = true,
["Trinket0Slot"] = true, ["Trinket1Slot"] = true, ["SecondaryHandSlot"] = true, ["RangedSlot"] = true,
["Trinket0Slot"] = true, ["Trinket1Slot"] = true, ["SecondaryHandSlot"] = true, ["RangedSlot"] = true,
}
}


local lines = {}
local lines = {}
local numlines = 0
local numlines = 0
local curline = 0
local curline = 0
local curUnit = nil
local curUnit = nil
local curUnitName = nil
local curUnitName = nil
local curUser = nil
local curUser = nil
local curGUID = nil
local curGUID = nil
local cached = false
local cached = false


local headers = {}
local headers = {}
local numheaders = 0
local numheaders = 0


local yoffset = -40
local yoffset = -40
local hooked = false
local hooked = false
local autoHidden = false
local autoHidden = false


local origInspectUnit
local origInspectUnit


local tonumber = tonumber
local tonumber = tonumber
local gmatch = string.gmatch
local gmatch = string.gmatch
local tinsert = table.insert
local tinsert = table.insert
local tsort = table.sort
local tsort = table.sort
local band = bit.band
local band = bit.band
local Examiner = Examiner
local Examiner = Examiner


--local _,_,_,gameToc = GetBuildInfo()
--local _,_,_,gameToc = GetBuildInfo()


local tooltipTimer = nil
local tooltipTimer = nil
local retryTimer = nil
local retryTimer = nil


if mop then
if mop then
noEnchantWarningSlots["HeadSlot"] = true
noEnchantWarningSlots["HeadSlot"] = true
else
else
tinsert(slots, "RangedSlot")
tinsert(slots, "RangedSlot")
end
end




--------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------


InspectEquipConfig = {}
InspectEquipConfig = {}
local defaults = {
local defaults = {
tooltips = true,
tooltips = true,
showUnknown = true,
showUnknown = true,
inspectWindow = true,
inspectWindow = true,
charWindow = true,
charWindow = true,
checkEnchants = true,
checkEnchants = true,
listItemLevels = true,
listItemLevels = true,
showAvgItemLevel = true,
showAvgItemLevel = true,
ttR = 1.0,
ttR = 1.0,
ttG = 0.75,
ttG = 0.75,
ttB = 0.0,
ttB = 0.0,
maxSourceCount = 5,
maxSourceCount = 5,
}
}


local options = {
local options = {
name = "InspectEquip",
name = "InspectEquip",
type = "group",
type = "group",
args = {
args = {
tooltips = {
tooltips = {
order = 1, type = "toggle", width = "full",
order = 1, type = "toggle", width = "full",
name = L["Add drop information to tooltips"],
name = L["Add drop information to tooltips"],
desc = L["Add item drop information to all item tooltips"],
desc = L["Add item drop information to all item tooltips"],
get = function() return InspectEquipConfig.tooltips end,
get = function() return InspectEquipConfig.tooltips end,
set = function(_,v) InspectEquipConfig.tooltips = v; if v then IE:HookTooltips() end end,
set = function(_,v) InspectEquipConfig.tooltips = v; if v then IE:HookTooltips() end end,
},
},
showunknown = {
showunknown = {
order = 2, type = "toggle", width = "full",
order = 2, type = "toggle", width = "full",
name = L["Include unknown items in overview"],
name = L["Include unknown items in overview"],
desc = L["Show items that cannot be categorized in a seperate category"],
desc = L["Show items that cannot be categorized in a seperate category"],
get = function() return InspectEquipConfig.showUnknown end,
get = function() return InspectEquipConfig.showUnknown end,
set = function(_,v) InspectEquipConfig.showUnknown = v end,
set = function(_,v) InspectEquipConfig.showUnknown = v end,
},
},
inspectwindow = {
inspectwindow = {
order = 3, type = "toggle", width = "full",
order = 3, type = "toggle", width = "full",
name = L["Attach to inspect window"],
name = L["Attach to inspect window"],
desc = L["Show the equipment list when inspecting other characters"],
desc = L["Show the equipment list when inspecting other characters"],