diff --git a/editor/editor_plugin.h b/editor/editor_plugin.h index fd417a46d..4c8286b78 100644 --- a/editor/editor_plugin.h +++ b/editor/editor_plugin.h @@ -330,6 +330,19 @@ public: ERR_FAIL_COND(creation_func_count >= MAX_CREATE_FUNCS); creation_funcs[creation_func_count++] = p_func; } + + template + static void add_by_type_front() { + ERR_FAIL_COND(creation_func_count >= MAX_CREATE_FUNCS); + + for (int i = creation_func_count - 1; i >= 0; --i) { + creation_funcs[i + 1] = creation_funcs[i]; + } + + ++creation_func_count; + + creation_funcs[0] = creator; + } }; #endif diff --git a/editor_modules/editor_code_editor/register_types.cpp b/editor_modules/editor_code_editor/register_types.cpp index 2a0e1d3d5..ffe59b5ae 100644 --- a/editor_modules/editor_code_editor/register_types.cpp +++ b/editor_modules/editor_code_editor/register_types.cpp @@ -25,7 +25,7 @@ void register_editor_code_editor_types(ModuleRegistrationLevel p_level) { #ifdef TOOLS_ENABLED if (p_level == MODULE_REGISTRATION_LEVEL_EDITOR) { - EditorPlugins::add_by_type(); + EditorPlugins::add_by_type_front(); } #endif }