Open Murateba opened 3 months ago
Project Settings are a better place for plugin settings. Some people use git submodules for their addons, or just don't like modifying addon content.
I believe for project-independent settings you can use EditorSettings?
I actually think we should streamline custom settings for addons, but we should do it in a way that reduces boilerplate to create custom project and editor settings. A lot of plugins already implement their settings in this way so this concept would create two competing systems.
Also it would make plugin updates impossible without erasing user settings.
The plugin.cfg
is a static manifest for the plugin, user settings don't belong in there.
Describe the project you are working on
Add support for custom sections in plugin.cfg files #95866
Custom settings support for plugins under
res://addons/
plugin.cfg
by plugin developerDescribe the problem or limitation you are having in your project
When developing plugins, I create custom sections in my
plugin.cfg
to help customize the functionality of plugin across different projects.But there are two limitations that I'm facing:
Adjusting settings To change the value of a custom setting, project developer needs to edit
plugin.cfg
for that plugin manually (find the section -> find the key -> do the changes -> save -> reload) which is not handy.Accessing settings To access these custom settings, developer needs to use
ConfigFile
and manually loadplugin.cfg
which is not handy again because of extra work such as excluding default[plugin]
section when loading, finding the path of file, re-loading, etc.Describe the feature / enhancement and how it helps to overcome the problem or limitation
This feature changes the way Plugins tab look in Project Settings window. Shows a drop-down menu for each custom section and includes keys that have a supported type of value.
Custom settings can be edited directly within the editor, removes the requirement of editing
plugin.cfg
file. Automatically reloads and updates, settings can be accesed withget_plugin_settings()
in main script. No need to deal withConfigFile
anymore.Indicates the type of setting (int, bool, String, Color, Vector2, etc...), changes the adjusting way if necessary.
Supported types
Previews
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
If this enhancement will not be used often, can it be worked around with a few lines of script?
It would be very hard to implement this feature with a few lines of script.
Is there a reason why this should be core and not an add-on in the asset library?
This feature should be core because it directly effects add-ons and makes them easier to use. Users should easily interact with installed plugins in their projects by default, not by downloading another add-on from asset library. Making this feature core will likely to hype plugins.