1
0
mirror of https://github.com/godotengine/godot.git synced 2026-01-06 19:41:11 +00:00

Let EditorPlugins set editor/distraction-free mode

This commit is contained in:
Will Nations
2019-08-05 12:57:23 -05:00
parent dfa324eb8e
commit 2e3264259b
4 changed files with 30 additions and 0 deletions

View File

@@ -2775,6 +2775,20 @@ void EditorNode::_editor_select(int p_which) {
}
}
void EditorNode::select_editor_by_name(const String &p_name) {
ERR_FAIL_COND(p_name == "");
for (int i = 0; i < main_editor_buttons.size(); i++) {
if (main_editor_buttons[i]->get_text() == p_name) {
_editor_select(i);
return;
}
}
ERR_EXPLAIN("The editor name '" + p_name + "' was not found.");
ERR_FAIL();
}
void EditorNode::add_editor_plugin(EditorPlugin *p_editor, bool p_config_changed) {
if (p_editor->has_main_screen()) {