summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTwarit <wtwarit@gmail.com>2019-09-14 21:06:52 +0530
committerTwarit <wtwarit@gmail.com>2019-09-14 21:06:52 +0530
commit50da1b7d15f2a7c5babf059dd649eea1cd0497ec (patch)
tree9bd759c0db6f0b8a91a739c59e070bfc1152250d
parent24e1039eb6fe32115e8d1a62a84965e9be19a2ed (diff)
Add correct class selection in Select VCS menu
-rw-r--r--editor/plugins/version_control_editor_plugin.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/editor/plugins/version_control_editor_plugin.cpp b/editor/plugins/version_control_editor_plugin.cpp
index c059977487..1c394793e6 100644
--- a/editor/plugins/version_control_editor_plugin.cpp
+++ b/editor/plugins/version_control_editor_plugin.cpp
@@ -381,7 +381,19 @@ void VersionControlEditorPlugin::register_editor() {
void VersionControlEditorPlugin::fetch_available_vcs_addon_names() {
- ScriptServer::get_global_class_list(&available_addons);
+ List<StringName> global_classes;
+ ScriptServer::get_global_class_list(&global_classes);
+
+ for (int i = 0; i != global_classes.size(); i++) {
+
+ String path = ScriptServer::get_global_class_path(global_classes[i]);
+ Ref<Script> script = ResourceLoader::load(path);
+
+ if (script->get_instance_base_type() == "EditorVCSInterface") {
+
+ available_addons.push_back(global_classes[i]);
+ }
+ }
}
void VersionControlEditorPlugin::clear_stage_area() {