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

Variables with the same name are lost/overwritten. #2408

Open
Ketei opened this issue Sep 18, 2024 · 0 comments
Open

Variables with the same name are lost/overwritten. #2408

Ketei opened this issue Sep 18, 2024 · 0 comments

Comments

@Ketei
Copy link

Ketei commented Sep 18, 2024

The problem

When naming variables/folders the same as previously declared variables, the previous ones will get overwritten by the last ones when saving.

To Reproduce
Create similarly named variables/folders

Expected behavior
A repeated varaible should be suffixed with something to provide it with an unique name.

Screenshots
data_loss

System (please complete the following information):

  • OS: Windows
  • Godot Version: v4.3.stable.official
  • Dialogic Version: 2.0 Alpha 15

Solutions

Workaround
There is no workaround given how the current system works. (Other than double-checking you're not repeating names)

Possible fixes
Let me preface that I don't fully understand the system, so take my solution with a grain of salt.

I understand that this will occour given how variables are saved. But I belive this data loss could be prevented with an approach similar to how Godot deals with same-named siblings by appending a number at the end of the repeated node:

"Node2D"
"Node2D2"
"Node2D3"
etc...

By listening for the tree signal item_edited and using the method get_edited() to get the renamed variable entry one could check for the "siblings" of that variable to make sure there is no variable/folder with the same name, and if there is, append a number at the end to prevent the data loss.

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

No branches or pull requests

1 participant