summaryrefslogtreecommitdiff
path: root/tools/editor/project_export.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/editor/project_export.cpp')
-rw-r--r--tools/editor/project_export.cpp52
1 files changed, 38 insertions, 14 deletions
diff --git a/tools/editor/project_export.cpp b/tools/editor/project_export.cpp
index 3464b3c9bb..7690d31e7b 100644
--- a/tools/editor/project_export.cpp
+++ b/tools/editor/project_export.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -258,6 +258,7 @@ void ProjectExportDialog::_sample_convert_edited(int what) {
EditorImportExport::get_singleton()->sample_set_action( EditorImportExport::SampleAction(sample_mode->get_selected()));
EditorImportExport::get_singleton()->sample_set_max_hz( sample_max_hz->get_val() );
EditorImportExport::get_singleton()->sample_set_trim( sample_trim->is_pressed() );
+ _save_export_cfg();
}
@@ -297,6 +298,7 @@ void ProjectExportDialog::_notification(int p_what) {
// _rescan();
_update_platform();
export_mode->select( EditorImportExport::get_singleton()->get_export_filter() );
+ convert_text_scenes->set_pressed( EditorImportExport::get_singleton()->get_convert_text_scenes() );
filters->set_text( EditorImportExport::get_singleton()->get_export_custom_filter() );
if (EditorImportExport::get_singleton()->get_export_filter()!=EditorImportExport::EXPORT_SELECTED)
tree_vb->hide();
@@ -420,6 +422,8 @@ void ProjectExportDialog::_export_mode_changed(int p_idx) {
else
tree_vb->show();
+ EditorImportExport::get_singleton()->set_convert_text_scenes( convert_text_scenes->is_pressed() );
+
_save_export_cfg();
}
@@ -468,20 +472,32 @@ void ProjectExportDialog::_export_action_pck(const String& p_file) {
ERR_PRINT("Invalid platform for export of PCK");
return;
}
- FileAccess *f = FileAccess::open(p_file,FileAccess::WRITE);
- if (!f) {
- error->set_text("Error exporting project PCK! Can't write");
- error->popup_centered_minsize();
- }
- ERR_FAIL_COND(!f);
- Error err = exporter->save_pack(f,false);
- memdelete(f);
+ if (p_file.ends_with(".pck")) {
+ FileAccess *f = FileAccess::open(p_file,FileAccess::WRITE);
+ if (!f) {
+ error->set_text("Error exporting project PCK! Can't write");
+ error->popup_centered_minsize();
+ }
+ ERR_FAIL_COND(!f);
- if (err!=OK) {
- error->set_text("Error exporting project!");
- error->popup_centered_minsize();
- return;
+ Error err = exporter->save_pack(f,false);
+ memdelete(f);
+
+ if (err!=OK) {
+ error->set_text("Error exporting project!");
+ error->popup_centered_minsize();
+ return;
+ }
+ } else if (p_file.ends_with(".zip")) {
+
+ Error err = exporter->save_zip(p_file,false);
+
+ if (err!=OK) {
+ error->set_text("Error exporting project!");
+ error->popup_centered_minsize();
+ return;
+ }
}
}
@@ -1137,6 +1153,7 @@ ProjectExportDialog::ProjectExportDialog(EditorNode *p_editor) {
vb = memnew( VBoxContainer );
vb->set_name("Resources");
sections->add_child(vb);
+
export_mode = memnew( OptionButton );
export_mode->add_item("Export selected resources (including dependencies).");
export_mode->add_item("Export all resources in the project.");
@@ -1145,6 +1162,8 @@ ProjectExportDialog::ProjectExportDialog(EditorNode *p_editor) {
vb->add_margin_child("Export Mode:",export_mode);
+
+
tree_vb = memnew( VBoxContainer );
vb->add_child(tree_vb);
tree_vb->set_v_size_flags(SIZE_EXPAND_FILL);
@@ -1165,6 +1184,10 @@ ProjectExportDialog::ProjectExportDialog(EditorNode *p_editor) {
vb->add_margin_child("Filters to export non-resource files (Comma Separated, ie: *.json, *.txt):",filters);
filters->connect("text_changed",this,"_filters_edited");
+ convert_text_scenes = memnew( CheckButton );
+ convert_text_scenes->set_text("Convert text scenes to binary on export");
+ vb->add_child(convert_text_scenes);
+ convert_text_scenes->connect("toggled",this,"_export_mode_changed");
image_vb = memnew( VBoxContainer );
image_vb->set_name("Images");
@@ -1385,7 +1408,7 @@ ProjectExportDialog::ProjectExportDialog(EditorNode *p_editor) {
add_child(confirm);
confirm->connect("confirmed",this,"_confirmed");
- get_ok()->set_text("Export PCK");
+ get_ok()->set_text("Export PCK/Zip");
expopt="--,Export,Bundle";
@@ -1415,6 +1438,7 @@ ProjectExportDialog::ProjectExportDialog(EditorNode *p_editor) {
pck_export->set_title("Export Project PCK");
pck_export->connect("file_selected", this,"_export_action_pck");
pck_export->add_filter("*.pck ; Data Pack");
+ pck_export->add_filter("*.zip ; Zip");
add_child(pck_export);
button_export = add_button("Export..",!OS::get_singleton()->get_swap_ok_cancel(),"export_pck");