Thread Tools Display Modes
07/21/15, 04:02 PM   #1
Lodur
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 108
how to print a link as item name and no brackets?

Sure this has been covered before, but I haven't figured it out yet.

I want to display an item link as the item name with rarity color, capitalize words, and not ^ stuff.

This works except for the brackets.
Code:
local text = zo_strformat("<<t:1>>", data.link)
Any one know how to get rid of the brackets when printing a link?


Thanks
  Reply With Quote
07/21/15, 04:31 PM   #2
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,579
The brackets are decided by the number in the beginning of the link, unless it is one which uses the text property.

For item links and others that use language dependent rendering you can use
untested code:
Lua Code:
  1. link:gsub("%|H1", "|H0")
and for name links and similar
Lua Code:
  1. link:gsub("[%[%]]", "")
does the trick.
  Reply With Quote
07/21/15, 04:43 PM   #3
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
Just extra information, if your using GetItemLink(..) to get the link you can choose if you want brackets or not with it:
Lua Code:
  1. -- with brackets:
  2. zo_strformat("<<t:1>>", GetItemLink(bagId, slotIndex, LINK_STYLE_BRACKETS))
  3.  
  4. -- without brackets, either its the same thing:
  5. zo_strformat("<<t:1>>", GetItemLink(bagId, slotIndex))
  6. zo_strformat("<<t:1>>", GetItemLink(bagId, slotIndex, LINK_STYLE_DEFAULT))
  Reply With Quote
07/21/15, 06:19 PM   #4
Lodur
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 108
Thanks. Got it working with LINK_STYLE_BRACKETS instead.
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » how to print a link as item name and no brackets?


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off