summaryrefslogtreecommitdiffstats
path: root/editor/export/project_export.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/export/project_export.cpp')
-rw-r--r--editor/export/project_export.cpp30
1 files changed, 29 insertions, 1 deletions
diff --git a/editor/export/project_export.cpp b/editor/export/project_export.cpp
index 63bd87e6cc..dba524310e 100644
--- a/editor/export/project_export.cpp
+++ b/editor/export/project_export.cpp
@@ -383,6 +383,9 @@ void ProjectExportDialog::_edit_preset(int p_index) {
script_key_error->hide();
}
+ int script_export_mode = current->get_script_export_mode();
+ script_mode->select(script_export_mode);
+
updating = false;
}
@@ -582,6 +585,19 @@ bool ProjectExportDialog::_validate_script_encryption_key(const String &p_key) {
return is_valid;
}
+void ProjectExportDialog::_script_export_mode_changed(int p_mode) {
+ if (updating) {
+ return;
+ }
+
+ Ref<EditorExportPreset> current = get_current_preset();
+ ERR_FAIL_COND(current.is_null());
+
+ current->set_script_export_mode(p_mode);
+
+ _update_current_preset();
+}
+
void ProjectExportDialog::_duplicate_preset() {
Ref<EditorExportPreset> current = get_current_preset();
if (current.is_null()) {
@@ -1328,7 +1344,7 @@ ProjectExportDialog::ProjectExportDialog() {
feature_vb->add_margin_child(TTR("Feature List:"), custom_feature_display, true);
sections->add_child(feature_vb);
- // Script export parameters.
+ // Encryption export parameters.
VBoxContainer *sec_vb = memnew(VBoxContainer);
sec_vb->set_name(TTR("Encryption"));
@@ -1373,6 +1389,18 @@ ProjectExportDialog::ProjectExportDialog() {
sec_more_info->connect("pressed", callable_mp(this, &ProjectExportDialog::_open_key_help_link));
sec_vb->add_child(sec_more_info);
+ // Script export parameters.
+
+ VBoxContainer *script_vb = memnew(VBoxContainer);
+ script_vb->set_name(TTR("Scripts"));
+
+ script_mode = memnew(OptionButton);
+ script_vb->add_margin_child(TTR("GDScript Export Mode:"), script_mode);
+ script_mode->add_item(TTR("Text (easier debugging)"), (int)EditorExportPreset::MODE_SCRIPT_TEXT);
+ script_mode->add_item(TTR("Binary tokens (faster loading)"), (int)EditorExportPreset::MODE_SCRIPT_BINARY_TOKENS);
+ script_mode->connect("item_selected", callable_mp(this, &ProjectExportDialog::_script_export_mode_changed));
+ sections->add_child(script_vb);
+
sections->connect("tab_changed", callable_mp(this, &ProjectExportDialog::_tab_changed));
// Disable by default.