GodotShape refactor; open Element for enums#1513
Merged
Conversation
7cfee93 to
affd5e1
Compare
|
API docs are being generated and will be shortly available at: https://godot-rust.github.io/docs/gdext/pr-1513 |
affd5e1 to
e4c4706
Compare
e4c4706 to
6134e27
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Major refactoring of the
#[var]and#[export]inner workings, in particular regarding handling of property hints, hint strings and usage flags.Before, property customization were widely scattered across the whole codebase, with quite some redundancy and non-intuitive data flows. For example, typed and untyped arrays need to be registered completely different, then there are subtle differences regarding
#[var]and#[export]contexts, plus other nuances likeVariantType::NILbeing used as bothVariantandvoid.This PR brings an end to this mess with a central enum, being returned from
GodotConvert::godot_shape():Removes the following APIs:
Var::var_hint()Export::export_hint()GodotType::property_info()GodotType::property_hint_info()PropertyHintInfomethods:var_array_element<T>,export_array_element<T>,var_dictionary_element<K, V>,export_dictionary_element<K, V>,export_packed_array_element<T>,export_gd<T>,export_dyn_gd<T, D>, ...Furthermore, this opens up the
Elementtrait to allow enums to be stored in arrays and dictionaries. Adds extensive tests for enums, bitfields, and nested ones in array/dictionary.Closes #353.
Paves the way for a future #890.
Diff is +700, however this also adds a new feature (enum support). Plus, 260 of it are new tests, and 210 are extra docs.