Improve undeclared variables tip in the variable editor #6412
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
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 itGold
, the tip will appear telling you that the variableTotalGold
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.The text was updated successfully, but these errors were encountered: