View Single Post
06/30/14, 02:58 AM   #40
Flagrick
 
Flagrick's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 24
Originally Posted by Garkin View Post
Itemlinks are now different. This is how itemlink looks like on PTS:
Code:
|H0:item:54513:3:9:45870:3:9:0:0:0:0:0:0:0:0:0:5:0:0:0:0|h|h
|H0:item:793:1:5:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0|h|h
|H0:item:45024:19:12:26848:19:12:0:0:0:0:0:0:0:0:0:9:0:0:124:0|h|h
New format is:
Lua Code:
  1. "|H" .. linkStyle .. ":" .. linkType .. ":" .. data .. "|h" .. text .. "|h"
Variable "text" is usualy empty string, at least in links generated using the GetItemLink(bagIndex, slotIndex) and links which you get from events (tested with EVENT_LOOT_RECEIVED and EVENT_INVENTORY_SINGLE_SLOT_UPDATE).

New CreateLink and ParseLink functions:
Lua Code:
  1. function ZO_LinkHandler_CreateLink(text, color, linkType, ...) --where ... is the data to encode
  2.     if linkType then
  3.         return ("|H%d:%s|h[%s]|h"):format(LINK_STYLE_BRACKETS, zo_strjoin(':', linkType, ...), text)
  4.     end
  5. end
  6.      
  7. function ZO_LinkHandler_ParseLink(link)
  8.     if type(link) == "string" then
  9.         local linkStyle, data, text = link:match("|H(.-):(.-)|h(.-)|h")
  10.         return text, linkStyle, zo_strsplit(':', data)
  11.     end
  12. end
In LootDrop, i was using itemlink's texts from EVENT_LOOT_RECEIVED to obtain QuestTool's icons by associations. Now, i 've got no text in itemlinks.

Someone know how to obtain plein text from this itemlinks ? is there an API function fro that ?
  Reply With Quote