summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-04-01 00:20:54 +0200
committerGitHub <noreply@github.com>2021-04-01 00:20:54 +0200
commit7db85fffb50ef98dbf175189fba17a4d7dc85f5d (patch)
tree09ddd3dde0419d40cb04e405206f93bba61e7c88
parentc2b7c69e2bb675918922aab1eb569d1a33c3371a (diff)
parenteb4082b24a5ad037fff8b3c881bbdec78a9a26ed (diff)
Merge pull request #43550 from KoBeWi/resourcism
Add option to exclude selected resources on export
-rw-r--r--editor/editor_export.cpp13
-rw-r--r--editor/editor_export.h1
-rw-r--r--editor/project_export.cpp1
3 files changed, 15 insertions, 0 deletions
diff --git a/editor/editor_export.cpp b/editor/editor_export.cpp
index 3c0fe1571c..a5ebfbfb8a 100644
--- a/editor/editor_export.cpp
+++ b/editor/editor_export.cpp
@@ -730,6 +730,12 @@ Error EditorExportPlatform::export_project_files(const Ref<EditorExportPreset> &
if (p_preset->get_export_filter() == EditorExportPreset::EXPORT_ALL_RESOURCES) {
//find stuff
_export_find_resources(EditorFileSystem::get_singleton()->get_filesystem(), paths);
+ } else if (p_preset->get_export_filter() == EditorExportPreset::EXCLUDE_SELECTED_RESOURCES) {
+ _export_find_resources(EditorFileSystem::get_singleton()->get_filesystem(), paths);
+ Vector<String> files = p_preset->get_files_to_export();
+ for (int i = 0; i < files.size(); i++) {
+ paths.erase(files[i]);
+ }
} else {
bool scenes_only = p_preset->get_export_filter() == EditorExportPreset::EXPORT_SELECTED_SCENES;
@@ -1394,6 +1400,10 @@ void EditorExport::_save() {
config->set_value(section, "export_filter", "resources");
save_files = true;
} break;
+ case EditorExportPreset::EXCLUDE_SELECTED_RESOURCES: {
+ config->set_value(section, "export_filter", "exclude");
+ save_files = true;
+ } break;
}
if (save_files) {
@@ -1572,6 +1582,9 @@ void EditorExport::load_config() {
} else if (export_filter == "resources") {
preset->set_export_filter(EditorExportPreset::EXPORT_SELECTED_RESOURCES);
get_files = true;
+ } else if (export_filter == "exclude") {
+ preset->set_export_filter(EditorExportPreset::EXCLUDE_SELECTED_RESOURCES);
+ get_files = true;
}
if (get_files) {
diff --git a/editor/editor_export.h b/editor/editor_export.h
index e6026e7aae..c96c8fdbce 100644
--- a/editor/editor_export.h
+++ b/editor/editor_export.h
@@ -50,6 +50,7 @@ public:
EXPORT_ALL_RESOURCES,
EXPORT_SELECTED_SCENES,
EXPORT_SELECTED_RESOURCES,
+ EXCLUDE_SELECTED_RESOURCES,
};
enum ScriptExportMode {
diff --git a/editor/project_export.cpp b/editor/project_export.cpp
index b7dd1013f3..3ede50320a 100644
--- a/editor/project_export.cpp
+++ b/editor/project_export.cpp
@@ -1082,6 +1082,7 @@ ProjectExportDialog::ProjectExportDialog() {
export_filter->add_item(TTR("Export all resources in the project"));
export_filter->add_item(TTR("Export selected scenes (and dependencies)"));
export_filter->add_item(TTR("Export selected resources (and dependencies)"));
+ export_filter->add_item(TTR("Export all resources in the project except resources checked below"));
resources_vb->add_margin_child(TTR("Export Mode:"), export_filter);
export_filter->connect("item_selected", callable_mp(this, &ProjectExportDialog::_export_type_changed));