Open KoBeWi opened 9 months ago
Been looking at this for the past couple days. I believe it has been temporarily resolved by https://github.com/godotengine/godot/pull/87712 since the UIDs for scripts got reverted.
For anyone looking at this in the future - The origin Resource is being updated in the saver with the contents of the newly created script, which includes the newly generated UID. The Script Editor reloads the text from the Resource in memory, not from disk.
The script gets reloaded when Godot comes back into focus from an external application. Pressing reload will refresh the resource to match with the version in disk.
I modified the code in filesystem_dock to duplicate the origin resource and save it to the new path instead of re-using the origin Resource. That did the trick
However, this may not be needed since adding UID to gdscript is still not fully defined
Tested versions
4.3 4b6ad34
System information
Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1060 (NVIDIA; 30.0.15.1403) - Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz (8 Threads)
Issue description
When you duplicate a script and the original script is currently opened in the script editor, its UID will change and will be the same as UID of the new script. The bug is purely visual for some reason. When you open the script in external editor, you'll see that it has the old UID and it's different from the new script. The script in editor fixes itself after you save it or switch tab a couple of times. It does not happen if the script is not currently opened in the editor.
Steps to reproduce
Minimal reproduction project (MRP)
N/A