Regarding tagstrings,
I assume that it's not possible to return the contents of a function as a string?
idea i have is to edit tags and the functions that drive them, but in order to do this it seems I would need to provide them as strings and somehow execute them with loadstring.
ideas?
Code:
oUF.Tag["[name]"] = function(u)
local func = "UnitName(u)"
return u~=nil and loadstring(func) or func
end
I assume this would allow me to continue using the tagstring normally. But it would also allow me access to the function generating the output value, since i have such an approach for an ingame editor to obtain the internals for this tag :
Code:
function config:GetTagOptions(tag)
local funcString = oUF.Tag[tag] or nil
return (funcString~=nil and tostring(funcString())) or 'error'
end
function config:SetTagOptions(tag,funcData)
oUF.Tags[tag] = function(u)
local func = funcData.func
return loadstring(func)
end
end
Here we suppose some kind of ingame editor is told to change the way the tagstring '[name]' behaves so that it makes names lowercase :
Code:
oUF.SetTagOptions('[name]',{func = 'UnitName(u):lower()'})
any ideas or thoughts to make this idea better/workable/more efficient or just maybe any kind of thoughts you have?