CraterCrash/godot-orchestrator

Cannot detect if a class-specific enums is a bitfield

Closed this issue · 0 comments

Description

In the ClassDB and the plug-in's ExtensionDB, there is no logical way to detect a class-specific enum and to check if that enum is a bitfield. This works against being able to render these as an option in the new variable support subsystem.

Examples include:

  • Control.SizeFlags
  • FileAccess.UnixPermissionFlags
  • Node.ProcessThreadMessages
  • ResourceSaver.SaverFlags
  • and more

Implementation ideas

These enumerations are available in the ClassDB; the issue is there isn't a toggle that indicates if the enum information is for a bitfield or if it should be treated as a regular enum. We get this information if we need to render this as a property for a function call; however this information isn't available when we need to look at enums outside that context.

Therefore, we only need to create a small data structure in the ExtensionDB that holds a list of class-specific enum bitfield names, and we can use this for rendering purposes, i.e. HashMap<StringName, List<StringName>> _class_bitfields or similar, sourcing this data from the extension_api.json file from godot-cpp.