You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-06 12:20:30 +00:00
Merge pull request #31461 from IronicallySerious/add-vcs-integration
VCS integration for Godot Editor
This commit is contained in:
@@ -122,6 +122,7 @@
|
||||
#include "editor/plugins/theme_editor_plugin.h"
|
||||
#include "editor/plugins/tile_map_editor_plugin.h"
|
||||
#include "editor/plugins/tile_set_editor_plugin.h"
|
||||
#include "editor/plugins/version_control_editor_plugin.h"
|
||||
#include "editor/plugins/visual_shader_editor_plugin.h"
|
||||
#include "editor/pvrtc_compress.h"
|
||||
#include "editor/register_exporters.h"
|
||||
@@ -184,6 +185,20 @@ void EditorNode::_update_scene_tabs() {
|
||||
}
|
||||
}
|
||||
|
||||
void EditorNode::_version_control_menu_option(int p_idx) {
|
||||
|
||||
switch (vcs_actions_menu->get_item_id(p_idx)) {
|
||||
case RUN_VCS_SETTINGS: {
|
||||
|
||||
VersionControlEditorPlugin::get_singleton()->popup_vcs_set_up_dialog(gui_base);
|
||||
} break;
|
||||
case RUN_VCS_SHUT_DOWN: {
|
||||
|
||||
VersionControlEditorPlugin::get_singleton()->shut_down();
|
||||
} break;
|
||||
}
|
||||
}
|
||||
|
||||
void EditorNode::_update_title() {
|
||||
|
||||
String appname = ProjectSettings::get_singleton()->get("application/config/name");
|
||||
@@ -3523,6 +3538,7 @@ void EditorNode::register_editor_types() {
|
||||
ClassDB::register_class<EditorResourcePreviewGenerator>();
|
||||
ClassDB::register_virtual_class<EditorFileSystem>();
|
||||
ClassDB::register_class<EditorFileSystemDirectory>();
|
||||
ClassDB::register_class<EditorVCSInterface>();
|
||||
ClassDB::register_virtual_class<ScriptEditor>();
|
||||
ClassDB::register_virtual_class<EditorInterface>();
|
||||
ClassDB::register_class<EditorExportPlugin>();
|
||||
@@ -5312,6 +5328,7 @@ void EditorNode::_bind_methods() {
|
||||
ClassDB::bind_method("_dropped_files", &EditorNode::_dropped_files);
|
||||
ClassDB::bind_method(D_METHOD("_global_menu_action"), &EditorNode::_global_menu_action, DEFVAL(Variant()));
|
||||
ClassDB::bind_method("_toggle_distraction_free_mode", &EditorNode::_toggle_distraction_free_mode);
|
||||
ClassDB::bind_method("_version_control_menu_option", &EditorNode::_version_control_menu_option);
|
||||
ClassDB::bind_method("edit_item_resource", &EditorNode::edit_item_resource);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_gui_base"), &EditorNode::get_gui_base);
|
||||
@@ -5998,6 +6015,15 @@ EditorNode::EditorNode() {
|
||||
p->add_shortcut(ED_SHORTCUT("editor/project_settings", TTR("Project Settings...")), RUN_SETTINGS);
|
||||
p->connect("id_pressed", this, "_menu_option");
|
||||
|
||||
vcs_actions_menu = VersionControlEditorPlugin::get_singleton()->get_version_control_actions_panel();
|
||||
vcs_actions_menu->set_name("Version Control");
|
||||
vcs_actions_menu->connect("index_pressed", this, "_version_control_menu_option");
|
||||
p->add_separator();
|
||||
p->add_child(vcs_actions_menu);
|
||||
p->add_submenu_item(TTR("Version Control"), "Version Control");
|
||||
vcs_actions_menu->add_item(TTR("Set Up Version Control"), RUN_VCS_SETTINGS);
|
||||
vcs_actions_menu->add_item(TTR("Shut Down Version Control"), RUN_VCS_SHUT_DOWN);
|
||||
|
||||
p->add_separator();
|
||||
p->add_shortcut(ED_SHORTCUT("editor/export", TTR("Export...")), FILE_EXPORT_PROJECT);
|
||||
p->add_item(TTR("Install Android Build Template..."), FILE_INSTALL_ANDROID_SOURCE);
|
||||
@@ -6007,7 +6033,6 @@ EditorNode::EditorNode() {
|
||||
plugin_config_dialog->connect("plugin_ready", this, "_on_plugin_ready");
|
||||
gui_base->add_child(plugin_config_dialog);
|
||||
|
||||
p->add_separator();
|
||||
tool_menu = memnew(PopupMenu);
|
||||
tool_menu->set_name("Tools");
|
||||
tool_menu->connect("index_pressed", this, "_tool_menu_option");
|
||||
@@ -6472,6 +6497,7 @@ EditorNode::EditorNode() {
|
||||
//more visually meaningful to have this later
|
||||
raise_bottom_panel_item(AnimationPlayerEditor::singleton);
|
||||
|
||||
add_editor_plugin(VersionControlEditorPlugin::get_singleton());
|
||||
add_editor_plugin(memnew(ShaderEditorPlugin(this)));
|
||||
add_editor_plugin(memnew(VisualShaderEditorPlugin(this)));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user