Path: blob/master/editor/settings/project_settings_editor.h
9903 views
/**************************************************************************/1/* project_settings_editor.h */2/**************************************************************************/3/* This file is part of: */4/* GODOT ENGINE */5/* https://godotengine.org */6/**************************************************************************/7/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */8/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */9/* */10/* Permission is hereby granted, free of charge, to any person obtaining */11/* a copy of this software and associated documentation files (the */12/* "Software"), to deal in the Software without restriction, including */13/* without limitation the rights to use, copy, modify, merge, publish, */14/* distribute, sublicense, and/or sell copies of the Software, and to */15/* permit persons to whom the Software is furnished to do so, subject to */16/* the following conditions: */17/* */18/* The above copyright notice and this permission notice shall be */19/* included in all copies or substantial portions of the Software. */20/* */21/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */22/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */23/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */24/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */25/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */26/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */27/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */28/**************************************************************************/2930#pragma once3132#include "core/config/project_settings.h"33#include "editor/editor_data.h"34#include "editor/import/import_defaults_editor.h"35#include "editor/inspector/editor_sectioned_inspector.h"36#include "editor/plugins/editor_plugin_settings.h"37#include "editor/scene/group_settings_editor.h"38#include "editor/settings/action_map_editor.h"39#include "editor/settings/editor_autoload_settings.h"40#include "editor/shader/shader_globals_editor.h"41#include "editor/translations/localization_editor.h"42#include "scene/gui/panel_container.h"43#include "scene/gui/tab_container.h"44#include "scene/gui/texture_rect.h"4546class EditorVariantTypeOptionButton;47class FileSystemDock;4849class ProjectSettingsEditor : public AcceptDialog {50GDCLASS(ProjectSettingsEditor, AcceptDialog);5152inline static ProjectSettingsEditor *singleton = nullptr;5354enum {55FEATURE_ALL,56FEATURE_CUSTOM,57FEATURE_FIRST,58};5960ProjectSettings *ps = nullptr;61Timer *timer = nullptr;6263TabContainer *tab_container = nullptr;64VBoxContainer *general_editor = nullptr;65SectionedInspector *general_settings_inspector = nullptr;66ActionMapEditor *action_map_editor = nullptr;67LocalizationEditor *localization_editor = nullptr;68EditorAutoloadSettings *autoload_settings = nullptr;69ShaderGlobalsEditor *shaders_global_shader_uniforms_editor = nullptr;70GroupSettingsEditor *group_settings = nullptr;71EditorPluginSettings *plugin_settings = nullptr;7273LineEdit *search_box = nullptr;74CheckButton *advanced = nullptr;7576HBoxContainer *custom_properties = nullptr;77LineEdit *property_box = nullptr;78OptionButton *feature_box = nullptr;79EditorVariantTypeOptionButton *type_box = nullptr;80Button *add_button = nullptr;81Button *del_button = nullptr;8283Label *restart_label = nullptr;84TextureRect *restart_icon = nullptr;85PanelContainer *restart_container = nullptr;86Button *restart_close_button = nullptr;8788ImportDefaultsEditor *import_defaults_editor = nullptr;89EditorData *data = nullptr;9091bool settings_changed = false;92bool pending_override_notify = false;9394void _on_category_changed(const String &p_new_category);95void _on_editor_override_deleted(const String &p_setting);9697void _advanced_toggled(bool p_button_pressed);98void _update_advanced(bool p_is_advanced);99void _property_box_changed(const String &p_text);100void _update_property_box();101void _feature_selected(int p_index);102void _select_type(Variant::Type p_type);103104virtual void shortcut_input(const Ref<InputEvent> &p_event) override;105106String _get_setting_name() const;107void _setting_edited(const String &p_name);108void _setting_selected(const String &p_path);109void _add_setting();110void _delete_setting();111112void _tabs_tab_changed(int p_tab);113void _focus_current_search_box();114void _focus_current_path_box();115116void _editor_restart_request();117void _editor_restart();118void _editor_restart_close();119120void _add_feature_overrides();121122void _action_added(const String &p_name);123void _action_edited(const String &p_name, const Dictionary &p_action);124void _action_removed(const String &p_name);125void _action_renamed(const String &p_old_name, const String &p_new_name);126void _action_reordered(const String &p_action_name, const String &p_relative_to, bool p_before);127void _update_action_map_editor();128void _update_theme();129void _save();130131protected:132void _notification(int p_what);133static void _bind_methods();134135public:136static ProjectSettingsEditor *get_singleton() { return singleton; }137138void popup_project_settings(bool p_clear_filter = false);139void popup_for_override(const String &p_override);140141void set_plugins_page();142void set_general_page(const String &p_category);143void update_plugins();144void init_autoloads();145146void set_filter(const String &p_filter);147148EditorAutoloadSettings *get_autoload_settings() { return autoload_settings; }149GroupSettingsEditor *get_group_settings() { return group_settings; }150TabContainer *get_tabs() { return tab_container; }151152void queue_save();153void connect_filesystem_dock_signals(FileSystemDock *p_fs_dock);154155ProjectSettingsEditor(EditorData *p_data);156};157158159