Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
godotengine
GitHub Repository: godotengine/godot
Path: blob/master/editor/settings/project_settings_editor.h
9903 views
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
31
#pragma once
32
33
#include "core/config/project_settings.h"
34
#include "editor/editor_data.h"
35
#include "editor/import/import_defaults_editor.h"
36
#include "editor/inspector/editor_sectioned_inspector.h"
37
#include "editor/plugins/editor_plugin_settings.h"
38
#include "editor/scene/group_settings_editor.h"
39
#include "editor/settings/action_map_editor.h"
40
#include "editor/settings/editor_autoload_settings.h"
41
#include "editor/shader/shader_globals_editor.h"
42
#include "editor/translations/localization_editor.h"
43
#include "scene/gui/panel_container.h"
44
#include "scene/gui/tab_container.h"
45
#include "scene/gui/texture_rect.h"
46
47
class EditorVariantTypeOptionButton;
48
class FileSystemDock;
49
50
class ProjectSettingsEditor : public AcceptDialog {
51
GDCLASS(ProjectSettingsEditor, AcceptDialog);
52
53
inline static ProjectSettingsEditor *singleton = nullptr;
54
55
enum {
56
FEATURE_ALL,
57
FEATURE_CUSTOM,
58
FEATURE_FIRST,
59
};
60
61
ProjectSettings *ps = nullptr;
62
Timer *timer = nullptr;
63
64
TabContainer *tab_container = nullptr;
65
VBoxContainer *general_editor = nullptr;
66
SectionedInspector *general_settings_inspector = nullptr;
67
ActionMapEditor *action_map_editor = nullptr;
68
LocalizationEditor *localization_editor = nullptr;
69
EditorAutoloadSettings *autoload_settings = nullptr;
70
ShaderGlobalsEditor *shaders_global_shader_uniforms_editor = nullptr;
71
GroupSettingsEditor *group_settings = nullptr;
72
EditorPluginSettings *plugin_settings = nullptr;
73
74
LineEdit *search_box = nullptr;
75
CheckButton *advanced = nullptr;
76
77
HBoxContainer *custom_properties = nullptr;
78
LineEdit *property_box = nullptr;
79
OptionButton *feature_box = nullptr;
80
EditorVariantTypeOptionButton *type_box = nullptr;
81
Button *add_button = nullptr;
82
Button *del_button = nullptr;
83
84
Label *restart_label = nullptr;
85
TextureRect *restart_icon = nullptr;
86
PanelContainer *restart_container = nullptr;
87
Button *restart_close_button = nullptr;
88
89
ImportDefaultsEditor *import_defaults_editor = nullptr;
90
EditorData *data = nullptr;
91
92
bool settings_changed = false;
93
bool pending_override_notify = false;
94
95
void _on_category_changed(const String &p_new_category);
96
void _on_editor_override_deleted(const String &p_setting);
97
98
void _advanced_toggled(bool p_button_pressed);
99
void _update_advanced(bool p_is_advanced);
100
void _property_box_changed(const String &p_text);
101
void _update_property_box();
102
void _feature_selected(int p_index);
103
void _select_type(Variant::Type p_type);
104
105
virtual void shortcut_input(const Ref<InputEvent> &p_event) override;
106
107
String _get_setting_name() const;
108
void _setting_edited(const String &p_name);
109
void _setting_selected(const String &p_path);
110
void _add_setting();
111
void _delete_setting();
112
113
void _tabs_tab_changed(int p_tab);
114
void _focus_current_search_box();
115
void _focus_current_path_box();
116
117
void _editor_restart_request();
118
void _editor_restart();
119
void _editor_restart_close();
120
121
void _add_feature_overrides();
122
123
void _action_added(const String &p_name);
124
void _action_edited(const String &p_name, const Dictionary &p_action);
125
void _action_removed(const String &p_name);
126
void _action_renamed(const String &p_old_name, const String &p_new_name);
127
void _action_reordered(const String &p_action_name, const String &p_relative_to, bool p_before);
128
void _update_action_map_editor();
129
void _update_theme();
130
void _save();
131
132
protected:
133
void _notification(int p_what);
134
static void _bind_methods();
135
136
public:
137
static ProjectSettingsEditor *get_singleton() { return singleton; }
138
139
void popup_project_settings(bool p_clear_filter = false);
140
void popup_for_override(const String &p_override);
141
142
void set_plugins_page();
143
void set_general_page(const String &p_category);
144
void update_plugins();
145
void init_autoloads();
146
147
void set_filter(const String &p_filter);
148
149
EditorAutoloadSettings *get_autoload_settings() { return autoload_settings; }
150
GroupSettingsEditor *get_group_settings() { return group_settings; }
151
TabContainer *get_tabs() { return tab_container; }
152
153
void queue_save();
154
void connect_filesystem_dock_signals(FileSystemDock *p_fs_dock);
155
156
ProjectSettingsEditor(EditorData *p_data);
157
};
158
159