Make addon PTS compatible |
Feature #: |
459 |
File: |
Lootdrop, Continued (All in One) |
Date: |
06/19/14 07:14 AM |
By: |
Garkin |
Status: |
Feature Implemented
|
When I try to use LootDrop on PTS I will get this errors:
Code:
2014-06-19T14:32:35.084+01:00 |cff0000Lua Error: user:/AddOns/LootDrop/LootDroppable.lua:156: function expected instead of nil
stack traceback:
user:/AddOns/LootDrop/LootDroppable.lua:156: in function 'LootDroppable:SetIcon'
user:/AddOns/LootDrop/LootDrop.lua:688: in function 'LootDrop:LootPrint'
user:/AddOns/LootDrop/LootDrop.lua:670: in function 'LootDrop:OnItemLooted'
user:/AddOns/LootDrop/LootDrop.lua:300: in function '(anonymous)'|r
2014-06-19T14:35:12.972+01:00 |cff0000Lua Error: user:/AddOns/LootDrop/LootDroppable.lua:156: function expected instead of nil
stack traceback:
user:/AddOns/LootDrop/LootDroppable.lua:156: in function 'LootDroppable:SetIcon'
user:/AddOns/LootDrop/LootDrop.lua:789: in function 'LootDrop:OnXPUpdated'
user:/AddOns/LootDrop/LootDrop.lua:278: in function '(anonymous)'|r
2014-06-19T14:35:19.143+01:00 |cff0000Lua Error: user:/AddOns/LootDrop/LootDroppable.lua:156: function expected instead of nil
stack traceback:
user:/AddOns/LootDrop/LootDroppable.lua:156: in function 'LootDroppable:SetIcon'
user:/AddOns/LootDrop/LootDrop.lua:728: in function 'LootDrop:OnMoneyUpdated'
user:/AddOns/LootDrop/LootDrop.lua:264: in function '(anonymous)'|r
2014-06-19T14:35:19.160+01:00 |cff0000Lua Error: EsoUI/Libraries/Utility/ZO_ColorDef.lua:86: operator * is not supported for nil * number
stack traceback:
EsoUI/Libraries/Utility/ZO_ColorDef.lua:86: in function 'ZO_ColorDef:ToHex'
EsoUI/Libraries/Utility/ZO_ColorDef.lua:90: in function 'ZO_ColorDef:Colorize'
user:/AddOns/LootDrop/LootDrop.lua:684: in function 'LootDrop:LootPrint'
user:/AddOns/LootDrop/LootDrop.lua:670: in function 'LootDrop:OnItemLooted'
user:/AddOns/LootDrop/LootDrop.lua:300: in function '(anonymous)'|r
I believe it is because of changes in the links on PTS. On PTS links does not contain color information, it has linkStyle instead of colors. Changes in ZO_LinkHandler.lua:
Code on live servers:
Lua Code:
function ZO_LinkHandler_CreateLink(text, color, type, ...) --where ... is the data to encode if type then return ("|H%s:%s|h[%s]|h"):format(color and color:ToHex() or "ignore", zo_strjoin(':', type, ...), text) end end function ZO_LinkHandler_ParseLink(link) if type(link) == "string" then local color, data, text = link:match("|H(.-):(.-)|h(.-)|h") return text, color, zo_strsplit(':', data) end end
Code on PTS:
Lua Code:
function ZO_LinkHandler_CreateLink(text, color, linkType, ...) --where ... is the data to encode if linkType then return ("|H%d:%s|h[%s]|h"):format(LINK_STYLE_BRACKETS, zo_strjoin(':', linkType, ...), text) end end function ZO_LinkHandler_ParseLink(link) if type(link) == "string" then local linkStyle, data, text = link:match("|H(.-):(.-)|h(.-)|h") return text, linkStyle, zo_strsplit(':', data) end end
|
|