I have been slowly learning as I go but for some reason I am having a roadblock on this particular one and can't even get started. I am having issues with all items that people post in chat but the main thing I am trying to get is the items' quality from the chat link. I am at a loss on how to do this. If someone could give me a gentle nudge in the correct direction I would very much appreciate it.
I am learning a little every time I work on this. So far the worst part has been finding and figuring out the functions, globals, etc.. It took me awhile to find things like ZO_QuickSlotListContents". With the help of some other addons and what I could find in the esoui forums, esoui wiki and http://esodata.uesp.net/current/globals.txt I have found and learned a lot so far but have a lot to go.
I have a good start on what I am working on which to begin with is adding to the tooltip the items quality as text.
I have all these in one section of code: Store, Store Buyback, Craft Bag, Player Inventory, Quickslot List, Repair Window, Trading House Search, Trading House List
Warning: Spoiler
Code:
-- Get Parent Name
local parentName = parent:GetName()
-- If Item is in Store
if parentName == "ZO_StoreWindowListContents" then
return GetStoreItemLink(item.dataEntry.data.slotIndex, LINK_STYLE_DEFAULT)
end
-- If Item is in Player Craft Bag
if parentName == "ZO_CraftBagListContents" then
return GetItemLink(item.dataEntry.data.bagId, item.dataEntry.data.slotIndex, LINK_STYLE_DEFAULT)
end
-- If Item is in Player Inventory
if parentName == "ZO_PlayerInventoryListContents" then
return GetItemLink(item.dataEntry.data.bagId, item.dataEntry.data.slotIndex, LINK_STYLE_DEFAULT)
end
-- If Item is in Quickslot List
if parentName == "ZO_QuickSlotListContents" then
return GetItemLink(item.dataEntry.data.bagId, item.dataEntry.data.slotIndex, LINK_STYLE_DEFAULT)
end
-- If Item is in Repair Window
if parentName == "ZO_RepairWindowListContents" then
return GetItemLink(item.dataEntry.data.bagId, item.dataEntry.data.slotIndex, LINK_STYLE_DEFAULT)
end
-- If Item is in Guild Store
if parentName == "ZO_TradingHouseItemPaneSearchResultsContents" then
-- Check to see if Item is still Active
if item.dataEntry.data.timeRemaining > 0 then
return GetTradingHouseSearchResultItemLink(item.dataEntry.data.slotIndex)
else
return nil
end
end
-- If Item is in Guild Store Listed Items
if parentName == "ZO_TradingHousePostedItemsListContents" then
return GetTradingHouseListingItemLink(item.dataEntry.data.slotIndex)
end
-- If Item is in Store Buy Back List
if parentName == "ZO_BuyBackListContents" then
return GetBuybackItemLink(item.dataEntry.data.slotIndex)
end
local function AddToolTipLineBags(ItemToolTip, bagId, slotIndex)
local slotData = SHARED_INVENTORY:GenerateSingleSlotData(bagId, slotIndex)
local quality = slotData.quality
ItemToolTip:AddLine(EIQAT.qualityText[quality], "ZoFontGame", 1, 1, 1, LEFT, MODIFY_TEXT_TYPE_NONE, LEFT, false)
end
-- Hook SetWornItem
local hSetWornItem = ItemTooltip.SetWornItem
ItemTooltip.SetWornItem = function(control, slotIndex, ...)
hSetWornItem(control, slotIndex, ...)
AddToolTipLineBags(control, BAG_WORN, slotIndex)
end
The next two items I am working on are Quest rewards and chat items. For the quest rewards I am looking to add to the tooltip of just the reward when handing in a quest. I did find GetQuestRewardItemLink and ShowQuestRewards which I think is going towards the correct direction. I am finding it very difficult to figure out the correct way to add to the tooltip on any item I click in chat.
Any ideas or information would be greatly appreciated. Thank you!
Last edited by scootter : 12/04/16 at 03:39 AM.
Reason: Still figuring out formatting
Any ideas or information would be greatly appreciated. Thank you!
The tooltips have methods, which are called than settings up the tooltip: e.g. SetLink or SetBagItem, etc.
You can look at Votan's Rune Info how to hook those functions to add info to the toolltip.
But I think the QuestReward Info functions do just work while in the quest giver chatter dialog.