project_settings_editor.h 4.7 KB

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