2014-02-10 01:10:30 +00:00
|
|
|
/*************************************************************************/
|
|
|
|
/* project_export.h */
|
|
|
|
/*************************************************************************/
|
|
|
|
/* This file is part of: */
|
|
|
|
/* GODOT ENGINE */
|
2017-08-27 12:11:45 +00:00
|
|
|
/* https://godotengine.org */
|
2014-02-10 01:10:30 +00:00
|
|
|
/*************************************************************************/
|
2017-01-01 21:01:57 +00:00
|
|
|
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
|
2017-04-07 22:45:00 +00:00
|
|
|
/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
|
2014-02-10 01:10:30 +00:00
|
|
|
/* */
|
|
|
|
/* Permission is hereby granted, free of charge, to any person obtaining */
|
|
|
|
/* a copy of this software and associated documentation files (the */
|
|
|
|
/* "Software"), to deal in the Software without restriction, including */
|
|
|
|
/* without limitation the rights to use, copy, modify, merge, publish, */
|
|
|
|
/* distribute, sublicense, and/or sell copies of the Software, and to */
|
|
|
|
/* permit persons to whom the Software is furnished to do so, subject to */
|
|
|
|
/* the following conditions: */
|
|
|
|
/* */
|
|
|
|
/* The above copyright notice and this permission notice shall be */
|
|
|
|
/* included in all copies or substantial portions of the Software. */
|
|
|
|
/* */
|
|
|
|
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
|
|
|
|
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
|
|
|
|
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
|
|
|
|
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
|
|
|
|
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
|
|
|
|
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
|
|
|
|
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
|
|
|
/*************************************************************************/
|
|
|
|
#ifndef PROJECT_EXPORT_SETTINGS_H
|
|
|
|
#define PROJECT_EXPORT_SETTINGS_H
|
|
|
|
|
2017-03-18 22:45:45 +00:00
|
|
|
#include "editor/editor_file_dialog.h"
|
2014-02-10 01:10:30 +00:00
|
|
|
#include "os/dir_access.h"
|
|
|
|
#include "os/thread.h"
|
2017-03-18 23:36:26 +00:00
|
|
|
#include "scene/gui/button.h"
|
|
|
|
#include "scene/gui/control.h"
|
|
|
|
#include "scene/gui/dialogs.h"
|
|
|
|
#include "scene/gui/label.h"
|
2014-02-10 01:10:30 +00:00
|
|
|
#include "scene/gui/option_button.h"
|
2017-03-18 23:36:26 +00:00
|
|
|
#include "scene/gui/tab_container.h"
|
|
|
|
#include "scene/gui/tree.h"
|
|
|
|
#include "scene/main/timer.h"
|
2015-01-03 20:24:16 +00:00
|
|
|
|
2017-03-18 22:45:45 +00:00
|
|
|
#include "editor/editor_file_system.h"
|
2014-02-10 01:10:30 +00:00
|
|
|
#include "editor_import_export.h"
|
2017-03-18 23:36:26 +00:00
|
|
|
#include "property_editor.h"
|
|
|
|
#include "scene/gui/slider.h"
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
class EditorNode;
|
|
|
|
|
|
|
|
class ProjectExportDialog : public ConfirmationDialog {
|
2017-03-18 23:36:26 +00:00
|
|
|
OBJ_TYPE(ProjectExportDialog, ConfirmationDialog);
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
enum ExportAction {
|
|
|
|
ACTION_NONE,
|
|
|
|
ACTION_COPY,
|
|
|
|
ACTION_BUNDLE,
|
|
|
|
ACTION_MAX
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
static const char *da_string[ACTION_MAX];
|
|
|
|
|
|
|
|
private:
|
|
|
|
EditorNode *editor;
|
|
|
|
String expopt;
|
|
|
|
|
|
|
|
TabContainer *sections;
|
|
|
|
bool updating_tree;
|
2016-01-27 10:23:12 +00:00
|
|
|
bool pending_update_tree;
|
2014-02-10 01:10:30 +00:00
|
|
|
AcceptDialog *error;
|
|
|
|
ConfirmationDialog *confirm;
|
2016-11-26 14:30:46 +00:00
|
|
|
ConfirmationDialog *confirm_keystore;
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
Button *button_reload;
|
2016-02-04 09:07:08 +00:00
|
|
|
LineEdit *filters, *filters_exclude;
|
2014-02-10 01:10:30 +00:00
|
|
|
HBoxContainer *plat_errors;
|
|
|
|
Label *platform_error_string;
|
|
|
|
|
2015-08-23 23:15:56 +00:00
|
|
|
StringName ei;
|
|
|
|
StringName ot;
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Tree *tree;
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2015-06-06 12:44:38 +00:00
|
|
|
EditorFileDialog *pck_export;
|
|
|
|
EditorFileDialog *file_export;
|
2014-02-10 01:10:30 +00:00
|
|
|
LineEdit *file_export_password;
|
|
|
|
|
2014-02-13 21:03:28 +00:00
|
|
|
Button *button_export;
|
2014-02-10 01:10:30 +00:00
|
|
|
String _delete_attempt;
|
|
|
|
|
|
|
|
bool updating;
|
|
|
|
|
|
|
|
void _tree_changed();
|
|
|
|
void _update_tree();
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
bool _create_tree(TreeItem *p_parent, EditorFileSystemDirectory *p_dir);
|
2014-02-10 01:10:30 +00:00
|
|
|
void _rescan();
|
2017-03-18 23:36:26 +00:00
|
|
|
// void _confirmed();
|
2014-02-10 01:10:30 +00:00
|
|
|
void _scan_finished();
|
|
|
|
|
|
|
|
void _validate_platform();
|
|
|
|
///////////////////
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Tree *platforms;
|
2014-02-10 01:10:30 +00:00
|
|
|
PropertyEditor *platform_options;
|
|
|
|
|
|
|
|
OptionButton *export_mode;
|
2015-12-04 13:18:28 +00:00
|
|
|
CheckButton *convert_text_scenes;
|
2014-02-10 01:10:30 +00:00
|
|
|
VBoxContainer *tree_vb;
|
|
|
|
|
|
|
|
VBoxContainer *image_vb;
|
|
|
|
OptionButton *image_action;
|
|
|
|
HSlider *image_quality;
|
2014-02-26 13:08:17 +00:00
|
|
|
SpinBox *image_shrink;
|
2014-02-10 01:10:30 +00:00
|
|
|
Tree *image_formats;
|
2017-03-18 23:36:26 +00:00
|
|
|
Vector<TreeItem *> formats;
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
LineEdit *group_new_name;
|
|
|
|
HSlider *group_lossy_quality;
|
|
|
|
Label *group_new_name_error;
|
|
|
|
VBoxContainer *group_options;
|
|
|
|
Tree *groups;
|
|
|
|
SpinBox *group_shrink;
|
|
|
|
CheckButton *group_atlas;
|
|
|
|
OptionButton *group_image_action;
|
|
|
|
Button *group_add;
|
|
|
|
Tree *group_images;
|
|
|
|
LineEdit *group_images_filter;
|
|
|
|
Button *atlas_preview;
|
|
|
|
|
|
|
|
AcceptDialog *atlas_preview_dialog;
|
|
|
|
TextureFrame *atlas_preview_frame;
|
|
|
|
|
2014-06-11 13:41:03 +00:00
|
|
|
VBoxContainer *script_vbox;
|
|
|
|
OptionButton *script_mode;
|
|
|
|
LineEdit *script_key;
|
|
|
|
|
2015-11-09 03:49:18 +00:00
|
|
|
VBoxContainer *sample_vbox;
|
|
|
|
OptionButton *sample_mode;
|
|
|
|
SpinBox *sample_max_hz;
|
|
|
|
CheckButton *sample_trim;
|
2014-06-11 13:41:03 +00:00
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
ConfirmationDialog *keystore_create_dialog;
|
|
|
|
EditorFileDialog *keystore_file_dialog;
|
2014-06-11 13:41:03 +00:00
|
|
|
|
2014-02-10 01:10:30 +00:00
|
|
|
void _export_mode_changed(int p_idx);
|
|
|
|
void _prop_edited(String what);
|
|
|
|
|
|
|
|
void _update_platform();
|
|
|
|
void _update_exporter();
|
|
|
|
void _platform_selected();
|
|
|
|
|
|
|
|
void _filters_edited(String what);
|
2016-02-04 09:07:08 +00:00
|
|
|
void _filters_exclude_edited(String what);
|
2014-02-10 01:10:30 +00:00
|
|
|
void _update_group_tree();
|
|
|
|
|
|
|
|
void _image_filter_changed(String);
|
2017-03-18 23:36:26 +00:00
|
|
|
bool _update_group_treef(TreeItem *p_parent, EditorFileSystemDirectory *p_dir, const Set<String> &p_extensions, const String &p_groups, const Map<StringName, int> &p_group_index);
|
2014-02-10 01:10:30 +00:00
|
|
|
void _group_item_edited();
|
|
|
|
void _group_atlas_preview();
|
|
|
|
|
|
|
|
void _quality_edited(float what);
|
|
|
|
void _image_export_edited(int what);
|
2014-02-26 13:08:17 +00:00
|
|
|
void _shrink_edited(float what);
|
|
|
|
|
2015-11-09 03:49:18 +00:00
|
|
|
void _sample_convert_edited(int what);
|
|
|
|
|
2014-02-10 01:10:30 +00:00
|
|
|
void _update_group_list();
|
2017-03-18 23:36:26 +00:00
|
|
|
void _select_group(const String &p_by_name);
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
String _get_selected_group();
|
|
|
|
void _update_group();
|
|
|
|
void _group_changed(Variant v);
|
|
|
|
void _group_selected();
|
|
|
|
void _group_add();
|
|
|
|
void _group_select_all();
|
|
|
|
void _group_select_none();
|
2017-03-18 23:36:26 +00:00
|
|
|
void _group_del(Object *item, int p_column, int p_button);
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2014-06-11 13:41:03 +00:00
|
|
|
bool updating_script;
|
|
|
|
void _update_script();
|
|
|
|
void _script_edited(Variant v);
|
2017-03-18 23:36:26 +00:00
|
|
|
void _export_action(const String &p_file);
|
|
|
|
void _export_action_pck(const String &p_file);
|
2014-02-10 01:10:30 +00:00
|
|
|
void ok_pressed();
|
2017-03-18 23:36:26 +00:00
|
|
|
void custom_action(const String &);
|
|
|
|
LineEdit *_create_keystore_input(Control *container, const String &p_label, const String &name);
|
2016-11-26 14:30:46 +00:00
|
|
|
void _create_android_keystore_window();
|
|
|
|
void _create_android_keystore();
|
2017-03-18 23:36:26 +00:00
|
|
|
bool _check_android_setting(const Ref<EditorExportPlatform> &exporter);
|
|
|
|
void _check_keystore_path(const String &path);
|
|
|
|
void _keystore_dir_selected(const String &path);
|
2016-11-26 14:30:46 +00:00
|
|
|
void _keystore_created();
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
void _save_export_cfg();
|
|
|
|
void _format_toggled();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void _notification(int p_what);
|
|
|
|
static void _bind_methods();
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
public:
|
2014-02-10 01:10:30 +00:00
|
|
|
String get_selected_path() const;
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
Error export_platform(const String &p_platform, const String &p_path, bool p_debug, const String &p_password, bool p_quit_after = false);
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2016-01-27 10:23:12 +00:00
|
|
|
void popup_export();
|
2014-02-10 01:10:30 +00:00
|
|
|
ProjectExportDialog(EditorNode *p_editor);
|
|
|
|
~ProjectExportDialog();
|
|
|
|
};
|
|
|
|
|
|
|
|
class EditorData;
|
|
|
|
|
|
|
|
class ProjectExport : public ConfirmationDialog {
|
2017-03-18 23:36:26 +00:00
|
|
|
OBJ_TYPE(ProjectExport, ConfirmationDialog);
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
EditorData *editor_data;
|
|
|
|
|
|
|
|
AcceptDialog *error;
|
|
|
|
Label *label;
|
|
|
|
OptionButton *export_preset;
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
public:
|
|
|
|
Error export_project(const String &p_preset);
|
2014-02-10 01:10:30 +00:00
|
|
|
void popup_export();
|
|
|
|
|
2017-03-18 23:36:26 +00:00
|
|
|
ProjectExport(EditorData *p_data);
|
2014-02-10 01:10:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // PROJECT_EXPORT_SETTINGS_H
|