Edit: I guess I should refresh the page before typing my reply when it's been sitting on the reply page for 2 hours because I got distracted by work, but oh well. Leaving this here anyway.
On its own, "calling GetItemInfo" won't actually do anything:
Code:
/run GetItemInfo(6948)
You need additional code to catch the return values and do something with those. Let's say, for the sake of example, that you want to print those values to the chat frame, in which case something like this would probably work:
Lua Code:
hooksecurefunc("ContainerFrameItemButton_OnModifiedClick", function(self, button)
if button ~= "MiddleButton" or not IsShiftKeyDown() then
return
end
local name, link, rarity, level, minLevel, type, subType, stackCount, equipLoc, texture, sellPrice = GetItemInfo(GetContainerItemID(self:GetParent():GetId(), self:GetID())
print(format("|T%s:0|t %s", texture, link))
print(" Quality:", _G["ITEM_QUALITY"..rarity.."_DESC"])
print(" Item Type:", type)
print(" Item Subtype:", subType)
if strlen(equipLoc) > 0 then
print(" Equip Location:", equipLoc)
end
if level > 1 then
print(" Item Level:", level)
end
if minLevel > 0 then
print(" Requires Level:", minLevel)
end
if sellPrice >= 10000 then
return format("|cffffd700%d|r%s |cffc7c7cf%d|r%s %d%s", abs(sellPrice / 10000), GOLD_AMOUNT_SYMBOL, abs(mod(sellPrice / 100, 100)), SILVER_AMOUNT_SYMBOL, abs(mod(sellPrice, 100)), COPPER_AMOUNT_SYMBOL)
elseif sellPrice >= 100 then
return format("|cffc7c7cf%d|r%s %d%s", abs(mod(sellPrice / 100, 100)), SILVER_AMOUNT_SYMBOL, abs(mod(sellPrice, 100)), COPPER_AMOUNT_SYMBOL)
else
return format("%d%s", abs(mod(sellPrice, 100)), COPPER_AMOUNT_SYMBOL)
end
end)
You probably also need to tell the buttons to respond to middle-clicks, instead of just left- and right-clicks:
Lua Code:
for i = 1, 13 do
for j = 1, 36 do
_G["ContainerFrame"..i.."Item"..j]::RegisterForClicks("AnyUp")
end
end
If you're using a third-party bag addon that doesn't reuse the Blizzard item buttons, you'll need to modify its buttons and hook its click-handling function instead.