project_settings_editor.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. /*************************************************************************/
  2. /* project_settings_editor.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_SETTINGS_EDITOR_H
  31. #define PROJECT_SETTINGS_EDITOR_H
  32. #include "core/object/undo_redo.h"
  33. #include "editor/action_map_editor.h"
  34. #include "editor/editor_data.h"
  35. #include "editor/editor_plugin_settings.h"
  36. #include "editor/editor_sectioned_inspector.h"
  37. #include "editor/localization_editor.h"
  38. #include "editor/shader_globals_editor.h"
  39. #include "editor_autoload_settings.h"
  40. #include "scene/gui/tab_container.h"
  41. class ProjectSettingsEditor : public AcceptDialog {
  42. GDCLASS(ProjectSettingsEditor, AcceptDialog);
  43. static ProjectSettingsEditor *singleton;
  44. ProjectSettings *ps;
  45. Timer *timer;
  46. TabContainer *tab_container;
  47. SectionedInspector *inspector;
  48. LocalizationEditor *localization_editor;
  49. EditorAutoloadSettings *autoload_settings;
  50. ShaderGlobalsEditor *shaders_global_variables_editor;
  51. EditorPluginSettings *plugin_settings;
  52. ActionMapEditor *action_map;
  53. HBoxContainer *search_bar;
  54. LineEdit *search_box;
  55. CheckButton *advanced;
  56. HBoxContainer *advanced_bar;
  57. LineEdit *category_box;
  58. LineEdit *property_box;
  59. Button *add_button;
  60. Button *del_button;
  61. OptionButton *type;
  62. OptionButton *feature_override;
  63. ConfirmationDialog *del_confirmation;
  64. Label *restart_label;
  65. TextureRect *restart_icon;
  66. PanelContainer *restart_container;
  67. Button *restart_close_button;
  68. EditorData *data;
  69. UndoRedo *undo_redo;
  70. void _advanced_pressed();
  71. void _update_advanced_bar();
  72. void _text_field_changed(const String &p_text);
  73. void _feature_selected(int p_index);
  74. String _get_setting_name() const;
  75. void _setting_edited(const String &p_name);
  76. void _setting_selected(const String &p_path);
  77. void _add_setting();
  78. void _delete_setting(bool p_confirmed);
  79. void _editor_restart_request();
  80. void _editor_restart();
  81. void _editor_restart_close();
  82. void _add_feature_overrides();
  83. void _action_added(const String &p_name);
  84. void _action_edited(const String &p_name, const Dictionary &p_action);
  85. void _action_removed(const String &p_name);
  86. void _action_renamed(const String &p_old_name, const String &p_new_name);
  87. void _action_reordered(const String &p_action_name, const String &p_relative_to, bool p_before);
  88. void _update_action_map_editor();
  89. ProjectSettingsEditor();
  90. protected:
  91. void _notification(int p_what);
  92. static void _bind_methods();
  93. public:
  94. static ProjectSettingsEditor *get_singleton() { return singleton; }
  95. void popup_project_settings();
  96. void set_plugins_page();
  97. void update_plugins();
  98. EditorAutoloadSettings *get_autoload_settings() { return autoload_settings; }
  99. TabContainer *get_tabs() { return tab_container; }
  100. void queue_save();
  101. ProjectSettingsEditor(EditorData *p_data);
  102. };
  103. #endif // PROJECT_SETTINGS_EDITOR_H