Difference between revisions of "Lua:registerFormAddNotification"

From Cheat Engine
Jump to navigation Jump to search
 
Line 4: Line 4:
 
Registers a function to be called whenever a form is added to Cheat Engine's form list.   
 
Registers a function to be called whenever a form is added to Cheat Engine's form list.   
 
This is useful for extensions that add new functionality to certain existing forms.   
 
This is useful for extensions that add new functionality to certain existing forms.   
Returns an object that can be used with [[unregisterFormAddNotification]] to remove the notification.
+
Returns an object that can be used with [[Lua:unregisterFormAddNotification]] to remove the notification.
  
 
===Function Parameters===
 
===Function Parameters===

Latest revision as of 00:11, 11 July 2025

function registerFormAddNotification(Callback) : Object

Registers a function to be called whenever a form is added to Cheat Engine's form list. This is useful for extensions that add new functionality to certain existing forms. Returns an object that can be used with Lua:unregisterFormAddNotification to remove the notification.

Function Parameters[edit]

Parameter Type Description
Callback Function A function that takes one parameter (the form object) and is called when a form is added.

Examples[edit]

-- Print the class name of every form that gets added
local notif = registerFormAddNotification(function(form)
  print("Form added: " .. (form.ClassName or "Unknown"))
end)

-- Later, you can unregister the notification:
unregisterFormAddNotification(notif)

See also[edit]