diff --git a/godot-git-plugin/src/gdlibrary.cpp b/godot-git-plugin/src/gdlibrary.cpp index 248df94..3f12f92 100644 --- a/godot-git-plugin/src/gdlibrary.cpp +++ b/godot-git-plugin/src/gdlibrary.cpp @@ -6,12 +6,14 @@ extern "C" void GDN_EXPORT godot_gdnative_init(godot_gdnative_init_options *o) { godot::Godot::gdnative_init(o); } -//extern "C" void GDN_EXPORT godot_singelton_init(godot_gdnative_init_options *o) { -// godot::Godot::print("godot_singelton_init"); -//} +extern "C" void GDN_EXPORT godot_singelton_init(godot_gdnative_init_options *o) { + + godot::Godot::print("godot_singelton_init"); +} extern "C" void GDN_EXPORT godot_gdnative_singleton(godot_gdnative_init_options *o) { - + + godot::Godot::print("godot_gdnative_singleton"); } extern "C" void GDN_EXPORT godot_gdnative_terminate(godot_gdnative_terminate_options *o) { @@ -22,5 +24,6 @@ extern "C" void GDN_EXPORT godot_gdnative_terminate(godot_gdnative_terminate_opt extern "C" void GDN_EXPORT godot_nativescript_init(void *handle) { godot::Godot::nativescript_init(handle); - godot::register_class(); + godot::Godot::print("godot_nativescript_init"); + godot::register_class(); } diff --git a/godot-git-plugin/src/git_api.cpp b/godot-git-plugin/src/git_api.cpp index 2b3dda1..32f3c97 100644 --- a/godot-git-plugin/src/git_api.cpp +++ b/godot-git-plugin/src/git_api.cpp @@ -5,11 +5,14 @@ namespace godot { void GitAPI::_register_methods() { register_method("_process", &GitAPI::_process); + register_method("get_vcs_name", &GitAPI::get_vcs_name); + + godot::register_signal("get_vcs_name", godot::Dictionary()); } GitAPI::GitAPI() { - - register_singleton((Node *)this); + godot::Godot::print("Gitinit!"); + connect("get_vcs_name", (EditorVCSInterface *) this, "get_vcs_name"); } GitAPI::~GitAPI() { @@ -17,7 +20,11 @@ GitAPI::~GitAPI() { void GitAPI::_init() { - WARN_PRINT("Gitinit!"); +} + +String GitAPI::get_vcs_name() { + + return "Git"; } void GitAPI::_process(float delta) { diff --git a/godot-git-plugin/src/git_api.h b/godot-git-plugin/src/git_api.h index 2a2a718..fa578a2 100644 --- a/godot-git-plugin/src/git_api.h +++ b/godot-git-plugin/src/git_api.h @@ -20,6 +20,8 @@ public: void _init(); + String get_vcs_name(); + void _process(float delta); };