summaryrefslogtreecommitdiff
path: root/core/core_bind.cpp
diff options
context:
space:
mode:
authorreduz <reduzio@gmail.com>2022-03-26 16:48:43 +0100
committerreduz <reduzio@gmail.com>2022-03-27 16:13:00 +0200
commit360dea5348652d8806d33598e111651afb3d193a (patch)
tree3726e871844722d9561943a85a447037342df7dc /core/core_bind.cpp
parenta5eed70fa2edcf755d6abea2077232e38381449b (diff)
Add GDExtension support to Script
* Ability to create script languages from GDExtension * Some additions to gdnative_extension.h to make this happen * Moved the GDExtension binder to core This now allows creating scripting languages from GDExtension, with the same ease as if it was a module. It replaces the old PluginScript from Godot 3.x. Warning: GodotCPP will need to be updated to support this (it may be a bit of work as ScriptInstance needs to be created over there again).
Diffstat (limited to 'core/core_bind.cpp')
-rw-r--r--core/core_bind.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/core/core_bind.cpp b/core/core_bind.cpp
index 7150459d84..8b060b09f9 100644
--- a/core/core_bind.cpp
+++ b/core/core_bind.cpp
@@ -2296,6 +2296,18 @@ Vector<String> Engine::get_singleton_list() const {
return ret;
}
+void Engine::register_script_language(ScriptLanguage *p_language) {
+ ScriptServer::register_language(p_language);
+}
+
+int Engine::get_script_language_count() {
+ return ScriptServer::get_language_count();
+}
+
+ScriptLanguage *Engine::get_script_language(int p_index) const {
+ return ScriptServer::get_language(p_index);
+}
+
void Engine::set_editor_hint(bool p_enabled) {
::Engine::get_singleton()->set_editor_hint(p_enabled);
}
@@ -2347,6 +2359,10 @@ void Engine::_bind_methods() {
ClassDB::bind_method(D_METHOD("unregister_singleton", "name"), &Engine::unregister_singleton);
ClassDB::bind_method(D_METHOD("get_singleton_list"), &Engine::get_singleton_list);
+ ClassDB::bind_method(D_METHOD("register_script_language", "language"), &Engine::register_script_language);
+ ClassDB::bind_method(D_METHOD("get_script_language_count"), &Engine::get_script_language_count);
+ ClassDB::bind_method(D_METHOD("get_script_language", "index"), &Engine::get_script_language);
+
ClassDB::bind_method(D_METHOD("is_editor_hint"), &Engine::is_editor_hint);
ClassDB::bind_method(D_METHOD("set_print_error_messages", "enabled"), &Engine::set_print_error_messages);