|
@@ -31,6 +31,7 @@
|
|
|
#include "editor_export.h"
|
|
|
#include "io/zip_io.h"
|
|
|
#include "platform/javascript/logo.gen.h"
|
|
|
+#include "platform/javascript/run_icon.gen.h"
|
|
|
|
|
|
#define EXPORT_TEMPLATE_WEBASSEMBLY_RELEASE "webassembly_release.zip"
|
|
|
#define EXPORT_TEMPLATE_WEBASSEMBLY_DEBUG "webassembly_debug.zip"
|
|
@@ -42,6 +43,7 @@ class EditorExportPlatformJavaScript : public EditorExportPlatform {
|
|
|
GDCLASS(EditorExportPlatformJavaScript, EditorExportPlatform)
|
|
|
|
|
|
Ref<ImageTexture> logo;
|
|
|
+ Ref<ImageTexture> run_icon;
|
|
|
|
|
|
void _fix_html(Vector<uint8_t> &p_html, const Ref<EditorExportPreset> &p_preset, const String &p_name, bool p_debug);
|
|
|
void _fix_fsloader_js(Vector<uint8_t> &p_js, const String &p_pack_name, uint64_t p_pack_size);
|
|
@@ -68,6 +70,7 @@ public:
|
|
|
virtual String get_device_name(int p_device) const { return TTR("Run in Browser"); }
|
|
|
virtual String get_device_info(int p_device) const { return TTR("Run exported HTML in the system's default browser."); }
|
|
|
virtual Error run(const Ref<EditorExportPreset> &p_preset, int p_device, int p_debug_flags);
|
|
|
+ virtual Ref<Texture> get_run_icon() const;
|
|
|
|
|
|
EditorExportPlatformJavaScript();
|
|
|
};
|
|
@@ -314,11 +317,20 @@ Error EditorExportPlatformJavaScript::run(const Ref<EditorExportPreset> &p_prese
|
|
|
return OK;
|
|
|
}
|
|
|
|
|
|
+Ref<Texture> EditorExportPlatformJavaScript::get_run_icon() const {
|
|
|
+
|
|
|
+ return run_icon;
|
|
|
+}
|
|
|
+
|
|
|
EditorExportPlatformJavaScript::EditorExportPlatformJavaScript() {
|
|
|
|
|
|
Ref<Image> img = memnew(Image(_javascript_logo));
|
|
|
logo.instance();
|
|
|
logo->create_from_image(img);
|
|
|
+
|
|
|
+ img = Ref<Image>(memnew(Image(_javascript_run_icon)));
|
|
|
+ run_icon.instance();
|
|
|
+ run_icon->create_from_image(img);
|
|
|
}
|
|
|
|
|
|
void register_javascript_exporter() {
|