Lua:registerFormAddNotification

From Cheat Engine
Jump to navigation Jump to search

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]