Skip to content

Commit

Permalink
Merge pull request #59561 from akien-mga/js-export-explain-why-no-tem…
Browse files Browse the repository at this point in the history
…plates
  • Loading branch information
akien-mga authored Mar 27, 2022
2 parents 9139146 + 93b7a85 commit a5eed70
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
9 changes: 9 additions & 0 deletions platform/javascript/export/export_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,15 @@ Ref<Texture2D> EditorExportPlatformJavaScript::get_logo() const {
}

bool EditorExportPlatformJavaScript::can_export(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates) const {
#ifndef DEV_ENABLED
// We don't provide export templates for the HTML5 platform currently as there
// is no suitable renderer to use with them. So we forbid exporting and tell
// users why. This is skipped in DEV_ENABLED so that contributors can still test
// the pipeline once we start having WebGL or WebGPU support.
r_error = "The HTML5 platform is currently not supported in Godot 4.0, as there is no suitable renderer for it.\n";
return false;
#endif

String err;
bool valid = false;
ExportMode mode = (ExportMode)(int)p_preset->get("variant/export_type");
Expand Down
8 changes: 8 additions & 0 deletions platform/uwp/export/export_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,14 @@ void EditorExportPlatformUWP::get_export_options(List<ExportOption> *r_options)
}

bool EditorExportPlatformUWP::can_export(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates) const {
#ifndef DEV_ENABLED
// We don't provide export templates for the UWP platform currently as it
// has not been ported for Godot 4.0. This is skipped in DEV_ENABLED so that
// contributors can still test the pipeline if/when we can build it again.
r_error = "The UWP platform is currently not supported in Godot 4.0.\n";
return false;
#endif

String err;
bool valid = false;

Expand Down

0 comments on commit a5eed70

Please sign in to comment.