diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-01-08 15:43:44 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-08 15:43:44 +0100 |
commit | 5e4d465356d3de2f4f6ee95722c4b8786e08e71b (patch) | |
tree | 4c193ccb5f09781a16c70f6d6f49d066b7b89fdc /editor | |
parent | 16f0357c8e2dbba77d3691c2a507c4f6872934a5 (diff) | |
parent | 7c29ce43755d7fb083bc06d6b406e3a150145309 (diff) |
Merge pull request #34913 from akien-mga/main-add-export-pack
Export: Add dedicated --export-pack option to export data pack
Diffstat (limited to 'editor')
-rw-r--r-- | editor/editor_node.cpp | 8 | ||||
-rw-r--r-- | editor/editor_node.h | 3 |
2 files changed, 5 insertions, 6 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index d7bc959729..0be0ea90a3 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -585,10 +585,7 @@ void EditorNode::_fs_changed() { export_error = vformat("Export preset '%s' doesn't have a matching platform.", preset_name); } else { Error err = OK; - // FIXME: This way to export only resources .pck or .zip is pretty hacky - // and undocumented, and might be problematic for platforms where .zip is - // a valid project export format (e.g. macOS). - if (export_defer.path.ends_with(".pck") || export_defer.path.ends_with(".zip")) { + if (export_defer.pack_only) { // Only export .pck or .zip data pack. if (export_defer.path.ends_with(".zip")) { err = platform->export_zip(preset, export_defer.debug, export_defer.path); } else if (export_defer.path.ends_with(".pck")) { @@ -3942,11 +3939,12 @@ void EditorNode::_editor_file_dialog_unregister(EditorFileDialog *p_dialog) { Vector<EditorNodeInitCallback> EditorNode::_init_callbacks; -Error EditorNode::export_preset(const String &p_preset, const String &p_path, bool p_debug) { +Error EditorNode::export_preset(const String &p_preset, const String &p_path, bool p_debug, bool p_pack_only) { export_defer.preset = p_preset; export_defer.path = p_path; export_defer.debug = p_debug; + export_defer.pack_only = p_pack_only; disable_progress_dialog = true; return OK; } diff --git a/editor/editor_node.h b/editor/editor_node.h index 469ba76872..7f53f77c76 100644 --- a/editor/editor_node.h +++ b/editor/editor_node.h @@ -558,6 +558,7 @@ private: String preset; String path; bool debug; + bool pack_only; } export_defer; bool disable_progress_dialog; @@ -779,7 +780,7 @@ public: void _copy_warning(const String &p_str); - Error export_preset(const String &p_preset, const String &p_path, bool p_debug); + Error export_preset(const String &p_preset, const String &p_path, bool p_debug, bool p_pack_only); static void register_editor_types(); static void unregister_editor_types(); |