Originally Posted by Luzzifus
Code:
mytable = {
["scale"] = 1,
}
function addon:FigureScale()
result = do some stuff to get the scale
mytable.scale = result
end
or
Code:
function addon:FigureScale()
result = do some stuff to get the scale
return result
end
mytable = {
["scale"] = addon:FigureScale(),
}
Note that you have to set the values to mytable.scale again if your scale changes. Moreover this, mytable.scale is short for mytable["scale"]. Both work.
|
Hmm im going to have to play with this... i think the second method will work as long as the original code comes back a long and changes the scale = function in the table to an actual number later and does not permanently store the function.
The reason this is tricky is because what im doing is, i have made a default layout for Macaroon that fits GrimUI. What goes on is GrimUI will overwrite the Macaroon default setup table the first time they are loaded together. Then its designed so that anytime after the first time Macaroon controls all its own settings. The reason i need the added scale and possibly some other functions is to adjust the default overwrite based on a few things like the players resolution, i may get daring and attempt to make it load different layouts according to class but thats a ways down the line. i think the second method you listed would do the trick assuming Macaroons comes a long and overwrites that function in the table after the first load. Im to tired for that tonight though
will check it out in the morning. Thanks!!