project_settings_editor.h 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. /**************************************************************************/
  2. /* project_settings_editor.h */
  3. /**************************************************************************/
  4. /* This file is part of: */
  5. /* GODOT ENGINE */
  6. /* https://godotengine.org */
  7. /**************************************************************************/
  8. /* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
  9. /* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
  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/config/project_settings.h"
  33. #include "editor/action_map_editor.h"
  34. #include "editor/editor_autoload_settings.h"
  35. #include "editor/editor_data.h"
  36. #include "editor/editor_sectioned_inspector.h"
  37. #include "editor/group_settings_editor.h"
  38. #include "editor/import_defaults_editor.h"
  39. #include "editor/localization_editor.h"
  40. #include "editor/plugins/editor_plugin_settings.h"
  41. #include "editor/shader_globals_editor.h"
  42. #include "scene/gui/tab_container.h"
  43. class FileSystemDock;
  44. class ProjectSettingsEditor : public AcceptDialog {
  45. GDCLASS(ProjectSettingsEditor, AcceptDialog);
  46. static ProjectSettingsEditor *singleton;
  47. ProjectSettings *ps = nullptr;
  48. Timer *timer = nullptr;
  49. TabContainer *tab_container = nullptr;
  50. VBoxContainer *general_editor = nullptr;
  51. SectionedInspector *general_settings_inspector = nullptr;
  52. ActionMapEditor *action_map_editor = nullptr;
  53. LocalizationEditor *localization_editor = nullptr;
  54. EditorAutoloadSettings *autoload_settings = nullptr;
  55. ShaderGlobalsEditor *shaders_global_shader_uniforms_editor = nullptr;
  56. GroupSettingsEditor *group_settings = nullptr;
  57. EditorPluginSettings *plugin_settings = nullptr;
  58. LineEdit *search_box = nullptr;
  59. CheckButton *advanced = nullptr;
  60. HBoxContainer *custom_properties = nullptr;
  61. LineEdit *property_box = nullptr;
  62. OptionButton *feature_box = nullptr;
  63. OptionButton *type_box = nullptr;
  64. Button *add_button = nullptr;
  65. Button *del_button = nullptr;
  66. Label *restart_label = nullptr;
  67. TextureRect *restart_icon = nullptr;
  68. PanelContainer *restart_container = nullptr;
  69. Button *restart_close_button = nullptr;
  70. ImportDefaultsEditor *import_defaults_editor = nullptr;
  71. EditorData *data = nullptr;
  72. void _advanced_toggled(bool p_button_pressed);
  73. void _update_advanced(bool p_is_advanced);
  74. void _property_box_changed(const String &p_text);
  75. void _update_property_box();
  76. void _feature_selected(int p_index);
  77. void _select_type(Variant::Type p_type);
  78. virtual void shortcut_input(const Ref<InputEvent> &p_event) override;
  79. String _get_setting_name() const;
  80. void _setting_edited(const String &p_name);
  81. void _setting_selected(const String &p_path);
  82. void _add_setting();
  83. void _delete_setting();
  84. void _tabs_tab_changed(int p_tab);
  85. void _focus_current_search_box();
  86. void _focus_current_path_box();
  87. void _editor_restart_request();
  88. void _editor_restart();
  89. void _editor_restart_close();
  90. void _add_feature_overrides();
  91. void _action_added(const String &p_name);
  92. void _action_edited(const String &p_name, const Dictionary &p_action);
  93. void _action_removed(const String &p_name);
  94. void _action_renamed(const String &p_old_name, const String &p_new_name);
  95. void _action_reordered(const String &p_action_name, const String &p_relative_to, bool p_before);
  96. void _update_action_map_editor();
  97. void _update_theme();
  98. protected:
  99. void _notification(int p_what);
  100. static void _bind_methods();
  101. public:
  102. static ProjectSettingsEditor *get_singleton() { return singleton; }
  103. void popup_project_settings(bool p_clear_filter = false);
  104. void set_plugins_page();
  105. void set_general_page(const String &p_category);
  106. void update_plugins();
  107. void init_autoloads();
  108. EditorAutoloadSettings *get_autoload_settings() { return autoload_settings; }
  109. GroupSettingsEditor *get_group_settings() { return group_settings; }
  110. TabContainer *get_tabs() { return tab_container; }
  111. void queue_save();
  112. void connect_filesystem_dock_signals(FileSystemDock *p_fs_dock);
  113. ProjectSettingsEditor(EditorData *p_data);
  114. };
  115. #endif // PROJECT_SETTINGS_EDITOR_H