View Single Post
01/10/22, 03:00 AM   #4
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 5,013
The : notation should only be used if you define FooAddon as object via ZO_Object. It's a kind of Object Oriented approach where ZO_WhatEver is the class defining the objects attributes and functions and via ZO_WhatEver:New(...) you define the object.
e.G. SMITHING = ZO_Smithing:New() for the crafting tables.

If you do not use OO and you only got a table for FooAddon, like FooAddon = {}, you should not use : but simply . notation.

Only if you use ZO_Object and ZO_SubClass properly to define a reusable class for your addon, and then create an object for your addon using your addon class, the : notation would be correct and the self pointer would work as intended.
You can have a look at the addon Circonians MyStatus for an example how the class & object addon could be created. But this is complicated and not needed for most simple addons! Just use a normal table and . notation for the start.

That tutorial you follow might need an update to that.

Last edited by Baertram : 01/10/22 at 03:07 AM.
  Reply With Quote