View Single Post
03/14/24, 11:31 AM   #3
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 5,000
Not sure why but if I dowload your currently uploaded addon file Windows Defender pops in and says your file is a virus.
Maybe a false positive but are you sure you had uploaded the actual addon and nothing else?


And yes, please, as Dolgubon already said:
Always put a local in front of your function names! Or if you define a table local addon, add the functions to that table

function addon.OnCombatStateChanged(param)
function addon.Initialize(param)
function addon.UpdateGroupFrameVisibility(param)


and call them the same addon.OnCombatStateChanged(...) or addon.Initialize, or addon.UpdateGroupFrameVisibility
-> Keep in mind that local functions and code cannot be accessed from XML files of your addon, so see below how to fix this.

Else you might overwrite other addons/ZOs lua code, or some other addon might do that at your addon.

Everything not explicitly defined local is global and must use a very unique name, which in your case could be
function ToggleGroupFrame_OnCombatStateChanged e.g. but actually that's not needed. Keep it local.
Or create 1 global table ToggleGroupFrame = {} and add all functions and variables to that, so you can call it from XML code.
Else it may overwrite, or get overwritten!

Last edited by Baertram : 03/14/24 at 11:36 AM.
  Reply With Quote