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

When inserting function in AnimationPlayer using call method track functions are listed in different order than in a source script #39576

Open
Feniks-Gaming opened this issue Jun 15, 2020 · 4 comments

Comments

@Feniks-Gaming
Copy link
Contributor

Godot version:

3.2.1

OS/device including version:

Win 10

Issue description:

When you use animation player and add new track call method track and then insert key inside this track. Methods listed from a script are placed in seemingly random order rather than in order they appear in the scrip

Steps to reproduce:

Described above

Minimal reproduction project:

applicable in any project.

@Sl3dge78
Copy link
Contributor

Sl3dge78 commented Jun 17, 2020

I did a bit of digging around for this and the list order behaviour is as follows:

  • Methods created before the previous reopening of the editor are in the script order
  • All new methods are in the order they were created in, after the old methods

I understand that this would cause inconsistencies.
I could easily sort alphabetically the method list, so that it stays constant through reopenings of the editor. Same could be done for the base classes. Any objections?

Sl3dge78 added a commit to Sl3dge78/godot that referenced this issue Jun 17, 2020
…lector when inserting function in AnimationPlayer

Method name order is now sorted alphabetically through a custom sorter.
@akien-mga akien-mga added this to the 4.0 milestone Jun 18, 2020
@Feniks-Gaming
Copy link
Contributor Author

If we can't mirror what source file order is alphabetical ordering is better than random order we have now. However ideally it would make more sense to try to mirror what source file order is people put functions in logical places for them.

@Sl3dge78
Copy link
Contributor

The method list is updated at compile time and only the changes get added with every compile (which explains the behaviour)
Using the source file's order would require compiling the whole script with every change or add some complex sorting through the parser which I wouldn't be confident enough doing.
Alphabetical makes more sense to me and my major use case is to use the search box so it's doesn't matter much imo.

@akien-mga
Copy link
Member

Confirmed reproducible in the current master branch.

@akien-mga akien-mga modified the milestones: 4.0, 4.x Nov 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants