Originally Posted by Fizzlemizz
As an aside, the _G is not needed in this case because the frame name is added to the global table as a reference when the frame is created (all frames with names are added to the global table by default)
Lua Code:
local ImmersionFrame = _G.ImmersionFrame -- is the same as: local ImmersionFrame = ImmersionFrame -- is the same as: local ImmersionFrame = _G["ImmersionFrame") -- is the same as (in ye olde addon speak): local ImmersionFrame = getglobal("ImmersionFrame")
Code:
if ImmersionFrame then
if the user doesn't have the Immersion addon, the frame won't exist so what comes after the "if" can be ignored.
|
Oh, thanks for that explanation! It will make it much easier for me to understand what's going on
--
Is it possible to make something happen whenever a local function from another addon happens?
Like, when another addon (such as GW2 UI) makes the local funcion LoadMinimap() happen, is it possible to make my own addon do something?