1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

[HTML5] Add JavaScriptToolsEditorPlugin.

A new editor plugin, specific to HTML5, that provide some extra features
needed to make the editor usable on that platform.

For now, it adds a "Download project sources" option in the "Tool" menu,
so the user can download the work done as a zip file (from the browser
storage).
This commit is contained in:
Fabio Alessandrelli
2020-09-17 18:01:36 +02:00
parent 294e9752bd
commit 55f04952c5
4 changed files with 158 additions and 6 deletions

View File

@@ -0,0 +1,32 @@
#ifndef JAVASCRIPT_TOOLS_EDITOR_PLUGIN_H
#define JAVASCRIPT_TOOLS_EDITOR_PLUGIN_H
#if defined(TOOLS_ENABLED) && defined(JAVASCRIPT_ENABLED)
#include "core/io/zip_io.h"
#include "editor/editor_plugin.h"
class JavaScriptToolsEditorPlugin : public EditorPlugin {
GDCLASS(JavaScriptToolsEditorPlugin, 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 _downalod_zip(Variant p_v);
public:
static void initialize();
JavaScriptToolsEditorPlugin(EditorNode *p_editor);
};
#else
class JavaScriptToolsEditorPlugin {
public:
static void initialize() {}
};
#endif
#endif // JAVASCRIPT_TOOLS_EDITOR_PLUGIN_H