Fixed VARIANT_ENUM/BITFIELD_CAST
to show the correct names
#956
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR changes how
Enums
andBitfields
are registered, and also corrects the names of registered enums. Breaks compatibility.Previously
VARIANT_ENUM_CAST
could be written in 3 ways:The first way was used throughout the generated API. At the same time,
VARIANT_BITFIELD_CAST
could only be written like this:VARIANT_BITFIELD_CAST(Example, Example::Flags);
This would not be a problem if such a way of writing would not lead to an incorrect display of enums in the editor.
I changed it to be the same as in Godot itself. Now
VARIANT_ENUM_CAST
andVARIANT_BITFIELD_CAST
can be written like this:Like in Godot, the
enum_qualified_name_to_class_info_name
function is now used to convertExample::Constants
->Example.Constants
.Added tests.
Actually, if it's very important to keep
VARIANT_ENUM_CAST(m_class, m_enum)
andVARIANT_BITFIELD_CAST(m_class, m_enum)
, then I can only leave fixes forVARIANT_BITFIELD_CAST
, but I prefer the current version.