project_settings_editor.h 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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_plugin_settings.h"
  37. #include "editor/editor_sectioned_inspector.h"
  38. #include "editor/import_defaults_editor.h"
  39. #include "editor/localization_editor.h"
  40. #include "editor/shader_globals_editor.h"
  41. #include "scene/gui/tab_container.h"
  42. class FileSystemDock;
  43. class ProjectSettingsEditor : public AcceptDialog {
  44. GDCLASS(ProjectSettingsEditor, AcceptDialog);
  45. static ProjectSettingsEditor *singleton;
  46. ProjectSettings *ps = nullptr;
  47. Timer *timer = nullptr;
  48. TabContainer *tab_container = nullptr;
  49. VBoxContainer *general_editor = nullptr;
  50. SectionedInspector *general_settings_inspector = nullptr;
  51. ActionMapEditor *action_map_editor = nullptr;
  52. LocalizationEditor *localization_editor = nullptr;
  53. EditorAutoloadSettings *autoload_settings = nullptr;
  54. ShaderGlobalsEditor *shaders_global_shader_uniforms_editor = nullptr;
  55. EditorPluginSettings *plugin_settings = nullptr;
  56. LineEdit *search_box = nullptr;
  57. CheckButton *advanced = nullptr;
  58. HBoxContainer *custom_properties = nullptr;
  59. LineEdit *property_box = nullptr;
  60. OptionButton *feature_box = nullptr;
  61. OptionButton *type_box = nullptr;
  62. Button *add_button = nullptr;
  63. Button *del_button = nullptr;
  64. Label *restart_label = nullptr;
  65. TextureRect *restart_icon = nullptr;
  66. PanelContainer *restart_container = nullptr;
  67. Button *restart_close_button = nullptr;
  68. ImportDefaultsEditor *import_defaults_editor = nullptr;
  69. EditorData *data = nullptr;
  70. void _advanced_toggled(bool p_button_pressed);
  71. void _update_advanced(bool p_is_advanced);
  72. void _property_box_changed(const String &p_text);
  73. void _update_property_box();
  74. void _feature_selected(int p_index);
  75. void _select_type(Variant::Type p_type);
  76. virtual void shortcut_input(const Ref<InputEvent> &p_event) override;
  77. String _get_setting_name() const;
  78. void _setting_edited(const String &p_name);
  79. void _setting_selected(const String &p_path);
  80. void _add_setting();
  81. void _delete_setting();
  82. void _editor_restart_request();
  83. void _editor_restart();
  84. void _editor_restart_close();
  85. void _add_feature_overrides();
  86. void _action_added(const String &p_name);
  87. void _action_edited(const String &p_name, const Dictionary &p_action);
  88. void _action_removed(const String &p_name);
  89. void _action_renamed(const String &p_old_name, const String &p_new_name);
  90. void _action_reordered(const String &p_action_name, const String &p_relative_to, bool p_before);
  91. void _update_action_map_editor();
  92. void _update_theme();
  93. void _input_filter_focused();
  94. void _input_filter_unfocused();
  95. protected:
  96. void _notification(int p_what);
  97. static void _bind_methods();
  98. public:
  99. static ProjectSettingsEditor *get_singleton() { return singleton; }
  100. void popup_project_settings(bool p_clear_filter = false);
  101. void set_plugins_page();
  102. void set_general_page(const String &p_category);
  103. void update_plugins();
  104. EditorAutoloadSettings *get_autoload_settings() { return autoload_settings; }
  105. TabContainer *get_tabs() { return tab_container; }
  106. void queue_save();
  107. void connect_filesystem_dock_signals(FileSystemDock *p_fs_dock);
  108. ProjectSettingsEditor(EditorData *p_data);
  109. };
  110. #endif // PROJECT_SETTINGS_EDITOR_H