project_export.h 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. /*************************************************************************/
  2. /* project_export.h */
  3. /*************************************************************************/
  4. /* This file is part of: */
  5. /* GODOT ENGINE */
  6. /* https://godotengine.org */
  7. /*************************************************************************/
  8. /* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */
  9. /* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */
  10. /* */
  11. /* Permission is hereby granted, free of charge, to any person obtaining */
  12. /* a copy of this software and associated documentation files (the */
  13. /* "Software"), to deal in the Software without restriction, including */
  14. /* without limitation the rights to use, copy, modify, merge, publish, */
  15. /* distribute, sublicense, and/or sell copies of the Software, and to */
  16. /* permit persons to whom the Software is furnished to do so, subject to */
  17. /* the following conditions: */
  18. /* */
  19. /* The above copyright notice and this permission notice shall be */
  20. /* included in all copies or substantial portions of the Software. */
  21. /* */
  22. /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
  23. /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
  24. /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
  25. /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
  26. /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
  27. /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
  28. /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
  29. /*************************************************************************/
  30. #ifndef PROJECT_EXPORT_SETTINGS_H
  31. #define PROJECT_EXPORT_SETTINGS_H
  32. #include "core/io/dir_access.h"
  33. #include "core/os/thread.h"
  34. #include "editor/editor_export.h"
  35. #include "editor/editor_file_dialog.h"
  36. #include "editor/editor_file_system.h"
  37. #include "editor/editor_inspector.h"
  38. #include "editor/editor_properties.h"
  39. #include "scene/gui/button.h"
  40. #include "scene/gui/check_button.h"
  41. #include "scene/gui/control.h"
  42. #include "scene/gui/dialogs.h"
  43. #include "scene/gui/file_dialog.h"
  44. #include "scene/gui/label.h"
  45. #include "scene/gui/link_button.h"
  46. #include "scene/gui/menu_button.h"
  47. #include "scene/gui/option_button.h"
  48. #include "scene/gui/rich_text_label.h"
  49. #include "scene/gui/slider.h"
  50. #include "scene/gui/tab_container.h"
  51. #include "scene/gui/tree.h"
  52. #include "scene/main/timer.h"
  53. class EditorNode;
  54. class ProjectExportDialog : public ConfirmationDialog {
  55. GDCLASS(ProjectExportDialog, ConfirmationDialog);
  56. private:
  57. TabContainer *sections;
  58. MenuButton *add_preset;
  59. Button *duplicate_preset;
  60. Button *delete_preset;
  61. ItemList *presets;
  62. LineEdit *name;
  63. EditorPropertyPath *export_path;
  64. EditorInspector *parameters;
  65. CheckButton *runnable;
  66. Button *button_export;
  67. bool updating;
  68. AcceptDialog *error_dialog;
  69. ConfirmationDialog *delete_confirm;
  70. OptionButton *export_filter;
  71. LineEdit *include_filters;
  72. LineEdit *exclude_filters;
  73. Tree *include_files;
  74. Label *include_label;
  75. MarginContainer *include_margin;
  76. StringName editor_icons;
  77. Button *export_button;
  78. Button *export_all_button;
  79. AcceptDialog *export_all_dialog;
  80. LineEdit *custom_features;
  81. RichTextLabel *custom_feature_display;
  82. OptionButton *script_mode;
  83. LineEdit *script_key;
  84. Label *script_key_error;
  85. Label *export_error;
  86. HBoxContainer *export_templates_error;
  87. String default_filename;
  88. void _runnable_pressed();
  89. void _update_parameters(const String &p_edited_property);
  90. void _name_changed(const String &p_string);
  91. void _export_path_changed(const StringName &p_property, const Variant &p_value, const String &p_field, bool p_changing);
  92. void _add_preset(int p_platform);
  93. void _edit_preset(int p_index);
  94. void _duplicate_preset();
  95. void _delete_preset();
  96. void _delete_preset_confirm();
  97. void _update_export_all();
  98. void _force_update_current_preset_parameters();
  99. void _update_current_preset();
  100. void _update_presets();
  101. void _export_type_changed(int p_which);
  102. void _filter_changed(const String &p_filter);
  103. void _fill_resource_tree();
  104. bool _fill_tree(EditorFileSystemDirectory *p_dir, TreeItem *p_item, Ref<EditorExportPreset> &current, bool p_only_scenes);
  105. void _tree_changed();
  106. void _check_dir_recursive(TreeItem *p_dir, bool p_checked);
  107. void _refresh_parent_checks(TreeItem *p_item);
  108. Variant get_drag_data_fw(const Point2 &p_point, Control *p_from);
  109. bool can_drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) const;
  110. void drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from);
  111. EditorFileDialog *export_pck_zip;
  112. EditorFileDialog *export_project;
  113. CheckBox *export_debug;
  114. CheckBox *export_pck_zip_debug;
  115. CheckButton *enc_pck;
  116. CheckButton *enc_directory;
  117. LineEdit *enc_in_filters;
  118. LineEdit *enc_ex_filters;
  119. void _open_export_template_manager();
  120. void _export_pck_zip();
  121. void _export_pck_zip_selected(const String &p_path);
  122. void _validate_export_path(const String &p_path);
  123. void _export_project();
  124. void _export_project_to_path(const String &p_path);
  125. void _export_all_dialog();
  126. void _export_all_dialog_action(const String &p_str);
  127. void _export_all(bool p_debug);
  128. void _update_feature_list();
  129. void _custom_features_changed(const String &p_text);
  130. bool updating_script_key;
  131. bool updating_enc_filters;
  132. void _enc_pck_changed(bool p_pressed);
  133. void _enc_directory_changed(bool p_pressed);
  134. void _enc_filters_changed(const String &p_text);
  135. void _script_export_mode_changed(int p_mode);
  136. void _script_encryption_key_changed(const String &p_key);
  137. bool _validate_script_encryption_key(const String &p_key);
  138. void _open_key_help_link();
  139. void _tab_changed(int);
  140. protected:
  141. void _theme_changed();
  142. void _notification(int p_what);
  143. static void _bind_methods();
  144. public:
  145. void popup_export();
  146. void set_export_path(const String &p_value);
  147. String get_export_path();
  148. Ref<EditorExportPreset> get_current_preset() const;
  149. ProjectExportDialog();
  150. ~ProjectExportDialog();
  151. };
  152. #endif // PROJECT_EXPORT_SETTINGS_H