project_export.h 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. /*************************************************************************/
  2. /* project_export.h */
  3. /*************************************************************************/
  4. /* This file is part of: */
  5. /* GODOT ENGINE */
  6. /* https://godotengine.org */
  7. /*************************************************************************/
  8. /* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */
  9. /* Copyright (c) 2014-2022 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_H
  31. #define PROJECT_EXPORT_H
  32. #include "scene/gui/dialogs.h"
  33. class CheckBox;
  34. class CheckButton;
  35. class EditorExportPreset;
  36. class EditorFileDialog;
  37. class EditorFileSystemDirectory;
  38. class EditorInspector;
  39. class EditorPropertyPath;
  40. class ItemList;
  41. class MenuButton;
  42. class OptionButton;
  43. class RichTextLabel;
  44. class TabContainer;
  45. class Tree;
  46. class TreeItem;
  47. class ProjectExportDialog : public ConfirmationDialog {
  48. GDCLASS(ProjectExportDialog, ConfirmationDialog);
  49. private:
  50. TabContainer *sections = nullptr;
  51. MenuButton *add_preset = nullptr;
  52. Button *duplicate_preset = nullptr;
  53. Button *delete_preset = nullptr;
  54. ItemList *presets = nullptr;
  55. LineEdit *name = nullptr;
  56. EditorPropertyPath *export_path = nullptr;
  57. EditorInspector *parameters = nullptr;
  58. CheckButton *runnable = nullptr;
  59. Button *button_export = nullptr;
  60. bool updating = false;
  61. RichTextLabel *result_dialog_log = nullptr;
  62. AcceptDialog *result_dialog = nullptr;
  63. ConfirmationDialog *delete_confirm = nullptr;
  64. OptionButton *export_filter = nullptr;
  65. LineEdit *include_filters = nullptr;
  66. LineEdit *exclude_filters = nullptr;
  67. Tree *include_files = nullptr;
  68. Label *include_label = nullptr;
  69. MarginContainer *include_margin = nullptr;
  70. Button *export_button = nullptr;
  71. Button *export_all_button = nullptr;
  72. AcceptDialog *export_all_dialog = nullptr;
  73. LineEdit *custom_features = nullptr;
  74. RichTextLabel *custom_feature_display = nullptr;
  75. OptionButton *script_mode = nullptr;
  76. LineEdit *script_key = nullptr;
  77. Label *script_key_error = nullptr;
  78. Label *export_error = nullptr;
  79. Label *export_warning = nullptr;
  80. HBoxContainer *export_templates_error = nullptr;
  81. String default_filename;
  82. void _runnable_pressed();
  83. void _update_parameters(const String &p_edited_property);
  84. void _name_changed(const String &p_string);
  85. void _export_path_changed(const StringName &p_property, const Variant &p_value, const String &p_field, bool p_changing);
  86. void _add_preset(int p_platform);
  87. void _edit_preset(int p_index);
  88. void _duplicate_preset();
  89. void _delete_preset();
  90. void _delete_preset_confirm();
  91. void _update_export_all();
  92. void _force_update_current_preset_parameters();
  93. void _update_current_preset();
  94. void _update_presets();
  95. void _export_type_changed(int p_which);
  96. void _filter_changed(const String &p_filter);
  97. void _fill_resource_tree();
  98. bool _fill_tree(EditorFileSystemDirectory *p_dir, TreeItem *p_item, Ref<EditorExportPreset> &current, bool p_only_scenes);
  99. void _tree_changed();
  100. void _check_propagated_to_item(Object *p_obj, int column);
  101. Variant get_drag_data_fw(const Point2 &p_point, Control *p_from);
  102. bool can_drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) const;
  103. void drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from);
  104. EditorFileDialog *export_pck_zip = nullptr;
  105. EditorFileDialog *export_project = nullptr;
  106. CheckBox *export_debug = nullptr;
  107. CheckBox *export_pck_zip_debug = nullptr;
  108. CheckButton *enc_pck = nullptr;
  109. CheckButton *enc_directory = nullptr;
  110. LineEdit *enc_in_filters = nullptr;
  111. LineEdit *enc_ex_filters = nullptr;
  112. void _open_export_template_manager();
  113. void _export_pck_zip();
  114. void _export_pck_zip_selected(const String &p_path);
  115. void _validate_export_path(const String &p_path);
  116. void _export_project();
  117. void _export_project_to_path(const String &p_path);
  118. void _export_all_dialog();
  119. void _export_all_dialog_action(const String &p_str);
  120. void _export_all(bool p_debug);
  121. void _update_feature_list();
  122. void _custom_features_changed(const String &p_text);
  123. bool updating_script_key = false;
  124. bool updating_enc_filters = false;
  125. void _enc_pck_changed(bool p_pressed);
  126. void _enc_directory_changed(bool p_pressed);
  127. void _enc_filters_changed(const String &p_text);
  128. void _script_export_mode_changed(int p_mode);
  129. void _script_encryption_key_changed(const String &p_key);
  130. bool _validate_script_encryption_key(const String &p_key);
  131. void _open_key_help_link();
  132. void _tab_changed(int);
  133. protected:
  134. void _theme_changed();
  135. void _notification(int p_what);
  136. static void _bind_methods();
  137. public:
  138. void popup_export();
  139. void set_export_path(const String &p_value);
  140. String get_export_path();
  141. Ref<EditorExportPreset> get_current_preset() const;
  142. ProjectExportDialog();
  143. ~ProjectExportDialog();
  144. };
  145. #endif // PROJECT_EXPORT_H