godotengine/godot-proposals

Allow setting default NativeScript library

rosshadden opened this issue · 2 comments

Here is my original issue, from before godot-proposals existed.

Describe the project you are working on:
Games; nothing specifically relevant here.

Describe the problem or limitation you are having in your project:
Currently, every time you add a new NativeScript script, you need to set the library.

Describe the feature / enhancement and how it helps to overcome the problem or limitation:
It would be great if you could set a default NativeScript library.

Or if that is not feasible, maybe we could at least populate the dropdown with a list of used libraries. Right now I have to manually load a library every time I want to use it. In the following screenshot, this is after I have loaded the library in another node. Nothing shows in the list so I have to click "Load" again.
2020-09-01-11-55-48

Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams:
Perhaps this could be implemented as a project-wide default setting (it seems unlikely to use multiple libraries in one project after all). Or perhaps it could be implemented as a "last library used is the default for newly created NativeScripts". Either way, having the option automatically set would greatly improve the user experience around using gdnative scripts, preventing us from having to drill into each added script to set the library. The workflow would be condensed down to simply attaching the script to a node.

If this enhancement will not be used often, can it be worked around with a few lines of script?:
No, unfortunately the workaround is to load libraries manually again and again on every new node. This may seem tiny but it all adds up.

Is there a reason why this should be core and not an add-on in the asset library?:
Not applicable; it would have to be core.

I think adding recently used resources to the dropdown list would be certainly useful for any type of resource.

Feature added in godotengine/godot#39479 could be used to instantiate default NativeScript library, but that's probably not what this proposal is about in the first place.

@rosshadden you can also drag-and-drop resources from the filesystem dock directly into the inspector properties currently. You can name your default library as default_library.gdn and then search for that in the filesystem dock, or add the library to favorites.

Closing as this proposal is obsolete as of the new GDExtension system in Godot 4.x.