Thread Tools Display Modes
08/11/14, 03:39 PM   #1
Klingo
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 16
Itemlink issue with [Dietrich] (lockpick)

So far I used the function mentioned here (http://www.esoui.com/forums/showthread.php?t=991) for all itemLinks I had to create, and this always worked perfectly fine.

But then there is this one exception. If the game runs in german [ /script SetCVar("language.2","de") ], the itemLink for lockpicks (de: Dietrich) does not work.
E.g. with this "cursorPickup"-event it can easily be reproduced:
Lua Code:
  1. function pickupTest(type, param1, bagId, slotIndex, param4, param5, param6, itemSoundCategory)
  2.     CHAT_SYSTEM:AddMessage(">>>"..zo_strformat(SI_TOOLTIP_ITEM_NAME, GetItemLink(bagId, slotIndex, LINK_STYLE_BRACKETS)))
  3. end
  4. EVENT_MANAGER:RegisterForEvent("MyPickupTester", EVENT_CURSOR_PICKUP, pickupTest)

The result then looks like this:


With "GetItemName(integer bagId, integer slotIndex)" the output is:
EN: Lockpick
DE: Dietrich^m|Dietriche^p
FR: crochet^m

Apparently, this german masculine/plural combination in the itemName does not really work with SI_TOOLTIP_ITEM_NAME.

Does anyone maybe have an idea how to resolve this? :/
  Reply With Quote
08/11/14, 04:24 PM   #2
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
I think this is a bug on ZOS side, here is workaround:
Lua Code:
  1. local function GetFormatedItemLink(bagId, slotId, linkStyle)
  2.    local link = GetItemLink(bagId, slotId, linkStyle)
  3.    if link == "" then return end
  4.  
  5.    local name = zo_strformat(SI_TOOLTIP_ITEM_NAME, GetItemName(bagId, slotId))
  6.    local data = link:match("|H.-:(.-)|h")
  7.  
  8.    if linkStyle == LINK_STYLE_BRACKETS then
  9.       return ("|H%s:%s|h[%s]|h"):format(LINK_STYLE_BRACKETS, data, name)
  10.    else
  11.       return ("|H%s:%s|h%s|h"):format(LINK_STYLE_DEFAULT, data, name)
  12.    end
  13. end
  14.  
  15. function pickupTest(type, param1, bagId, slotIndex, param4, param5, param6, itemSoundCategory)
  16.    CHAT_SYSTEM:AddMessage(">>>"..GetFormatedItemLink(bagId, slotIndex, LINK_STYLE_BRACKETS))
  17. end
  18. EVENT_MANAGER:RegisterForEvent("MyPickupTester", EVENT_CURSOR_PICKUP, pickupTest)
  Reply With Quote
08/11/14, 05:03 PM   #3
merlight
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 671
Yea, looks like ZO_Bug. "In Chat einfügen" doesn't work either.
  Reply With Quote
08/11/14, 06:53 PM   #4
zgrssd
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 280
For a long time after launch there was a bug that the Character Gender was shown at the end of the ChatName in german chat. i.e. "Leonida Peterson^f"
That was simply a bug in how the names were parsed (they actually always send [name]^[gender] across, but hide the suffix during display). I would just report it. They might be able to fix it eventually.
  Reply With Quote
08/12/14, 01:55 PM   #5
Klingo
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 16
Thumbs up

Originally Posted by Garkin View Post
I think this is a bug on ZOS side, here is workaround:
Works like a charm, thanks a lot!
  Reply With Quote
08/14/14, 06:39 PM   #6
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,912
It's definately a bug from ZOS side. If you try to destroy it the destroy popup will only show a text like "Do you want to ..."
The item's name and the following text is missing.
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » Itemlink issue with [Dietrich] (lockpick)

Thread Tools
Display Modes

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