diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index b6d8d7b8d681..c39912d77288 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -1785,6 +1785,35 @@ void EditorSettings::notify_changes() { root->propagate_notification(NOTIFICATION_EDITOR_SETTINGS_CHANGED); } +#ifdef TOOLS_ENABLED +void EditorSettings::get_argument_options(const StringName &p_function, int p_idx, List *r_options) const { + const String pf = p_function; + if (p_idx == 0) { + if (pf == "has_setting" || pf == "set_setting" || pf == "get_setting" || pf == "erase" || + pf == "set_initial_value" || pf == "set_as_basic" || pf == "mark_setting_changed") { + for (const KeyValue &E : props) { + if (E.value.hide_from_editor) { + continue; + } + + r_options->push_back(E.key.quote()); + } + } else if (pf == "get_project_metadata" && project_metadata.is_valid()) { + List sections; + project_metadata->get_sections(§ions); + for (const String §ion : sections) { + r_options->push_back(section.quote()); + } + } else if (pf == "set_builtin_action_override") { + for (const StringName &action : InputMap::get_singleton()->get_actions()) { + r_options->push_back(String(action).quote()); + } + } + } + Object::get_argument_options(p_function, p_idx, r_options); +} +#endif + void EditorSettings::_bind_methods() { ClassDB::bind_method(D_METHOD("has_setting", "name"), &EditorSettings::has_setting); ClassDB::bind_method(D_METHOD("set_setting", "name", "value"), &EditorSettings::set_setting); diff --git a/editor/editor_settings.h b/editor/editor_settings.h index 4995558e2b9d..a058f91be8f4 100644 --- a/editor/editor_settings.h +++ b/editor/editor_settings.h @@ -186,6 +186,10 @@ class EditorSettings : public Resource { void notify_changes(); +#ifdef TOOLS_ENABLED + virtual void get_argument_options(const StringName &p_function, int p_idx, List *r_options) const override; +#endif + EditorSettings(); ~EditorSettings(); };