[Export] Add readable descriptions and validation warnings to the export options.
This commit is contained in:
parent
1b4b8934e0
commit
0088981c40
49 changed files with 2215 additions and 391 deletions
|
|
@ -33,6 +33,10 @@
|
|||
#include "editor/editor_settings.h"
|
||||
#include "export_plugin.h"
|
||||
|
||||
void register_web_exporter_types() {
|
||||
GDREGISTER_VIRTUAL_CLASS(EditorExportPlatformWeb);
|
||||
}
|
||||
|
||||
void register_web_exporter() {
|
||||
#ifndef ANDROID_ENABLED
|
||||
EDITOR_DEF("export/web/http_host", "localhost");
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@
|
|||
#ifndef WEB_EXPORT_H
|
||||
#define WEB_EXPORT_H
|
||||
|
||||
void register_web_exporter_types();
|
||||
void register_web_exporter();
|
||||
|
||||
#endif // WEB_EXPORT_H
|
||||
|
|
|
|||
|
|
@ -320,7 +320,7 @@ void EditorExportPlatformWeb::get_preset_features(const Ref<EditorExportPreset>
|
|||
r_features->push_back("wasm32");
|
||||
}
|
||||
|
||||
void EditorExportPlatformWeb::get_export_options(List<ExportOption> *r_options) {
|
||||
void EditorExportPlatformWeb::get_export_options(List<ExportOption> *r_options) const {
|
||||
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "custom_template/debug", PROPERTY_HINT_GLOBAL_FILE, "*.zip"), ""));
|
||||
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "custom_template/release", PROPERTY_HINT_GLOBAL_FILE, "*.zip"), ""));
|
||||
|
||||
|
|
@ -656,31 +656,35 @@ void EditorExportPlatformWeb::_server_thread_poll(void *data) {
|
|||
}
|
||||
|
||||
EditorExportPlatformWeb::EditorExportPlatformWeb() {
|
||||
server.instantiate();
|
||||
server_thread.start(_server_thread_poll, this);
|
||||
if (EditorNode::get_singleton()) {
|
||||
server.instantiate();
|
||||
server_thread.start(_server_thread_poll, this);
|
||||
|
||||
#ifdef MODULE_SVG_ENABLED
|
||||
Ref<Image> img = memnew(Image);
|
||||
const bool upsample = !Math::is_equal_approx(Math::round(EDSCALE), EDSCALE);
|
||||
Ref<Image> img = memnew(Image);
|
||||
const bool upsample = !Math::is_equal_approx(Math::round(EDSCALE), EDSCALE);
|
||||
|
||||
ImageLoaderSVG img_loader;
|
||||
img_loader.create_image_from_string(img, _web_logo_svg, EDSCALE, upsample, false);
|
||||
logo = ImageTexture::create_from_image(img);
|
||||
ImageLoaderSVG img_loader;
|
||||
img_loader.create_image_from_string(img, _web_logo_svg, EDSCALE, upsample, false);
|
||||
logo = ImageTexture::create_from_image(img);
|
||||
|
||||
img_loader.create_image_from_string(img, _web_run_icon_svg, EDSCALE, upsample, false);
|
||||
run_icon = ImageTexture::create_from_image(img);
|
||||
img_loader.create_image_from_string(img, _web_run_icon_svg, EDSCALE, upsample, false);
|
||||
run_icon = ImageTexture::create_from_image(img);
|
||||
#endif
|
||||
|
||||
Ref<Theme> theme = EditorNode::get_singleton()->get_editor_theme();
|
||||
if (theme.is_valid()) {
|
||||
stop_icon = theme->get_icon(SNAME("Stop"), SNAME("EditorIcons"));
|
||||
} else {
|
||||
stop_icon.instantiate();
|
||||
Ref<Theme> theme = EditorNode::get_singleton()->get_editor_theme();
|
||||
if (theme.is_valid()) {
|
||||
stop_icon = theme->get_icon(SNAME("Stop"), SNAME("EditorIcons"));
|
||||
} else {
|
||||
stop_icon.instantiate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
EditorExportPlatformWeb::~EditorExportPlatformWeb() {
|
||||
server->stop();
|
||||
if (server.is_valid()) {
|
||||
server->stop();
|
||||
}
|
||||
server_quit = true;
|
||||
server_thread.wait_to_finish();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ class EditorExportPlatformWeb : public EditorExportPlatform {
|
|||
public:
|
||||
virtual void get_preset_features(const Ref<EditorExportPreset> &p_preset, List<String> *r_features) const override;
|
||||
|
||||
virtual void get_export_options(List<ExportOption> *r_options) override;
|
||||
virtual void get_export_options(List<ExportOption> *r_options) const override;
|
||||
|
||||
virtual String get_name() const override;
|
||||
virtual String get_os_name() const override;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue