I have two questions if anyone can help me out. Thanks!
First Question:
Can anyone tell me why one of these works and the other does not?
TargetHPBar[1] turns out nil for ZO_TargetUnitFramereticleover, but it works for ZO_PlayerAttributeHealth
Lua Code:
HPBar = {ZO_PlayerAttributeHealth, true, false, DEFAULT_ALPHA, 69, 0, 300, DEFAULT_SCALE},
TargetHPBar = {ZO_TargetUnitFramereticleover, true, false, DEFAULT_ALPHA, 0, 150, 300, DEFAULT_SCALE},
I'm trying to do this:
Lua Code:
ConfigurableUI.BarSetup(TargetHPBar)
function ConfigurableUI.BarSetup(_BarTable)
_Control, _Unlocked, _Hidden, _Alpha, _Posx, _Posy, _Width, _Scale = unpack(_BarTable)
_Control:SetMovable(_Unlocked)
...
end
Second Question:
Looking at other addons I can't figure out what the difference is between some of the assignments I see like:
Lua Code:
-- I see some like this...I get this one.
DAMAGE_COLOR = { 1, 1, 1, 1 }
-- But I also see some with square brackets around them
[DAMAGE_TYPE_NONE] = { 1, 1, 1, 1 }
-- Some also have single quotes in them
['ZO_ActionBar1'] = {1, myaddon.stuff}
-- Some also have double quotes in them
["enabled"] = true,
Whats the difference in those ? Why do some have square brackets, some have ['...'] and some have ["..."]?
Thanks