Make EditorSettings
accessible as a singleton, to be able to access outside EditorPlugin
#3511
Labels
Milestone
Describe the project you are working on
ReactGD, right now developing a gdnative plugin
Describe the problem or limitation you are having in your project
I wanted to get a editor setting for my plugin, more specifically
network/language_server/remote_port
to get the gdscript LSP and connect to it from my gdnative plugin. The problem is thatEditorSettings
is not a singleton likeProjectSettings
, so to access it, you need to get it fromEditorInterface
which is only available forEditorPlugin
.Describe the feature / enhancement and how it helps to overcome the problem or limitation
The feature is to turn
EditorSettings
an editor-only singleton, that means that it would only be accessed if inside editor, not being able to access it in builds. The user must ensure that it is only referencing it inside editor-only code blocks,if Engine.editor_hint
for gdscript or#if TOOLS_ENABLED
for gdnative (I don't remember if gdnative have this define).Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
For gdnative, it would have a static function
EditorSettings *get_singleton()
which would return the singleton instance of the editor settings. For GDScript, it would be as simple as referencingEditorSettings
in any place of the code.If this enhancement will not be used often, can it be worked around with a few lines of script?
No, there's no other way to access EditorSettings outside EditorPlugin.
Is there a reason why this should be core and not an add-on in the asset library?
Same as above.
The text was updated successfully, but these errors were encountered: