Originally Posted by Slakah
I think the second method is moderately faster.
|
Yes, the second method is faster, though it should be pointed out that you should use the standard name _G, not the lowercase g you used, just to follow convention. Similarly, you should use the Blizzard-supplied _G available. To localize it, just do "local _G = _G"
Originally Posted by Slakah
Then to say hide the frame do.
|
This is illegal. You meant
You also run into the problem of "what if they have more than 7 chat tabs?" Your best way of doing it would be:
Code:
local _G = _G
local x = 0;
repeat
x = x + 1;
local this = _G["ChatFrame"..x];
if this then this:Hide() end;
until not this