Thread: 3.1 Update
View Single Post
08/16/17, 05:16 PM   #42
Shinni
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 167
You want to call ZO_ColorDef.FromInterfaceColor instead of ZO_ColorDef:FromInterfaceColor as this is the definition:
Code:
function ZO_ColorDef.FromInterfaceColor(colorType, fieldValue)
    return ZO_ColorDef:New(GetInterfaceColor(colorType, fieldValue))
end
edit: too slow...

Originally Posted by Enodoc View Post
Anyone able to assist with the cause of a couple of UI Errors?

Code:
Checking type on argument interfaceColorType failed in GetInterfaceColor_lua
 stack traceback:
 [C]: in function 'GetInterfaceColor'
 EsoUI/Libraries/Utility/ZO_ColorDef.lua:46: in function 'ZO_ColorDef.FromInterfaceColor'
 user:/AddOns/CyrodiilAlert/CyrodiilAlert.lua:134: in function 'CA.Initialise'
This is line 134:
Lua Code:
  1. CA.colGrn = ZO_ColorDef:FromInterfaceColor(INTERFACE_COLOR_TYPE_KEEP_TOOLTIP,KEEP_TOOLTIP_COLOR_ACCESSIBLE)

Code:
user:/AddOns/CyrodiilAlert/CyrodiilAlert.lua:210: attempt to index a nil value
 stack traceback:
 user:/AddOns/CyrodiilAlert/CyrodiilAlert.lua:210: in function 'CA.InitKeeps'
 EsoUI/Libraries/Globals/globalapi.lua:195: in function '(anonymous)'
This is line 210:
Lua Code:
  1. local initText = zo_strformat(CA.colOng:Colorize(GetString(SI_CYRODIIL_ALERT_INIT_TEXT)))

I haven't changed these lines for months and as far as I can remember it was all working fine on PTS. Based on the ESOUI Wiki, line 134 should be fine, as ZO_ColorDef:FromInterfaceColor still exists, as do the constants INTERFACE_COLOR_TYPE_KEEP_TOOLTIP and KEEP_TOOLTIP_COLOR_ACCESSIBLE, and I don't know what is nil in 210 as CA.colOng is defined in line 138 as
Lua Code:
  1. CA.colOng = ZO_ColorDef:New(0.84,0.4,0.05,1)
and the string SI_CYRODIIL_ALERT_INIT_TEXT is defined in my lang file:
Lua Code:
  1. ZO_CreateStringId("SI_CYRODIIL_ALERT_INIT_TEXT", "Cyrodiil Alert Initialized")

Any insight would be greatly appreciated!

Thanks
  Reply With Quote