summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorkobewi <kobewi4e@gmail.com>2020-12-16 00:04:21 +0100
committerkobewi <kobewi4e@gmail.com>2020-12-16 20:23:51 +0100
commit889f5e44ef099d092977bc463f3d924d57390f79 (patch)
tree233524d550dc8aecb4217724eeb3ab6d825ed185 /platform
parent92d4deedaa542e9458845fdf2b2a44fedd19fde8 (diff)
Make tool menu plugins use Callables for callback
Diffstat (limited to 'platform')
-rw-r--r--platform/javascript/api/javascript_tools_editor_plugin.cpp7
-rw-r--r--platform/javascript/api/javascript_tools_editor_plugin.h4
2 files changed, 1 insertions, 10 deletions
diff --git a/platform/javascript/api/javascript_tools_editor_plugin.cpp b/platform/javascript/api/javascript_tools_editor_plugin.cpp
index 8d781703ed..a063718a0c 100644
--- a/platform/javascript/api/javascript_tools_editor_plugin.cpp
+++ b/platform/javascript/api/javascript_tools_editor_plugin.cpp
@@ -53,8 +53,7 @@ void JavaScriptToolsEditorPlugin::initialize() {
}
JavaScriptToolsEditorPlugin::JavaScriptToolsEditorPlugin(EditorNode *p_editor) {
- Variant v;
- add_tool_menu_item("Download Project Source", this, "_download_zip", v);
+ add_tool_menu_item("Download Project Source", callable_mp(this, &JavaScriptToolsEditorPlugin::_download_zip));
}
void JavaScriptToolsEditorPlugin::_download_zip(Variant p_v) {
@@ -73,10 +72,6 @@ void JavaScriptToolsEditorPlugin::_download_zip(Variant p_v) {
godot_js_editor_download_file("/tmp/project.zip", "project.zip", "application/zip");
}
-void JavaScriptToolsEditorPlugin::_bind_methods() {
- ClassDB::bind_method("_download_zip", &JavaScriptToolsEditorPlugin::_download_zip);
-}
-
void JavaScriptToolsEditorPlugin::_zip_file(String p_path, String p_base_path, zipFile p_zip) {
FileAccess *f = FileAccess::open(p_path, FileAccess::READ);
if (!f) {
diff --git a/platform/javascript/api/javascript_tools_editor_plugin.h b/platform/javascript/api/javascript_tools_editor_plugin.h
index cc09fa4cd3..df1197139c 100644
--- a/platform/javascript/api/javascript_tools_editor_plugin.h
+++ b/platform/javascript/api/javascript_tools_editor_plugin.h
@@ -41,10 +41,6 @@ class JavaScriptToolsEditorPlugin : public EditorPlugin {
private:
void _zip_file(String p_path, String p_base_path, zipFile p_zip);
void _zip_recursive(String p_path, String p_base_path, zipFile p_zip);
-
-protected:
- static void _bind_methods();
-
void _download_zip(Variant p_v);
public: