Make sure that the script editor is the 3rd tab. I implemented the simplest solution I could think for now. If more control is needed in the future, EditorPlugins will likely need a priority queue (or some different, more generic solution).

This commit is contained in:
Relintai 2023-03-19 11:02:20 +01:00
parent 054332ae8d
commit 27920ca1a7
2 changed files with 14 additions and 1 deletions

View File

@ -330,6 +330,19 @@ public:
ERR_FAIL_COND(creation_func_count >= MAX_CREATE_FUNCS); ERR_FAIL_COND(creation_func_count >= MAX_CREATE_FUNCS);
creation_funcs[creation_func_count++] = p_func; creation_funcs[creation_func_count++] = p_func;
} }
template <class T>
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<T>;
}
}; };
#endif #endif

View File

@ -25,7 +25,7 @@ void register_editor_code_editor_types(ModuleRegistrationLevel p_level) {
#ifdef TOOLS_ENABLED #ifdef TOOLS_ENABLED
if (p_level == MODULE_REGISTRATION_LEVEL_EDITOR) { if (p_level == MODULE_REGISTRATION_LEVEL_EDITOR) {
EditorPlugins::add_by_type<EditorScriptEditorPlugin>(); EditorPlugins::add_by_type_front<EditorScriptEditorPlugin>();
} }
#endif #endif
} }