GarageGames / Torque3D

MIT Licensed Open Source version of Torque 3D from GarageGames
http://torque3d.org
MIT License
3.35k stars 1.2k forks source link

Make EngineAPI Export work properly #2228

Closed lukaspj closed 5 years ago

lukaspj commented 6 years ago

Recreation of #2226 , but branched from CInterfaceUpdate, so a new commit utilizing fixed_tuple is possible. This is necessary to make DefaultArguments work.

Old message:

Currently the ConsoleFunction exportEngineAPIToXML doesn't export properties properly. This is due to a half-implemented Engine type system, where Console Classes define their properties in-between IMPLEMENT_CLASS and END_IMPLEMENT_CLASS.

This system was never put into use, and classes are implemented and ended right away directly in the IMPLEMENT macros, as seen here: https://github.com/GarageGames/Torque3D/blob/development/Engine/source/console/consoleObject.h#L1171-L1173

exportEngineAPIToXML assumes the new system was taken into use, thus it never finds the properties as we still use initPersistFields to define our properties.

This change takes all the properties added in initPersistFields and adds them to the EnginePropertyTable, allowing exportEngineAPIToXML to work as intended. This will help 3rd party applications analyze and provide auto-completion as well as code-generation for the T3D EngineAPI layer. Improving the capabilities of 3rd party scripting tools.

Note: Be aware that the EngineProperty type allows for more meta-information than what I'm filling into them.

The properties can be further marked as:

If there is any way to determine whether a field from initPersistFields is any of these 3, we should probably add that information to improve the quality of the data.

lukaspj commented 6 years ago

This PR awaits #2136

After which, it probably needs a small re-touch before it is ready.

lukaspj commented 6 years ago

Added WIP tag, because I'm gonna do some investigation into the EngineAPI system, before this is merged.

lukaspj commented 6 years ago

Update, now branches from #2245