project_export.h 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. /*************************************************************************/
  2. /* project_export.h */
  3. /*************************************************************************/
  4. /* This file is part of: */
  5. /* GODOT ENGINE */
  6. /* https://godotengine.org */
  7. /*************************************************************************/
  8. /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
  9. /* Copyright (c) 2014-2017 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 "editor/editor_file_dialog.h"
  33. #include "os/dir_access.h"
  34. #include "os/thread.h"
  35. #include "scene/gui/button.h"
  36. #include "scene/gui/control.h"
  37. #include "scene/gui/dialogs.h"
  38. #include "scene/gui/file_dialog.h"
  39. #include "scene/gui/label.h"
  40. #include "scene/gui/link_button.h"
  41. #include "scene/gui/option_button.h"
  42. #include "scene/gui/rich_text_label.h"
  43. #include "scene/gui/tab_container.h"
  44. #include "scene/gui/tree.h"
  45. #include "scene/main/timer.h"
  46. #include "editor/editor_file_system.h"
  47. #include "editor_export.h"
  48. #include "property_editor.h"
  49. #include "scene/gui/slider.h"
  50. class EditorNode;
  51. class ProjectExportDialog : public ConfirmationDialog {
  52. GDCLASS(ProjectExportDialog, ConfirmationDialog);
  53. private:
  54. TabContainer *sections;
  55. MenuButton *add_preset;
  56. Button *delete_preset;
  57. ItemList *presets;
  58. LineEdit *name;
  59. PropertyEditor *parameters;
  60. CheckButton *runnable;
  61. //EditorFileDialog *pck_export;
  62. //EditorFileDialog *file_export;
  63. Button *button_export;
  64. bool updating;
  65. AcceptDialog *error_dialog;
  66. ConfirmationDialog *delete_confirm;
  67. OptionButton *export_filter;
  68. LineEdit *include_filters;
  69. LineEdit *exclude_filters;
  70. Tree *include_files;
  71. Label *include_label;
  72. MarginContainer *include_margin;
  73. StringName editor_icons;
  74. Tree *patches;
  75. Button *patch_export;
  76. int patch_index;
  77. FileDialog *patch_dialog;
  78. ConfirmationDialog *patch_erase;
  79. Button *export_button;
  80. LineEdit *custom_features;
  81. RichTextLabel *custom_feature_display;
  82. Label *export_error;
  83. HBoxContainer *export_templates_error;
  84. void _patch_selected(const String &p_path);
  85. void _patch_deleted();
  86. void _runnable_pressed();
  87. void _update_parameters(const String &p_edited_property);
  88. void _name_changed(const String &p_string);
  89. void _add_preset(int p_platform);
  90. void _edit_preset(int p_index);
  91. void _delete_preset();
  92. void _delete_preset_confirm();
  93. void _update_presets();
  94. void _export_type_changed(int p_which);
  95. void _filter_changed(const String &p_filter);
  96. void _fill_resource_tree();
  97. bool _fill_tree(EditorFileSystemDirectory *p_dir, TreeItem *p_item, Ref<EditorExportPreset> &current, bool p_only_scenes);
  98. void _tree_changed();
  99. void _patch_button_pressed(Object *p_item, int p_column, int p_id);
  100. void _patch_edited();
  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. FileDialog *export_pck_zip;
  105. FileDialog *export_project;
  106. CheckButton *export_debug;
  107. void _open_export_template_manager();
  108. void _export_pck_zip();
  109. void _export_pck_zip_selected(const String &p_path);
  110. void _export_project();
  111. void _export_project_to_path(const String &p_path);
  112. void _update_feature_list();
  113. void _custom_features_changed(const String &p_text);
  114. void _tab_changed(int);
  115. protected:
  116. void _notification(int p_what);
  117. static void _bind_methods();
  118. public:
  119. void popup_export();
  120. ProjectExportDialog();
  121. ~ProjectExportDialog();
  122. };
  123. #endif // PROJECT_EXPORT_SETTINGS_H