Thread Tools Display Modes
08/04/14, 11:01 AM   #1
Khaibit
 
Khaibit's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2014
Posts: 26
Patch 1.3.3 Item Link handling

Well, my addon was working fine on the PTS, but it appears they've yet again changed something between the PTS build and the live build. Previously, this worked:

Code:
-- assume we have a Button called someButton, and an item link called itemLink
someButton:SetText(itemLink)
However, now, the item names are mostly lowercased (except for a few items, with no commonality that I can determine) and retain the ^n ^p and whatnot at the end (again, most of the time, the ones that show proper title casing do not display the control characters either). The chat box, on the other hand, parses them correctly still; this still works the same as it did before:

Code:
ZO_ChatWindowTextEntryEditBox:SetText(itemLink)
Ugh. So...what is the 'proper' way to parse the links now? This seems to strip out the control characters, but leaves the name all lowercase; is there a good way to title-case the result?

Code:
local testName = zo_strformat("<<1>>", itemLink)
someButton:SetText(testName)

Edit for clarity and so people don't have to read the whole thread if they don't want to: The following adjustment to the first code snippet fixes this:

Code:
-- assume we have a Button called someButton, and an item link called itemLink
someButton:SetText(zo_strformat("<<t:1>>", itemLink))

Last edited by Khaibit : 08/04/14 at 12:44 PM.
  Reply With Quote
08/04/14, 11:09 AM   #2
merlight
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 671
You seem to be using old links from before 1.2.3, otherwise you wouldn't have had any text to strip control characters off. You should either convert or get rid of those.

Back when item links contained item name, I used this:
Lua Code:
  1. local function PrettyItemLink(link)                        
  2.     return link and zo_strformat(SI_TOOLTIP_ITEM_NAME, link)
  3. end
  Reply With Quote
08/04/14, 11:12 AM   #3
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
http://www.esoui.com/forums/showpost...84&postcount=4
  Reply With Quote
08/04/14, 11:20 AM   #4
Khaibit
 
Khaibit's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2014
Posts: 26
Interesting, all of these are actually links pulled directly from the Guild Store sales history as of this morning - no old data being used. I will continue poking, however! This code was working 100% yesterday, so I'm not certain it's old links because none existed.

Edit: A very-stripped-down example that produces this behavior (displaying the first 20 because not all items have the control characters appended; enchanting runes for example do not, but finished glyphs do):

Code:
RequestGuildHistoryCategoryNewest(1, GUILD_HISTORY_SALES)
for i=1, 20 do
  local _, _, _, _, _, itemName, _ = GetGuildEventInfo(1, GUILD_HISTORY_SALES, i)
  d(itemName)
end
For now I'm going to use zo_strformat to strip the control characters, but I'd really like items to be properly title-cased again because the mix of some being all lowercase and some being titlecased with little rhyme or reason is rather ugly It also appears they fixed GetDisplayName() on the live build, without it ever being fixed on the PTS, so that's an entirely NEW bag of worms for all addon authors as yet again, all settings will be lost without manually editing SavedVars files. Grr...

Last edited by Khaibit : 08/04/14 at 11:34 AM.
  Reply With Quote
08/04/14, 11:33 AM   #5
Beost
Join Date: Aug 2014
Posts: 1
UI ERROR on 1.3.3

Since 1.3.3 Following UI Error pops up and cannot be dismissed
I loaded the screen shot as an attachment
Attached Thumbnails
Click image for larger version

Name:	Screenshot_UI Error.jpg
Views:	589
Size:	50.4 KB
ID:	389  
  Reply With Quote
08/04/14, 11:37 AM   #6
Khaibit
 
Khaibit's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2014
Posts: 26
Actually...bloody hell. They changed the link format AGAIN - the name is included in the link. Just checked my savedvars after testing, and new items look like:

|H0:item:45211:52:50:26588:52:50:0:0:0:0:0:0:0:0:0:9:0:0:10000:0|hkresh breeches of stamina^p|h

I'm so confused. They added a GetItemLinkName function, but then added the name of the item back into the link? o_O Not that it helps my current situation, but I guess I can return to the old-style link parsing if the name is present in plain-text again.

Edit: Some additional fun - links that do not have the name embedded in them work fine, like they used to. New links pulled from the store since the patch, that contain the name, break things. I wonder if I can just do a gsub and remove the name :P

Last edited by Khaibit : 08/04/14 at 11:41 AM.
  Reply With Quote
