This is an old revision of the document!
⇐ Index
_UICallback is invoked whenever a control panel UI element is changed. The control panel UI elements for a unit are part of its UI definitions in the CMod settings. Whenever a UI element is changed by the player, any script on the unit with :_UICallback (note the underscore) will have the function called.
There is an implicit variable named “_DATA” that is available for use when the callback is made. For this callback, _DATA is an int that points to the UI slot that was changed. 0 refers to the first slot, 1 the 2nd, etc.