Godot: Add get_inner_class_list() method to Script class.

Created on 20 Apr 2019  路  3Comments  路  Source: godotengine/godot

3.1

I have spent a few days working on a script to parse other scripts recursively in order to collect all inner classes (for my testing plugin "WAT") but this has become unnecessarily complex and is likely to cause a significant performance hit.

My suggestion is to add a .get_inner_class_list() method on the Script class similar to the .get_property_list() and .get_method_list() on the Object class.

Currently doing this involves quite a bit of instancing and then using inst2dict to collect the sub-paths repeatedly.

Edit: I think this will help other tool makers beyond myself as well.

enhancement core gdscript

Most helpful comment

This has been more or less resolved by the new Script.get_script_constant_map() method in 3.2 so I'm going to close this.

All 3 comments

Yeah, I think this should also help @bitwes to improve his GUT that way as well.

This would be very helpful with GUT. Right now I do a simple parse to find first level inner classes. With this GUT could easily have more levels of inner classes. It also helps with exporting tests. To run tests against compiled code I have to save all of the inner class info and load it. This might allow me to treat compiled/encrypted/plain text code the same.

This has been more or less resolved by the new Script.get_script_constant_map() method in 3.2 so I'm going to close this.

Was this page helpful?
0 / 5 - 0 ratings