From 73c1b212f705f2d0b6bf6994ede014899a1b3013 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Thu, 20 Jul 2023 23:27:40 +0200 Subject: [PATCH] Improve headings for the export mode in the Export dialog "Export as dedicated server" now uses a less confusing heading. --- editor/export/project_export.cpp | 15 +++++++++++++-- editor/export/project_export.h | 1 + 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/editor/export/project_export.cpp b/editor/export/project_export.cpp index 7c7762e0fd7..38d28cddeaf 100644 --- a/editor/export/project_export.cpp +++ b/editor/export/project_export.cpp @@ -242,7 +242,7 @@ void ProjectExportDialog::_edit_preset(int p_index) { export_filter->select(current->get_export_filter()); include_filters->set_text(current->get_include_filter()); - include_label->set_text(current->get_export_filter() == EditorExportPreset::EXCLUDE_SELECTED_RESOURCES ? TTR("Resources to exclude:") : TTR("Resources to export:")); + include_label->set_text(_get_resource_export_header(current->get_export_filter())); exclude_filters->set_text(current->get_exclude_filter()); server_strip_message->set_visible(current->get_export_filter() == EditorExportPreset::EXPORT_CUSTOMIZED); @@ -703,13 +703,24 @@ void ProjectExportDialog::_export_type_changed(int p_which) { if (filter_type == EditorExportPreset::EXPORT_CUSTOMIZED && current->get_customized_files_count() == 0) { current->set_file_export_mode("res://", EditorExportPreset::MODE_FILE_STRIP); } - include_label->set_text(current->get_export_filter() == EditorExportPreset::EXCLUDE_SELECTED_RESOURCES ? TTR("Resources to exclude:") : TTR("Resources to export:")); + include_label->set_text(_get_resource_export_header(current->get_export_filter())); updating = true; _fill_resource_tree(); updating = false; } +String ProjectExportDialog::_get_resource_export_header(EditorExportPreset::ExportFilter p_filter) const { + switch (p_filter) { + case EditorExportPreset::EXCLUDE_SELECTED_RESOURCES: + return TTR("Resources to exclude:"); + case EditorExportPreset::EXPORT_CUSTOMIZED: + return TTR("Resources to override export behavior:"); + default: + return TTR("Resources to export:"); + } +} + void ProjectExportDialog::_filter_changed(const String &p_filter) { if (updating) { return; diff --git a/editor/export/project_export.h b/editor/export/project_export.h index e53e3934324..98985092fb8 100644 --- a/editor/export/project_export.h +++ b/editor/export/project_export.h @@ -115,6 +115,7 @@ private: void _export_type_changed(int p_which); void _filter_changed(const String &p_filter); + String _get_resource_export_header(EditorExportPreset::ExportFilter p_filter) const; void _fill_resource_tree(); void _setup_item_for_file_mode(TreeItem *p_item, EditorExportPreset::FileExportMode p_mode); bool _fill_tree(EditorFileSystemDirectory *p_dir, TreeItem *p_item, Ref ¤t, EditorExportPreset::ExportFilter p_export_filter);