WoWInterface SVN Snoopy

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /trunk
    from Rev 8 to Rev 9
    Reverse comparison

Rev 8 → Rev 9

Snoopy/core.lua
11,13 → 11,19
local UpdateAllData, UpdateUnit, UpdateNote, UpdateTitleText
 
UnitPopupButtons.INSPECT.dist = 0 -- enables "Inspect" option in dropdown
BINDING_HEADER_INSPECT = INSPECT
BINDING_NAME_INSPECT = INSPECT
 
a:SetScript("OnEvent", function(self, event, a1)
self[event](self, a1)
end)
a:Hide()
a:RegisterEvent("ADDON_LOADED")
a:SetScript("OnEvent", function(self, event, a1)
function a:ADDON_LOADED(a1)
if a1 ~= "Blizzard_InspectUI" then return end
a:UnregisterEvent("ADDON_LOADED")
a:SetScript("OnEvent", nil)
a.ADDON_LOADED = nil
InspectFrame:RegisterEvent("INSPECT_TALENT_READY")
InspectFrame:SetScript("OnUpdate", nil)
 
51,15 → 57,25
UpdateNote("Cannot Inspect PVP Enemy", 2)
end
end
local talenttext = { }
function UpdateTitleText(unit, reset)
local gname, gtitle = GetGuildInfo(unit)
local talenttext
for i = 1, reset and 0 or GetNumTalentTabs(), 1 do
local name, _, pts = GetTalentTabInfo(i, true)
if not name then return end
talenttext = format("%s%s%d %s ", talenttext or "", i~=1 and "/ " or "", pts, strsub(name, 1, 3))
if not reset and GetNumTalentTabs() > 0 then
wipe(talenttext)
for i = 1, 3, 1 do
local name, _, pts = GetTalentTabInfo(i, true)
if not name then return end
tinsert(talenttext, pts.." "..strsub(name, 1, 3))
end
else
tinsert(talenttext, "-")
end
InspectTitleText:SetFormattedText( (gname and "%s of <%s>\n%s") or "-%s%s\n%s", gtitle or "", gname or "", talenttext or "-" )
if gname then
InspectTitleText:SetFormattedText("%s of <%s>\n%s", gtitle, gname, table.concat(talenttext, "/ "))
else
InspectTitleText:SetFormattedText("-\n%s", table.concat(talenttext, "/ "))
end
wipe(talenttext)
end
 
InspectFrame_Show = function(unit)
84,29 → 100,42
end
 
oInspectPaperDollItemSlotButton_Update = InspectPaperDollItemSlotButton_Update
InspectPaperDollItemSlotButton_Update = function(button, ...)
oInspectPaperDollItemSlotButton_Update(button, ...)
local unit = InspectFrame.unit
if CheckInteractDistance(unit, 1) then
cache[strsub(button:GetName(), 8)] = GetInventoryItemLink(unit, button:GetID())
InspectPaperDollItemSlotButton_Update = function(self, ...)
oInspectPaperDollItemSlotButton_Update(self, ...)
if CheckInteractDistance(InspectFrame.unit, 1) then
local id = self:GetID()
cache[id] = GetInventoryItemLink(InspectFrame.unit, id)
end
end
 
InspectPaperDollItemSlotButton_OnEnter = function(self)
self = self or this
local name = strsub(self:GetName(), 8)
local unit = InspectFrame.unit
local unit, id = InspectFrame.unit, self:GetID()
GameTooltip:SetOwner(self, "ANCHOR_RIGHT")
if UnitExists(unit) and CheckInteractDistance(unit, 1) and GameTooltip:SetInventoryItem(unit, self:GetID()) then
if UnitExists(unit) and CheckInteractDistance(unit, 1) and GameTooltip:SetInventoryItem(unit, id) then
 
elseif cache[name] then -- retrieved from cache
GameTooltip:SetHyperlink(cache[name])
elseif cache[id] then -- retrieved from cache
GameTooltip:SetHyperlink(cache[id])
else -- empty slot
GameTooltip:SetText((self.checkRelic and UnitHasRelicSlot(unit) and _G.RELICSLOT) or _G[strupper(name)])
GameTooltip:SetText((self.checkRelic and UnitHasRelicSlot(unit) and _G.RELICSLOT) or _G[strupper(strsub(self:GetName(), 8))])
end
CursorUpdate(self)
end
 
local function onclick(self, button)
local unit, id = InspectFrame.unit, self:GetID()
if UnitExists(unit) and CheckInteractDistance(unit, 1) then
HandleModifiedItemClick(GetInventoryItemLink(unit, id))
elseif cache[id] then -- retrieved from cache
HandleModifiedItemClick(cache[id])
end
end
for _, frame in ipairs({ InspectPaperDollFrame:GetChildren() }) do
if frame:GetFrameType() == "Button" and strmatch(frame:GetName(), "Inspect(.+)Slot") then
frame:SetScript("OnClick", onclick)
end
end
 
oInspectPaperDollFrame_OnShow = InspectPaperDollFrame_OnShow
InspectPaperDollFrame_OnShow = function(...)
if not UnitIsPlayer(InspectFrame.unit) then return end
134,4 → 163,4
UpdateNote("Inspect Successful", 2)
end
end)
end)
end
Snoopy/Snoopy.toc
1,8 → 1,8
## Interface: 30000
## Title: Snoopy
## Notes: Easy and lite inspecting
## Notes: Easy inspecting
## Author: TotalPackage
## X-Category: Interface Enhancements
## Version: 3.0.003
## Version: 3.0.004
 
core.lua
Snoopy/Bindings.xml New file
0,0 → 1,9
<Bindings>
<Binding name="INSPECT" runOnUp="true" header="INSPECT">
if not UnitExists("target") then
InspectUnit("mouseover")
else
InspectUnit("target")
end
</Binding>
</Bindings>
Snoopy Property changes : Deleted: tsvn:logtemplate - Snoopy: -