confused yet? i am okay so heres the deal... in one file it creates the variable based on what resolution is set. it only does this once per first use of the UI, now then another file uses that variable to chose layouts. well for some reason the other file cant pick out the variables. also the addon = {} is also in another file... is that maybe the problem? do i need to make the variables global somehow? the file that is supposed to find the variables for the layouts lil chunk to do so looks like this,
lua Code:
local GPartyMainEvents = CreateFrame("Frame", nil, UIParent)
by the looks of it GrimUIData should indeed be global (simply don't put local in front of it when you first make it hah. Or move it to a table that you already made global). Also make sure that you the resolution is already checked before the variables event!
a local variable is only good for the functoin that its in. So think of each file a as a function.
say random.lua
Code:
local myvar="hi"
function dostuff()
print(myvar) -- it will output hi
local myothervar="hi"
print(myothervar)-- it will also output hi
end
print(myvar) -- it will print hi
print(myothervar) -- this will be nil.
now lets say you have another lua file
other.lua
Code:
print(myvar) -- this will be nil
the reason its nil is because myvar is only real for random.lua