Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sort variables in VisualScriptEditor #58510

Merged
merged 1 commit into from
Feb 25, 2022

Conversation

raulsntos
Copy link
Member

Sorts the script variables in alphabetical order to display them in VisualScriptEditor.

The variables are sorted in 3.x because get_variable_list returned the list already sorted but this was changed in #39649.
This PR sorts the variables after retrieving them in VisualScriptEditor instead of directly in get_variable_list so this works like the functions (also retrieved unsorted with get_function_list and then sorted by VisualScriptEditor).

Closes #58509

Sorts the script variables in alphabetical order to display them
in VisualScriptEditor.
Copy link
Member

@fire fire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@fire
Copy link
Member

fire commented Feb 24, 2022

Question, do we want to use Unicode sorting? @bruvzg Any ideas?

@bruvzg
Copy link
Member

bruvzg commented Feb 24, 2022

Question, do we want to use Unicode sorting? @bruvzg Any ideas?

There's no easy solution. We can use ICU collation API. But it will depend on a specific text server implementation, and probably will need more data. I need to re-check it, but I'm pretty sure I have stripped it from the data file currently used.

@fire
Copy link
Member

fire commented Feb 24, 2022

Sounds difficult, but Unicode sorting doesn't block this.

@akien-mga akien-mga merged commit be52c5b into godotengine:master Feb 25, 2022
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Godot 4: variables in the Visual Script's members window don't sort by their name
5 participants