You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
EditorPlugins, mainly Textalog (a dialog node implementation) and Event System (a plugin to execute pieces of code in sequence according to the scenario)
Describe the problem or limitation you are having in your project
Event system plugin adds a bottom dock panel to edit a custom resource. Some operations that can be applied in that resource can be made through shortcuts:
Those shortcuts were hardcoded replicating what I saw in editor settings.
Trying to get default shortcuts through EditorSettings.get_setting(path/to/shortcut) doesn't works.
I'm going to add more actions, and I don't want to keep myself hardcoding things, I want to use the editor ones.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Exposing get_shortcut method from EditorSettings could help me in this situation.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Basically, expose EditorSettings::get_shortcut():
In EditorSettings or inside EditorPlugin or EditorInterface, I don't know.
extendsEditorPluginfunc_ready():
# In EditorPluginget_shortcut(shortcut_path:String) <-OptionA# or in editor interfaceget_editor_interface().get_shortcut(shortcut_path:String) <-OptionB# or in editor settingsget_editor_interface().get_editor_settings().get_shortcut(shortcut_path:String) <-OptionC
But now that I want to expose some methods, why not exposing every method related to shortcuts, in order to give those tools to plugin makers (no idea why someone would use EditorSettings in a game), that means exposing:
If this enhancement will not be used often, can it be worked around with a few lines of script?
A few lines? No, you'll need to create the whole shortcut by hand, and nothing ensures that will be the same as the editor uses:
because this will not work:
Describe the project you are working on
EditorPlugin
s, mainly Textalog (a dialog node implementation) and Event System (a plugin to execute pieces of code in sequence according to the scenario)Describe the problem or limitation you are having in your project
Event system plugin adds a bottom dock panel to edit a custom resource. Some operations that can be applied in that resource can be made through shortcuts:
Those shortcuts were hardcoded replicating what I saw in editor settings.
Trying to get default shortcuts through
EditorSettings.get_setting(path/to/shortcut)
doesn't works.I'm going to add more actions, and I don't want to keep myself hardcoding things, I want to use the editor ones.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Exposing
get_shortcut
method fromEditorSettings
could help me in this situation.Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Basically, expose
EditorSettings::get_shortcut()
:In
EditorSettings
or insideEditorPlugin
orEditorInterface
, I don't know.But now that I want to expose some methods, why not exposing every method related to shortcuts, in order to give those tools to plugin makers (no idea why someone would use
EditorSettings
in a game), that means exposing:add_shortcut
(see Allow plugins to register shortcuts in the editor menu #2024 and Provide GDScript access toED_SHORTCUT()
from editor_settings.cpp #2547)is_shortcut
(to verify if your editor shortcut path already exists, maybe to avoid overriding it?)get_shortcut
(this issue)And maybe:
get_shortcut_list
(I had no idea)https://github.com/godotengine/godot/blob/cfc7c78732198a7ebc43b92ed24e7025fdf4bc11/editor/editor_settings.cpp#L1359-L1410
If this enhancement will not be used often, can it be worked around with a few lines of script?
A few lines? No, you'll need to create the whole shortcut by hand, and nothing ensures that will be the same as the editor uses:
because this will not work:
Is there a reason why this should be core and not an add-on in the asset library?
I had no idea if that is something possible using GDNative/GDExtension, always wanted to make a plugin with that, don't know where to start.
EditorSettings.call()
does not work, so I think need to be exposed somehow from core.The text was updated successfully, but these errors were encountered: