-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
Add a Resource to handle project files/directories references #9552
Comments
I've created a plugin that should satisfy this issue. |
@huwpascoe i've tried using the plugin, but it doesn't still do the work properly: you can't still drag files into the property box, and when you specify a resource type, files does not show up unless you select "all files" from the file picker |
@simo498 make sure the plugin is enabled in project settings |
Should it also work with C#? |
@simo498 Yes, it only changes the editor behavior so it can be removed at export time. |
Yes, I was saying (referencing godotengine/godot#91815 (comment)) that this might be built in in the engine to bind with C# and let people use this (core, imo) feature when creating a project with C# rather than gdscript |
References my open discussion #9545 (comment)
Describe the project you are working on
An RPG game, where any of the adjacent rooms are loaded at runtime
Describe the problem or limitation you are having in your project
Each of the rooms needs to keep the reference to the adjacent rooms as a string path, but the only way assign file paths to a property is by passing a string representing it. You can use an attribute hint to make it easier:
but it's still not possible to keep track of files/directories which get renamed or moved.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
If you use a resource directly, the engine is able to keep track of it even when renamed or moved inside the editor, i'd like to implement something similar but limiting this feature to keep track of a (project) resource path (or directory), to give the developer a way to manually handle each resource (when load/unload them, and how to do it, for example using other threads to load some scenes and resources)
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
This functionality should be added as a new resource type (something like
Path
), which only takes a string as its member fields.The user should be able to pass a file/directory into this resource from the editor, and the latter should be tracked by the editor and updated whether it gets moved or renamed from inside the editor.
The user should be able to access the file path as a string with a method
If this enhancement will not be used often, can it be worked around with a few lines of script?
It can't be worked around. The only way to achieve the same result is by manually changing each of the references to a certain file/directory when moved/renamed (which is not convenient at all, in particular when you are moving a large amount of file into a new location, and might lead to some of the references to be null if you forget to manually update them)
Is there a reason why this should be core and not an add-on in the asset library?
It should improve the editor usability, as it's a missing core funcionality
The text was updated successfully, but these errors were encountered: