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

Improve undeclared variables tip in the variable editor #6412

Open
AlexandreSi opened this issue Mar 1, 2024 · 1 comment
Open

Improve undeclared variables tip in the variable editor #6412

AlexandreSi opened this issue Mar 1, 2024 · 1 comment
Labels
👌good first issue Good issue if you want to start contributing to GDevelop 😤Non optimal UI A bug/issue where the UI is usable but not optimal

Comments

@AlexandreSi
Copy link
Collaborator

Description

When editing Global/Scene/Object variables, there's a tip explaining that some variables are used in the event sheet but are not declared. While this is useful to detect misuses or clean a project's variables use, it doesn't work perfectly well because it doesn't take into account the refactoring: if you have a variable TotalGold that is used in the events sheet and decide to rename it Gold, the tip will appear telling you that the variable TotalGold is not declared.

Also, the tips appear in the instance variables but I'm not sure it's useful there. Or it should say that the variable XXX is not declared and that it should be changed at the object level, not the instance level.

Solution suggested

The tip should take into account that the refactoring will rename the variables in the events sheet and then should display nothing.

Technically speaking, I think that on each renaming operation, the changeset should be computed and use the oldToNewVariableNames data structure to know if some variables are truly undeclared or not.
The changeset is currently a struct in C++ and might need to be converted into a class in order to be used by Javascript.

@AlexandreSi AlexandreSi added 😤Non optimal UI A bug/issue where the UI is usable but not optimal 👌good first issue Good issue if you want to start contributing to GDevelop labels Mar 1, 2024
@fizzingpop
Copy link

I dislike how undeclared variables were removed from showing up in the event sheet. We shouldn't be required to declare them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👌good first issue Good issue if you want to start contributing to GDevelop 😤Non optimal UI A bug/issue where the UI is usable but not optimal
Projects
None yet
Development

No branches or pull requests

2 participants