View Single Post
12-13-20, 12:49 PM   #3
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,871
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.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 12-13-20 at 12:54 PM.
  Reply With Quote