View Single Post
12-27-17, 08:26 PM   #10
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,894
The SetScript is creating the function "in situ" rather than calling another function. Either way works although the SetScript("script", function) is better if multiple scripts can use the same function.

If you mean the
Code:
if self[event] then return self[event](self, ...)
then in this case, self is JWFrame so,
Code:
if JWFrame["PLAYER_LOGIN"] then return JWFrame["PLAYER_LOGIN"](self, ...)
calls
Code:
function JWFrame:PLAYER_LOGIN()
A frame is a secial type of table so you can add attributes (variables) and methods (functions) to it like you would a standard table.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote