addining item Id to bag item tooltip?
Posted: Tue Jun 25, 2013 6:54 pm
this is a part from Item preview addon that adding item id to item link tooltip
this is from Inventory viewer addon, part wich adding extra info to bag item tooltip
can we make something like that (stan alone addon, or edit one of those two addons) to add item ID to bag item tooltip,
it will be much easyer then searching in item preview.
i tryed but cant get it to work

Code: Select all
function ItemPreview:ItemButton_OnEnter(button)
if button.label:GetText() == "" then return end
GameTooltip:SetOwner(button, "ANCHOR_BOTTOMRIGHT")
GameTooltip:SetHyperLink(button.label:GetText())
GameTooltip1:Hide()
GameTooltip2:Hide()
if not button.itemID then return end
local item = self.itemList[button.itemID]
if self.settings.ShowZone then
local convertFn = function(zoneID)
return GetZoneLocalName(zoneID)
end
local data = self:GetItemFieldString(item, "zones", convertFn)
if data then
GameTooltip:AddLine(" ")
GameTooltip:AddLine("Seen in: " .. data)
end
end
if self.settings.ShowMobs then
local data = self:GetItemFieldString(item, "mobs")
if data then
GameTooltip:AddLine(" ")
GameTooltip:AddLine("Dropped by: " .. data)
end
end
GameTooltip:AddLine(" ")
if self.settings.ShowUpdateTime then
local date = item.date or self.itemList.originalRefreshDate
if date then
GameTooltip:AddLine("Updated on " .. date)
end
end
GameTooltip:AddLine("Item ID: " .. button.itemID)
endCode: Select all
function IV_AppendTooltipData( tooltip, itemLinkOrName )
--IV_Log( "IV_AppendTooltipData( " ..tooltip:GetName().. ", " .. itemLinkOrName .. " )" );
if ( IVConfig_ToolTips:IsChecked() == false ) then
return;
end
-- Get text we want to insert (via itemLink or exact Name)
local text = IV_GetListOfItems3( itemLinkOrName );
--IV_Log( "text:" .. text );
if ( text and text ~= "" ) then
-- Figure out the position to put the separator and set it
local scale = GetUIScale();
local Separator4 = getglobal( tooltip:GetName() .. "Separator4" );
Separator4:ClearAllAnchors();
Separator4:SetAnchor("TOP", "TOP", tooltip, 0, (tooltip:GetBottom()/scale)-(tooltip:GetTop()/scale)-(3.25/scale) );
tooltip:AddLine("\n");
-- Insert the text
--IV_Log( "Appending tooltipText: " .. text );
tooltip:AddLine( text );
-- Set width of the separator after we've added text (which could change the size of the tooltip
Separator4:SetWidth(tooltip:GetWidth()-20);
Separator4:Show();
end
endit will be much easyer then searching in item preview.
i tryed but cant get it to work