mirror of
https://github.com/godotengine/godot-git-plugin.git
synced 2026-01-04 22:09:55 +03:00
Try out signals for calling functions
This commit is contained in:
@@ -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::GitAPI>();
|
||||
godot::Godot::print("godot_nativescript_init");
|
||||
godot::register_class<godot::GitAPI>();
|
||||
}
|
||||
|
||||
@@ -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<GitAPI>("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) {
|
||||
|
||||
@@ -20,6 +20,8 @@ public:
|
||||
|
||||
void _init();
|
||||
|
||||
String get_vcs_name();
|
||||
|
||||
void _process(float delta);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user