08/04/14, 11:37 AM   #7
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
Originally Posted by Beost View Post
Since 1.3.3 Following UI Error pops up and cannot be dismissed
I loaded the screen shot as an attachment
This does not have anything with this discussinon.

Anyway, Wykkyd is working on the fix, check addon comments:
http://www.esoui.com/downloads/info8....html#comments

If you don't want to wait for fix, just open file "mhFramework\Lib\Bazgrim\Toolbar\Bags.lua" and change line 15 from:
Lua Code:
  1. local icon, bagSlots = GetBagInfo(1)
to:
Lua Code:
  1. local bagSlots = GetBagSize(BAG_BACKPACK)
  Reply With Quote
08/04/14, 11:41 AM   #8
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
Originally Posted by Khaibit View Post
Actually...bloody hell. They changed the link format AGAIN - the name is included in the link. Just checked my savedvars after testing, and new items look like:

|H0:item:45211:52:50:26588:52:50:0:0:0:0:0:0:0:0:0:9:0:0:10000:0|hkresh breeches of stamina^p|h

I'm so confused. They added a GetItemLinkName function, but then added the name of the item back into the link? o_O
Hm, I don't have NA client installed, so I can't test it. :/ But good to know, I can remove one more unnecessary function from Dustman code.

So GetItemLinkName(itemLink) does the same as zo_strformat("<<x:1>>", itemLink)?
  Reply With Quote
08/04/14, 11:49 AM   #9
Khaibit
 
Khaibit's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2014
Posts: 26
Originally Posted by Garkin View Post
Hm, I don't have NA client installed, so I can't test it. :/ But good to know, I can remove one more unnecessary function from Dustman code.

So GetItemLinkName(itemLink) does the same as zo_strformat("<<x:1>>", itemLink)?
The former includes the control characters. The latter strips them. They both don't correctly title-case names though. Going to see what happens if I strip out the name via gsub and force them into the pre-Update 3 link format.
  Reply With Quote
08/04/14, 11:56 AM   #10
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
Originally Posted by Khaibit View Post
The former includes the control characters. The latter strips them. They both don't correctly title-case names though. Going to see what happens if I strip out the name via gsub and force them into the pre-Update 3 link format.
This command should not capitalize any characters in name. If you want to make first letter of each word capital, you should use:
zo_strformat("<<t:1>>", text)
or
zo_strformat("<<T:1>>", text)

So if I want to get correctly formated item name from itemLink:
zo_strformat("<<tx:1>>", itemLink)

See more: http://www.esoui.com/forums/showthre...=7321#post7321
  Reply With Quote
08/04/14, 12:01 PM   #11
Khaibit
 
Khaibit's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2014
Posts: 26
Originally Posted by Garkin View Post
This command should not capitalize any characters in name. If you want to make first letter of each word capital, you should use:
zo_strformat("<<t:1>>", text)
or
zo_strformat("<<T:1>>", text)

So if I want to get correctly formated item name from itemLink:
zo_strformat("<<tx:1>>", itemLink)

See more: http://www.esoui.com/forums/showthre...=7321#post7321
Ah, thanks for that - I wasn't totally clear on arguments for zo_strformat. That sounds a whole lot easier and not regressive

Edit: Just to follow up - zo_strformat("<<t:1>>", itemLink) correctly formats both pre-Update 3 and post-Update 3 links correctly as expected. Thanks again Garkin, you rock

Last edited by Khaibit : 08/04/14 at 12:13 PM.
  Reply With Quote
08/04/14, 01:47 PM   #12
Xrystal
caritas omnia vincit
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 369
Sheesh, Glad I didn't assume that my addon changes were finished. Looks like I have to do another adjustment to the link code in my addon.

Originally Posted by Khaibit View Post
Actually...bloody hell. They changed the link format AGAIN - the name is included in the link. Just checked my savedvars after testing, and new items look like:

|H0:item:45211:52:50:26588:52:50:0:0:0:0:0:0:0:0:0:9:0:0:10000:0|hkresh breeches of stamina^p|h

I'm so confused. They added a GetItemLinkName function, but then added the name of the item back into the link? o_O Not that it helps my current situation, but I guess I can return to the old-style link parsing if the name is present in plain-text again.

Edit: Some additional fun - links that do not have the name embedded in them work fine, like they used to. New links pulled from the store since the patch, that contain the name, break things. I wonder if I can just do a gsub and remove the name :P
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » Patch 1.3.3 Item Link handling


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