API:UnregisterEventHandler
From RoR Wiki
UI Lua API · Interface functions
Version: WAR 1.4.8
Removes an event handler that was added with RegisterEventHandler.
UnregisterEventHandler(eventId, functionName)
Arguments
- eventId
number– Id of the event the handler was registered for.- functionName
string– The same function name that was passed to RegisterEventHandler. The comparison is exact and case-sensitive.
Returns
Nothing.
Details
- Only the handler for this event is removed. If the same function is registered for other events, those registrations stay.
- It is safe to call from inside a handler while the event is being delivered.
- The function needs at least two arguments and only reads the last two.
Errors
These are written to the UI log; the call returns normally.
Error in function call 'UnregisterEventHandler': Invalid Event Id(event id 0)Error in function call 'UnregisterEventHandler': Invalid Script Name(empty name)Error in function call 'UnregisterEventHandler': Script %s is not registered for event #%d
Example
From easystem_actionbarclustermanager/source/actionbarclustermanager.lua:
UnregisterEventHandler (SystemData.Events.PLAYER_CAREER_LINE_UPDATED, "ActionBarClusterManager.SpawnCluster") UnregisterEventHandler (SystemData.Events.LOADING_END, "ActionBarClusterManager.SpawnCluster")
