View Single Post
12-13-20, 02:28 PM   #4
Krainz
A Wyrmkin Dreamwalker
Join Date: Oct 2016
Posts: 57
Originally Posted by Fizzlemizz View Post
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:
  1. local ImmersionFrame = _G.ImmersionFrame
  2. --  is the same as:
  3. local ImmersionFrame = ImmersionFrame
  4. -- is the same as:
  5. local ImmersionFrame = _G["ImmersionFrame")
  6. -- is the same as (in ye olde addon speak):
  7. 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?
  Reply With Quote