Use resource UID instead of resource path for scene reference
poohcom1 opened this issue · comments
Hi! I've only been using this addon for a few days, but I'm loving it so far.
One thing I would like to see implemented (or as an optional setting) would be storing scene references via resource UIDs rather than resource paths, so that renaming scenes wouldn't break references.
Usually this is pretty simple to refactor as you can replace resource paths with uid paths without issue, but I noticed that the path stored in MapData.txt
has res://
trimmed off, so I'm not sure if there are other logic being done to the paths that could make this a bit more difficult to refactor.
Either way, let me know if this is something that would fit with the project, if so I'll be happy to work on a PR.
The system stores scene path relative to the Map Root Folder. This is mostly done to make the paths shorter.
I think optionally supporting UID could work too, as they are shorter than paths. It can be a project setting taking effect when assigning scenes, and possibly the uid://
part can be skipped when saving.
Implemented in 9f8c98f
The feature is mentioned in the README: https://github.com/KoBeWi/Metroidvania-System?tab=readme-ov-file#scene-assign-mode
Let me know if using UID breaks any feature. Hopefully I didn't miss anything.