summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
Diffstat (limited to 'editor')
-rw-r--r--editor/animation_track_editor.cpp14
-rw-r--r--editor/array_property_edit.cpp7
-rw-r--r--editor/code_editor.cpp8
-rw-r--r--editor/connections_dialog.cpp2
-rw-r--r--editor/connections_dialog.h2
-rw-r--r--editor/create_dialog.cpp2
-rw-r--r--editor/debugger/editor_debugger_server.h2
-rw-r--r--editor/debugger/editor_performance_profiler.h4
-rw-r--r--editor/debugger/script_editor_debugger.cpp6
-rw-r--r--editor/dependency_editor.cpp16
-rw-r--r--editor/doc_data.cpp128
-rw-r--r--editor/doc_data.h21
-rw-r--r--editor/editor_atlas_packer.h2
-rw-r--r--editor/editor_autoload_settings.cpp8
-rw-r--r--editor/editor_data.cpp2
-rw-r--r--editor/editor_data.h6
-rw-r--r--editor/editor_export.cpp4
-rw-r--r--editor/editor_export.h2
-rw-r--r--editor/editor_feature_profile.h2
-rw-r--r--editor/editor_file_dialog.cpp2
-rw-r--r--editor/editor_file_system.cpp4
-rw-r--r--editor/editor_file_system.h2
-rw-r--r--editor/editor_help_search.h2
-rw-r--r--editor/editor_inspector.cpp2
-rw-r--r--editor/editor_layouts_dialog.cpp2
-rw-r--r--editor/editor_node.cpp24
-rw-r--r--editor/editor_plugin.cpp2
-rw-r--r--editor/editor_plugin.h2
-rw-r--r--editor/editor_plugin_settings.cpp2
-rw-r--r--editor/editor_plugin_settings.h2
-rw-r--r--editor/editor_properties.cpp2
-rw-r--r--editor/editor_properties_array_dict.cpp22
-rw-r--r--editor/editor_resource_preview.cpp4
-rw-r--r--editor/editor_run.cpp2
-rw-r--r--editor/editor_run_script.h2
-rw-r--r--editor/editor_settings.cpp2
-rw-r--r--editor/editor_settings.h6
-rw-r--r--editor/editor_translation_parser.cpp6
-rw-r--r--editor/editor_translation_parser.h4
-rw-r--r--editor/editor_vcs_interface.h4
-rw-r--r--editor/fileserver/editor_file_server.h2
-rw-r--r--editor/filesystem_dock.cpp7
-rw-r--r--editor/find_in_files.h2
-rw-r--r--editor/groups_editor.h2
-rw-r--r--editor/icons/CanvasGroup.svg1
-rw-r--r--editor/icons/CodeEdit.svg1
-rw-r--r--editor/icons/DirectionalLight2D.svg1
-rw-r--r--editor/icons/PointLight2D.svg (renamed from editor/icons/Light2D.svg)0
-rw-r--r--editor/import/collada.h4
-rw-r--r--editor/import/editor_import_plugin.cpp2
-rw-r--r--editor/import/resource_importer_bitmask.cpp2
-rw-r--r--editor/import/resource_importer_bitmask.h2
-rw-r--r--editor/import/resource_importer_csv_translation.cpp4
-rw-r--r--editor/import/resource_importer_image.h2
-rw-r--r--editor/import/resource_importer_layered_texture.h2
-rw-r--r--editor/import/resource_importer_texture.h2
-rw-r--r--editor/import/resource_importer_texture_atlas.h2
-rw-r--r--editor/input_map_editor.h2
-rw-r--r--editor/localization_editor.cpp2
-rw-r--r--editor/localization_editor.h2
-rw-r--r--editor/plugins/animation_blend_space_2d_editor.cpp2
-rw-r--r--editor/plugins/animation_blend_tree_editor_plugin.cpp2
-rw-r--r--editor/plugins/animation_player_editor_plugin.cpp2
-rw-r--r--editor/plugins/animation_state_machine_editor.cpp2
-rw-r--r--editor/plugins/animation_tree_editor_plugin.cpp2
-rw-r--r--editor/plugins/audio_stream_editor_plugin.cpp2
-rw-r--r--editor/plugins/canvas_item_editor_plugin.cpp4
-rw-r--r--editor/plugins/node_3d_editor_plugin.cpp75
-rw-r--r--editor/plugins/node_3d_editor_plugin.h4
-rw-r--r--editor/plugins/resource_preloader_editor_plugin.cpp2
-rw-r--r--editor/plugins/script_editor_plugin.cpp4
-rw-r--r--editor/plugins/script_editor_plugin.h2
-rw-r--r--editor/plugins/sprite_frames_editor_plugin.cpp2
-rw-r--r--editor/plugins/texture_3d_editor_plugin.cpp2
-rw-r--r--editor/plugins/texture_editor_plugin.cpp2
-rw-r--r--editor/plugins/texture_layered_editor_plugin.cpp2
-rw-r--r--editor/plugins/texture_region_editor_plugin.cpp3
-rw-r--r--editor/plugins/tile_map_editor_plugin.cpp10
-rw-r--r--editor/plugins/version_control_editor_plugin.cpp2
-rw-r--r--editor/plugins/visual_shader_editor_plugin.cpp2
-rw-r--r--editor/pot_generator.cpp4
-rw-r--r--editor/pot_generator.h4
-rw-r--r--editor/progress_dialog.cpp2
-rw-r--r--editor/project_export.cpp4
-rw-r--r--editor/project_manager.cpp2
-rw-r--r--editor/project_settings_editor.cpp5
-rw-r--r--editor/project_settings_editor.h2
-rw-r--r--editor/property_editor.cpp10
-rw-r--r--editor/property_selector.cpp4
-rw-r--r--editor/pvrtc_compress.h2
-rw-r--r--editor/quick_open.h2
-rw-r--r--editor/rename_dialog.cpp2
-rw-r--r--editor/rename_dialog.h2
-rw-r--r--editor/reparent_dialog.cpp2
-rw-r--r--editor/scene_tree_dock.cpp2
-rw-r--r--editor/scene_tree_editor.cpp4
-rw-r--r--editor/scene_tree_editor.h2
-rw-r--r--editor/script_create_dialog.cpp6
-rw-r--r--editor/settings_config_dialog.cpp2
-rw-r--r--editor/shader_globals_editor.h2
100 files changed, 383 insertions, 192 deletions
diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp
index 52c984cbc0..6f30d5a492 100644
--- a/editor/animation_track_editor.cpp
+++ b/editor/animation_track_editor.cpp
@@ -228,9 +228,9 @@ public:
if (Variant::can_convert(args[idx].get_type(), t)) {
Variant old = args[idx];
Variant *ptrs[1] = { &old };
- args.write[idx] = Variant::construct(t, (const Variant **)ptrs, 1, err);
+ Variant::construct(t, args.write[idx], (const Variant **)ptrs, 1, err);
} else {
- args.write[idx] = Variant::construct(t, nullptr, 0, err);
+ Variant::construct(t, args.write[idx], nullptr, 0, err);
}
change_notify_deserved = true;
d_new["args"] = args;
@@ -846,9 +846,9 @@ public:
if (Variant::can_convert(args[idx].get_type(), t)) {
Variant old = args[idx];
Variant *ptrs[1] = { &old };
- args.write[idx] = Variant::construct(t, (const Variant **)ptrs, 1, err);
+ Variant::construct(t, args.write[idx], (const Variant **)ptrs, 1, err);
} else {
- args.write[idx] = Variant::construct(t, nullptr, 0, err);
+ Variant::construct(t, args.write[idx], nullptr, 0, err);
}
change_notify_deserved = true;
d_new["args"] = args;
@@ -3751,7 +3751,8 @@ PropertyInfo AnimationTrackEditor::_find_hint_for_track(int p_idx, NodePath &r_b
}
for (int i = 0; i < leftover_path.size() - 1; i++) {
- property_info_base = property_info_base.get_named(leftover_path[i]);
+ bool valid;
+ property_info_base = property_info_base.get_named(leftover_path[i], valid);
}
List<PropertyInfo> pinfo;
@@ -4586,7 +4587,8 @@ void AnimationTrackEditor::_add_method_key(const String &p_method) {
params.push_back(arg);
} else {
Callable::CallError ce;
- Variant arg = Variant::construct(E->get().arguments[i].type, nullptr, 0, ce);
+ Variant arg;
+ Variant::construct(E->get().arguments[i].type, arg, nullptr, 0, ce);
params.push_back(arg);
}
}
diff --git a/editor/array_property_edit.cpp b/editor/array_property_edit.cpp
index 20f947e707..0b6b1ef6a7 100644
--- a/editor/array_property_edit.cpp
+++ b/editor/array_property_edit.cpp
@@ -43,7 +43,7 @@ Variant ArrayPropertyEdit::get_array() const {
Variant arr = o->get(property);
if (!arr.is_array()) {
Callable::CallError ce;
- arr = Variant::construct(default_type, nullptr, 0, ce);
+ Variant::construct(default_type, arr, nullptr, 0, ce);
}
return arr;
}
@@ -107,7 +107,7 @@ bool ArrayPropertyEdit::_set(const StringName &p_name, const Variant &p_value) {
new_type = arr.get(size - 1).get_type();
}
if (new_type != Variant::NIL) {
- init = Variant::construct(new_type, nullptr, 0, ce);
+ Variant::construct(new_type, init, nullptr, 0, ce);
for (int i = size; i < newsize; i++) {
ur->add_do_method(this, "_set_value", i, init);
}
@@ -136,7 +136,8 @@ bool ArrayPropertyEdit::_set(const StringName &p_name, const Variant &p_value) {
Variant value = arr.get(idx);
if (value.get_type() != type && type >= 0 && type < Variant::VARIANT_MAX) {
Callable::CallError ce;
- Variant new_value = Variant::construct(Variant::Type(type), nullptr, 0, ce);
+ Variant new_value;
+ Variant::construct(Variant::Type(type), new_value, nullptr, 0, ce);
UndoRedo *ur = EditorNode::get_undo_redo();
ur->create_action(TTR("Change Array Value Type"));
diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp
index ede6dde239..3182bca0eb 100644
--- a/editor/code_editor.cpp
+++ b/editor/code_editor.cpp
@@ -32,7 +32,7 @@
#include "core/input/input.h"
#include "core/os/keyboard.h"
-#include "core/string_builder.h"
+#include "core/string/string_builder.h"
#include "editor/editor_scale.h"
#include "editor_node.h"
#include "editor_settings.h"
@@ -1138,6 +1138,7 @@ void CodeTextEditor::move_lines_up() {
int from_col = text_editor->get_selection_from_column();
int to_line = text_editor->get_selection_to_line();
int to_column = text_editor->get_selection_to_column();
+ int cursor_line = text_editor->cursor_get_line();
for (int i = from_line; i <= to_line; i++) {
int line_id = i;
@@ -1155,7 +1156,9 @@ void CodeTextEditor::move_lines_up() {
}
int from_line_up = from_line > 0 ? from_line - 1 : from_line;
int to_line_up = to_line > 0 ? to_line - 1 : to_line;
+ int cursor_line_up = cursor_line > 0 ? cursor_line - 1 : cursor_line;
text_editor->select(from_line_up, from_col, to_line_up, to_column);
+ text_editor->cursor_set_line(cursor_line_up);
} else {
int line_id = text_editor->cursor_get_line();
int next_id = line_id - 1;
@@ -1181,6 +1184,7 @@ void CodeTextEditor::move_lines_down() {
int from_col = text_editor->get_selection_from_column();
int to_line = text_editor->get_selection_to_line();
int to_column = text_editor->get_selection_to_column();
+ int cursor_line = text_editor->cursor_get_line();
for (int i = to_line; i >= from_line; i--) {
int line_id = i;
@@ -1198,7 +1202,9 @@ void CodeTextEditor::move_lines_down() {
}
int from_line_down = from_line < text_editor->get_line_count() ? from_line + 1 : from_line;
int to_line_down = to_line < text_editor->get_line_count() ? to_line + 1 : to_line;
+ int cursor_line_down = cursor_line < text_editor->get_line_count() ? cursor_line + 1 : cursor_line;
text_editor->select(from_line_down, from_col, to_line_down, to_column);
+ text_editor->cursor_set_line(cursor_line_down);
} else {
int line_id = text_editor->cursor_get_line();
int next_id = line_id + 1;
diff --git a/editor/connections_dialog.cpp b/editor/connections_dialog.cpp
index d1661fd7b3..320e5d8510 100644
--- a/editor/connections_dialog.cpp
+++ b/editor/connections_dialog.cpp
@@ -30,7 +30,7 @@
#include "connections_dialog.h"
-#include "core/print_string.h"
+#include "core/string/print_string.h"
#include "editor_node.h"
#include "editor_scale.h"
#include "editor_settings.h"
diff --git a/editor/connections_dialog.h b/editor/connections_dialog.h
index 48fdb91f5a..826c25895c 100644
--- a/editor/connections_dialog.h
+++ b/editor/connections_dialog.h
@@ -35,7 +35,7 @@
#ifndef CONNECTIONS_DIALOG_H
#define CONNECTIONS_DIALOG_H
-#include "core/undo_redo.h"
+#include "core/object/undo_redo.h"
#include "editor/editor_inspector.h"
#include "editor/scene_tree_editor.h"
#include "scene/gui/button.h"
diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp
index 1e3dc01112..0f9c9bde7b 100644
--- a/editor/create_dialog.cpp
+++ b/editor/create_dialog.cpp
@@ -30,7 +30,7 @@
#include "create_dialog.h"
-#include "core/class_db.h"
+#include "core/object/class_db.h"
#include "core/os/keyboard.h"
#include "editor_feature_profile.h"
#include "editor_node.h"
diff --git a/editor/debugger/editor_debugger_server.h b/editor/debugger/editor_debugger_server.h
index 10a9a232ab..3ad9d3a9a9 100644
--- a/editor/debugger/editor_debugger_server.h
+++ b/editor/debugger/editor_debugger_server.h
@@ -32,7 +32,7 @@
#define EDITOR_DEBUGGER_CONNECTION_H
#include "core/debugger/remote_debugger_peer.h"
-#include "core/reference.h"
+#include "core/object/reference.h"
class EditorDebuggerServer : public Reference {
public:
diff --git a/editor/debugger/editor_performance_profiler.h b/editor/debugger/editor_performance_profiler.h
index 144dd34103..554a0650b8 100644
--- a/editor/debugger/editor_performance_profiler.h
+++ b/editor/debugger/editor_performance_profiler.h
@@ -31,8 +31,8 @@
#ifndef EDITOR_PERFORMANCE_PROFILER_H
#define EDITOR_PERFORMANCE_PROFILER_H
-#include "core/map.h"
-#include "core/ordered_hash_map.h"
+#include "core/templates/map.h"
+#include "core/templates/ordered_hash_map.h"
#include "main/performance.h"
#include "scene/gui/control.h"
#include "scene/gui/label.h"
diff --git a/editor/debugger/script_editor_debugger.cpp b/editor/debugger/script_editor_debugger.cpp
index 1fca95b6da..248073c5a2 100644
--- a/editor/debugger/script_editor_debugger.cpp
+++ b/editor/debugger/script_editor_debugger.cpp
@@ -30,11 +30,11 @@
#include "script_editor_debugger.h"
+#include "core/config/project_settings.h"
#include "core/debugger/debugger_marshalls.h"
#include "core/debugger/remote_debugger.h"
#include "core/io/marshalls.h"
-#include "core/project_settings.h"
-#include "core/ustring.h"
+#include "core/string/ustring.h"
#include "editor/debugger/editor_network_profiler.h"
#include "editor/debugger/editor_performance_profiler.h"
#include "editor/debugger/editor_profiler.h"
@@ -1023,7 +1023,7 @@ void ScriptEditorDebugger::_method_changed(Object *p_base, const StringName &p_n
for (int i = 0; i < VARIANT_ARG_MAX; i++) {
//no pointers, sorry
- if (argptr[i] && (argptr[i]->get_type() == Variant::OBJECT || argptr[i]->get_type() == Variant::_RID)) {
+ if (argptr[i] && (argptr[i]->get_type() == Variant::OBJECT || argptr[i]->get_type() == Variant::RID)) {
return;
}
}
diff --git a/editor/dependency_editor.cpp b/editor/dependency_editor.cpp
index cbf39c209a..5e87f866d8 100644
--- a/editor/dependency_editor.cpp
+++ b/editor/dependency_editor.cpp
@@ -471,28 +471,28 @@ void DependencyRemoveDialog::ok_pressed() {
// If the file we are deleting for e.g. the main scene, default environment,
// or audio bus layout, we must clear its definition in Project Settings.
- if (files_to_delete[i] == ProjectSettings::get_singleton()->get("application/config/icon")) {
+ if (files_to_delete[i] == String(ProjectSettings::get_singleton()->get("application/config/icon"))) {
ProjectSettings::get_singleton()->set("application/config/icon", "");
}
- if (files_to_delete[i] == ProjectSettings::get_singleton()->get("application/run/main_scene")) {
+ if (files_to_delete[i] == String(ProjectSettings::get_singleton()->get("application/run/main_scene"))) {
ProjectSettings::get_singleton()->set("application/run/main_scene", "");
}
- if (files_to_delete[i] == ProjectSettings::get_singleton()->get("application/boot_splash/image")) {
+ if (files_to_delete[i] == String(ProjectSettings::get_singleton()->get("application/boot_splash/image"))) {
ProjectSettings::get_singleton()->set("application/boot_splash/image", "");
}
- if (files_to_delete[i] == ProjectSettings::get_singleton()->get("rendering/environment/default_environment")) {
+ if (files_to_delete[i] == String(ProjectSettings::get_singleton()->get("rendering/environment/default_environment"))) {
ProjectSettings::get_singleton()->set("rendering/environment/default_environment", "");
}
- if (files_to_delete[i] == ProjectSettings::get_singleton()->get("display/mouse_cursor/custom_image")) {
+ if (files_to_delete[i] == String(ProjectSettings::get_singleton()->get("display/mouse_cursor/custom_image"))) {
ProjectSettings::get_singleton()->set("display/mouse_cursor/custom_image", "");
}
- if (files_to_delete[i] == ProjectSettings::get_singleton()->get("gui/theme/custom")) {
+ if (files_to_delete[i] == String(ProjectSettings::get_singleton()->get("gui/theme/custom"))) {
ProjectSettings::get_singleton()->set("gui/theme/custom", "");
}
- if (files_to_delete[i] == ProjectSettings::get_singleton()->get("gui/theme/custom_font")) {
+ if (files_to_delete[i] == String(ProjectSettings::get_singleton()->get("gui/theme/custom_font"))) {
ProjectSettings::get_singleton()->set("gui/theme/custom_font", "");
}
- if (files_to_delete[i] == ProjectSettings::get_singleton()->get("audio/default_bus_layout")) {
+ if (files_to_delete[i] == String(ProjectSettings::get_singleton()->get("audio/default_bus_layout"))) {
ProjectSettings::get_singleton()->set("audio/default_bus_layout", "");
}
diff --git a/editor/doc_data.cpp b/editor/doc_data.cpp
index 791b49319a..8504d61d2f 100644
--- a/editor/doc_data.cpp
+++ b/editor/doc_data.cpp
@@ -30,13 +30,13 @@
#include "doc_data.h"
-#include "core/engine.h"
-#include "core/global_constants.h"
+#include "core/config/engine.h"
+#include "core/config/project_settings.h"
+#include "core/core_constants.h"
#include "core/io/compression.h"
#include "core/io/marshalls.h"
+#include "core/object/script_language.h"
#include "core/os/dir_access.h"
-#include "core/project_settings.h"
-#include "core/script_language.h"
#include "core/version.h"
#include "scene/resources/theme.h"
@@ -561,18 +561,87 @@ void DocData::generate(bool p_basic_types) {
c.name = cname;
Callable::CallError cerror;
- Variant v = Variant::construct(Variant::Type(i), nullptr, 0, cerror);
+ Variant v;
+ Variant::construct(Variant::Type(i), v, nullptr, 0, cerror);
List<MethodInfo> method_list;
v.get_method_list(&method_list);
method_list.sort();
Variant::get_constructor_list(Variant::Type(i), &method_list);
+ for (int j = 0; j < Variant::OP_AND; j++) { // Showing above 'and' is pretty confusing and there are a lot of variations.
+ for (int k = 0; k < Variant::VARIANT_MAX; k++) {
+ Variant::Type rt = Variant::get_operator_return_type(Variant::Operator(j), Variant::Type(i), Variant::Type(k));
+ if (rt != Variant::NIL) { // Has operator.
+ // Skip String % operator as it's registered separately for each Variant arg type,
+ // we'll add it manually below.
+ if (i == Variant::STRING && Variant::Operator(j) == Variant::OP_MODULE) {
+ continue;
+ }
+ MethodInfo mi;
+ mi.name = "operator " + Variant::get_operator_name(Variant::Operator(j));
+ mi.return_val.type = rt;
+ if (k != Variant::NIL) {
+ PropertyInfo arg;
+ arg.name = "right";
+ arg.type = Variant::Type(k);
+ mi.arguments.push_back(arg);
+ }
+ method_list.push_back(mi);
+ }
+ }
+ }
+
+ if (i == Variant::STRING) {
+ // We skipped % operator above, and we register it manually once for Variant arg type here.
+ MethodInfo mi;
+ mi.name = "operator %";
+ mi.return_val.type = Variant::STRING;
+
+ PropertyInfo arg;
+ arg.name = "right";
+ arg.type = Variant::NIL;
+ arg.usage = PROPERTY_USAGE_NIL_IS_VARIANT;
+ mi.arguments.push_back(arg);
+
+ method_list.push_back(mi);
+ }
+
+ if (Variant::is_keyed(Variant::Type(i))) {
+ MethodInfo mi;
+ mi.name = "operator []";
+ mi.return_val.type = Variant::NIL;
+ mi.return_val.usage = PROPERTY_USAGE_NIL_IS_VARIANT;
+
+ PropertyInfo arg;
+ arg.name = "key";
+ arg.type = Variant::NIL;
+ arg.usage = PROPERTY_USAGE_NIL_IS_VARIANT;
+ mi.arguments.push_back(arg);
+
+ method_list.push_back(mi);
+ } else if (Variant::has_indexing(Variant::Type(i))) {
+ MethodInfo mi;
+ mi.name = "operator []";
+ mi.return_val.type = Variant::get_indexed_element_type(Variant::Type(i));
+ PropertyInfo arg;
+ arg.name = "index";
+ arg.type = Variant::INT;
+ mi.arguments.push_back(arg);
+
+ method_list.push_back(mi);
+ }
+
for (List<MethodInfo>::Element *E = method_list.front(); E; E = E->next()) {
MethodInfo &mi = E->get();
MethodDoc method;
method.name = mi.name;
+ if (method.name == cname) {
+ method.qualifiers = "constructor";
+ } else if (method.name.begins_with("operator")) {
+ method.qualifiers = "operator";
+ }
for (int j = 0; j < mi.arguments.size(); j++) {
PropertyInfo arginfo = mi.arguments[j];
@@ -634,16 +703,16 @@ void DocData::generate(bool p_basic_types) {
ClassDoc &c = class_list[cname];
c.name = cname;
- for (int i = 0; i < GlobalConstants::get_global_constant_count(); i++) {
+ for (int i = 0; i < CoreConstants::get_global_constant_count(); i++) {
ConstantDoc cd;
- cd.name = GlobalConstants::get_global_constant_name(i);
- if (!GlobalConstants::get_ignore_value_in_docs(i)) {
- cd.value = itos(GlobalConstants::get_global_constant_value(i));
+ cd.name = CoreConstants::get_global_constant_name(i);
+ if (!CoreConstants::get_ignore_value_in_docs(i)) {
+ cd.value = itos(CoreConstants::get_global_constant_value(i));
cd.is_value_valid = true;
} else {
cd.is_value_valid = false;
}
- cd.enumeration = GlobalConstants::get_global_constant_enum(i);
+ cd.enumeration = CoreConstants::get_global_constant_enum(i);
c.constants.push_back(cd);
}
@@ -667,6 +736,43 @@ void DocData::generate(bool p_basic_types) {
}
c.properties.push_back(pd);
}
+
+ List<StringName> utility_functions;
+ Variant::get_utility_function_list(&utility_functions);
+ utility_functions.sort_custom<StringName::AlphCompare>();
+ for (List<StringName>::Element *E = utility_functions.front(); E; E = E->next()) {
+ MethodDoc md;
+ md.name = E->get();
+ //return
+ if (Variant::has_utility_function_return_value(E->get())) {
+ PropertyInfo pi;
+ pi.type = Variant::get_utility_function_return_type(E->get());
+ if (pi.type == Variant::NIL) {
+ pi.usage = PROPERTY_USAGE_NIL_IS_VARIANT;
+ }
+ DocData::ArgumentDoc ad;
+ argument_doc_from_arginfo(ad, pi);
+ md.return_type = ad.type;
+ }
+
+ if (Variant::is_utility_function_vararg(E->get())) {
+ md.qualifiers = "vararg";
+ } else {
+ for (int i = 0; i < Variant::get_utility_function_argument_count(E->get()); i++) {
+ PropertyInfo pi;
+ pi.type = Variant::get_utility_function_argument_type(E->get(), i);
+ pi.name = Variant::get_utility_function_argument_name(E->get(), i);
+ if (pi.type == Variant::NIL) {
+ pi.usage = PROPERTY_USAGE_NIL_IS_VARIANT;
+ }
+ DocData::ArgumentDoc ad;
+ argument_doc_from_arginfo(ad, pi);
+ md.arguments.push_back(ad);
+ }
+ }
+
+ c.methods.push_back(md);
+ }
}
// Built-in script reference.
@@ -1096,7 +1202,7 @@ Error DocData::save_classes(const String &p_default_path, const Map<String, Stri
qualifiers += " qualifiers=\"" + m.qualifiers.xml_escape() + "\"";
}
- _write_string(f, 2, "<method name=\"" + m.name + "\"" + qualifiers + ">");
+ _write_string(f, 2, "<method name=\"" + m.name.xml_escape() + "\"" + qualifiers + ">");
if (m.return_type != "") {
String enum_text;
diff --git a/editor/doc_data.h b/editor/doc_data.h
index a35cfb59c7..2cb475d137 100644
--- a/editor/doc_data.h
+++ b/editor/doc_data.h
@@ -32,8 +32,8 @@
#define DOC_DATA_H
#include "core/io/xml_parser.h"
-#include "core/map.h"
-#include "core/variant.h"
+#include "core/templates/map.h"
+#include "core/variant/variant.h"
class DocData {
public:
@@ -43,6 +43,9 @@ public:
String enumeration;
String default_value;
bool operator<(const ArgumentDoc &p_arg) const {
+ if (name == p_arg.name) {
+ return type < p_arg.type;
+ }
return name < p_arg.name;
}
};
@@ -55,6 +58,20 @@ public:
String description;
Vector<ArgumentDoc> arguments;
bool operator<(const MethodDoc &p_method) const {
+ if (name == p_method.name) {
+ // Must be a constructor since there is no overloading.
+ // We want this arbitrary order for a class "Foo":
+ // - 1. Default constructor: Foo()
+ // - 2. Copy constructor: Foo(Foo)
+ // - 3+. Other constructors Foo(Bar, ...) based on first argument's name
+ if (arguments.size() == 0 || p_method.arguments.size() == 0) { // 1.
+ return arguments.size() < p_method.arguments.size();
+ }
+ if (arguments[0].type == return_type || p_method.arguments[0].type == p_method.return_type) { // 2.
+ return (arguments[0].type == return_type) || (p_method.arguments[0].type != p_method.return_type);
+ }
+ return arguments[0] < p_method.arguments[0];
+ }
return name < p_method.name;
}
};
diff --git a/editor/editor_atlas_packer.h b/editor/editor_atlas_packer.h
index 33dbe47efb..52ac9524ae 100644
--- a/editor/editor_atlas_packer.h
+++ b/editor/editor_atlas_packer.h
@@ -33,7 +33,7 @@
#include "core/math/vector2.h"
-#include "core/vector.h"
+#include "core/templates/vector.h"
#include "scene/resources/bit_map.h"
class EditorAtlasPacker {
diff --git a/editor/editor_autoload_settings.cpp b/editor/editor_autoload_settings.cpp
index 5d101ff2c2..2251440544 100644
--- a/editor/editor_autoload_settings.cpp
+++ b/editor/editor_autoload_settings.cpp
@@ -30,8 +30,8 @@
#include "editor_autoload_settings.h"
-#include "core/global_constants.h"
-#include "core/project_settings.h"
+#include "core/config/project_settings.h"
+#include "core/core_constants.h"
#include "editor_node.h"
#include "editor_scale.h"
#include "project_settings_editor.h"
@@ -89,8 +89,8 @@ bool EditorAutoloadSettings::_autoload_name_is_valid(const String &p_name, Strin
}
}
- for (int i = 0; i < GlobalConstants::get_global_constant_count(); i++) {
- if (GlobalConstants::get_global_constant_name(i) == p_name) {
+ for (int i = 0; i < CoreConstants::get_global_constant_count(); i++) {
+ if (CoreConstants::get_global_constant_name(i) == p_name) {
if (r_error) {
*r_error = TTR("Invalid name.") + "\n" + TTR("Must not collide with an existing global constant name.");
}
diff --git a/editor/editor_data.cpp b/editor/editor_data.cpp
index 1002c4917b..975405aec4 100644
--- a/editor/editor_data.cpp
+++ b/editor/editor_data.cpp
@@ -30,10 +30,10 @@
#include "editor_data.h"
+#include "core/config/project_settings.h"
#include "core/io/resource_loader.h"
#include "core/os/dir_access.h"
#include "core/os/file_access.h"
-#include "core/project_settings.h"
#include "editor_node.h"
#include "editor_settings.h"
#include "scene/resources/packed_scene.h"
diff --git a/editor/editor_data.h b/editor/editor_data.h
index 8083dde09c..5037a6acb4 100644
--- a/editor/editor_data.h
+++ b/editor/editor_data.h
@@ -31,9 +31,9 @@
#ifndef EDITOR_DATA_H
#define EDITOR_DATA_H
-#include "core/list.h"
-#include "core/pair.h"
-#include "core/undo_redo.h"
+#include "core/object/undo_redo.h"
+#include "core/templates/list.h"
+#include "core/templates/pair.h"
#include "editor/editor_plugin.h"
#include "editor/plugins/script_editor_plugin.h"
#include "scene/resources/texture.h"
diff --git a/editor/editor_export.cpp b/editor/editor_export.cpp
index 0f86385031..97800fe961 100644
--- a/editor/editor_export.cpp
+++ b/editor/editor_export.cpp
@@ -30,6 +30,7 @@
#include "editor_export.h"
+#include "core/config/project_settings.h"
#include "core/crypto/crypto_core.h"
#include "core/io/config_file.h"
#include "core/io/file_access_encrypted.h"
@@ -37,10 +38,9 @@
#include "core/io/resource_loader.h"
#include "core/io/resource_saver.h"
#include "core/io/zip_io.h"
+#include "core/object/script_language.h"
#include "core/os/dir_access.h"
#include "core/os/file_access.h"
-#include "core/project_settings.h"
-#include "core/script_language.h"
#include "core/version.h"
#include "editor/editor_file_system.h"
#include "editor/plugins/script_editor_plugin.h"
diff --git a/editor/editor_export.h b/editor/editor_export.h
index 55728f0c94..09feaad255 100644
--- a/editor/editor_export.h
+++ b/editor/editor_export.h
@@ -31,8 +31,8 @@
#ifndef EDITOR_EXPORT_H
#define EDITOR_EXPORT_H
+#include "core/io/resource.h"
#include "core/os/dir_access.h"
-#include "core/resource.h"
#include "scene/main/node.h"
#include "scene/main/timer.h"
#include "scene/resources/texture.h"
diff --git a/editor/editor_feature_profile.h b/editor/editor_feature_profile.h
index d0d08c61f4..0f066b8f4a 100644
--- a/editor/editor_feature_profile.h
+++ b/editor/editor_feature_profile.h
@@ -31,8 +31,8 @@
#ifndef EDITOR_FEATURE_PROFILE_H
#define EDITOR_FEATURE_PROFILE_H
+#include "core/object/reference.h"
#include "core/os/file_access.h"
-#include "core/reference.h"
#include "editor/editor_file_dialog.h"
#include "scene/gui/dialogs.h"
#include "scene/gui/option_button.h"
diff --git a/editor/editor_file_dialog.cpp b/editor/editor_file_dialog.cpp
index 2140b6bd13..e3923a48c5 100644
--- a/editor/editor_file_dialog.cpp
+++ b/editor/editor_file_dialog.cpp
@@ -33,7 +33,7 @@
#include "core/os/file_access.h"
#include "core/os/keyboard.h"
#include "core/os/os.h"
-#include "core/print_string.h"
+#include "core/string/print_string.h"
#include "dependency_editor.h"
#include "editor_file_system.h"
#include "editor_resource_preview.h"
diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp
index 3fcc06526b..c66bc9b3fa 100644
--- a/editor/editor_file_system.cpp
+++ b/editor/editor_file_system.cpp
@@ -30,13 +30,13 @@
#include "editor_file_system.h"
+#include "core/config/project_settings.h"
#include "core/io/resource_importer.h"
#include "core/io/resource_loader.h"
#include "core/io/resource_saver.h"
#include "core/os/file_access.h"
#include "core/os/os.h"
-#include "core/project_settings.h"
-#include "core/variant_parser.h"
+#include "core/variant/variant_parser.h"
#include "editor_node.h"
#include "editor_resource_preview.h"
#include "editor_settings.h"
diff --git a/editor/editor_file_system.h b/editor/editor_file_system.h
index 02315d76f3..d5ae046c36 100644
--- a/editor/editor_file_system.h
+++ b/editor/editor_file_system.h
@@ -34,7 +34,7 @@
#include "core/os/dir_access.h"
#include "core/os/thread.h"
#include "core/os/thread_safe.h"
-#include "core/set.h"
+#include "core/templates/set.h"
#include "scene/main/node.h"
class FileAccess;
diff --git a/editor/editor_help_search.h b/editor/editor_help_search.h
index b37f74fd7e..f1aab6cc81 100644
--- a/editor/editor_help_search.h
+++ b/editor/editor_help_search.h
@@ -31,7 +31,7 @@
#ifndef EDITOR_HELP_SEARCH_H
#define EDITOR_HELP_SEARCH_H
-#include "core/ordered_hash_map.h"
+#include "core/templates/ordered_hash_map.h"
#include "editor/code_editor.h"
#include "editor/editor_help.h"
#include "editor/editor_plugin.h"
diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp
index 1837b23a0b..371100652f 100644
--- a/editor/editor_inspector.cpp
+++ b/editor/editor_inspector.cpp
@@ -2278,7 +2278,7 @@ void EditorInspector::_property_checked(const String &p_path, bool p_checked) {
for (List<PropertyInfo>::Element *E = pinfo.front(); E; E = E->next()) {
if (E->get().name == p_path) {
Callable::CallError ce;
- to_create = Variant::construct(E->get().type, nullptr, 0, ce);
+ Variant::construct(E->get().type, to_create, nullptr, 0, ce);
break;
}
}
diff --git a/editor/editor_layouts_dialog.cpp b/editor/editor_layouts_dialog.cpp
index 14478b1386..c50fe81217 100644
--- a/editor/editor_layouts_dialog.cpp
+++ b/editor/editor_layouts_dialog.cpp
@@ -30,8 +30,8 @@
#include "editor_layouts_dialog.h"
-#include "core/class_db.h"
#include "core/io/config_file.h"
+#include "core/object/class_db.h"
#include "core/os/keyboard.h"
#include "editor/editor_settings.h"
#include "scene/gui/item_list.h"
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index 3a9715d1ab..c6613cdf63 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -30,21 +30,21 @@
#include "editor_node.h"
-#include "core/bind/core_bind.h"
-#include "core/class_db.h"
+#include "core/config/project_settings.h"
+#include "core/core_bind.h"
#include "core/input/input.h"
#include "core/io/config_file.h"
#include "core/io/image_loader.h"
#include "core/io/resource_loader.h"
#include "core/io/resource_saver.h"
#include "core/io/stream_peer_ssl.h"
-#include "core/message_queue.h"
+#include "core/object/class_db.h"
+#include "core/object/message_queue.h"
#include "core/os/file_access.h"
#include "core/os/keyboard.h"
#include "core/os/os.h"
-#include "core/print_string.h"
-#include "core/project_settings.h"
-#include "core/translation.h"
+#include "core/string/print_string.h"
+#include "core/string/translation.h"
#include "core/version.h"
#include "main/main.h"
#include "scene/gui/center_container.h"
@@ -2705,10 +2705,14 @@ void EditorNode::_screenshot(bool p_use_utc) {
}
void EditorNode::_save_screenshot(NodePath p_path) {
- SubViewport *viewport = Object::cast_to<SubViewport>(EditorInterface::get_singleton()->get_editor_viewport()->get_viewport());
- viewport->set_clear_mode(SubViewport::CLEAR_MODE_ONLY_NEXT_FRAME);
- Ref<Image> img = viewport->get_texture()->get_data();
- viewport->set_clear_mode(SubViewport::CLEAR_MODE_ALWAYS);
+ Control *editor_viewport = EditorInterface::get_singleton()->get_editor_viewport();
+ ERR_FAIL_COND_MSG(!editor_viewport, "Cannot get editor viewport.");
+ Viewport *viewport = editor_viewport->get_viewport();
+ ERR_FAIL_COND_MSG(!viewport, "Cannot get editor viewport.");
+ Ref<ViewportTexture> texture = viewport->get_texture();
+ ERR_FAIL_COND_MSG(texture.is_null(), "Cannot get editor viewport texture.");
+ Ref<Image> img = texture->get_data();
+ ERR_FAIL_COND_MSG(img.is_null(), "Cannot get editor viewport texture image.");
Error error = img->save_png(p_path);
ERR_FAIL_COND_MSG(error != OK, "Cannot save screenshot to file '" + p_path + "'.");
}
diff --git a/editor/editor_plugin.cpp b/editor/editor_plugin.cpp
index e330713cfb..49d8e58955 100644
--- a/editor/editor_plugin.cpp
+++ b/editor/editor_plugin.cpp
@@ -866,6 +866,8 @@ void EditorPlugin::_bind_methods() {
ClassDB::add_virtual_method(get_class_static(), MethodInfo("forward_canvas_draw_over_viewport", PropertyInfo(Variant::OBJECT, "overlay", PROPERTY_HINT_RESOURCE_TYPE, "Control")));
ClassDB::add_virtual_method(get_class_static(), MethodInfo("forward_canvas_force_draw_over_viewport", PropertyInfo(Variant::OBJECT, "overlay", PROPERTY_HINT_RESOURCE_TYPE, "Control")));
ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::BOOL, "forward_spatial_gui_input", PropertyInfo(Variant::OBJECT, "camera", PROPERTY_HINT_RESOURCE_TYPE, "Camera3D"), PropertyInfo(Variant::OBJECT, "event", PROPERTY_HINT_RESOURCE_TYPE, "InputEvent")));
+ ClassDB::add_virtual_method(get_class_static(), MethodInfo("forward_spatial_draw_over_viewport", PropertyInfo(Variant::OBJECT, "overlay", PROPERTY_HINT_RESOURCE_TYPE, "Control")));
+ ClassDB::add_virtual_method(get_class_static(), MethodInfo("forward_spatial_force_draw_over_viewport", PropertyInfo(Variant::OBJECT, "overlay", PROPERTY_HINT_RESOURCE_TYPE, "Control")));
ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::STRING, "get_plugin_name"));
ClassDB::add_virtual_method(get_class_static(), MethodInfo(PropertyInfo(Variant::OBJECT, "icon", PROPERTY_HINT_RESOURCE_TYPE, "Texture2D"), "get_plugin_icon"));
ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::BOOL, "has_main_screen"));
diff --git a/editor/editor_plugin.h b/editor/editor_plugin.h
index dd3bf08678..11063066d6 100644
--- a/editor/editor_plugin.h
+++ b/editor/editor_plugin.h
@@ -32,7 +32,7 @@
#define EDITOR_PLUGIN_H
#include "core/io/config_file.h"
-#include "core/undo_redo.h"
+#include "core/object/undo_redo.h"
#include "editor/debugger/editor_debugger_node.h"
#include "editor/editor_inspector.h"
#include "editor/editor_translation_parser.h"
diff --git a/editor/editor_plugin_settings.cpp b/editor/editor_plugin_settings.cpp
index fe49198e8f..f984f48c1c 100644
--- a/editor/editor_plugin_settings.cpp
+++ b/editor/editor_plugin_settings.cpp
@@ -30,10 +30,10 @@
#include "editor_plugin_settings.h"
+#include "core/config/project_settings.h"
#include "core/io/config_file.h"
#include "core/os/file_access.h"
#include "core/os/main_loop.h"
-#include "core/project_settings.h"
#include "editor_node.h"
#include "editor_scale.h"
#include "scene/gui/margin_container.h"
diff --git a/editor/editor_plugin_settings.h b/editor/editor_plugin_settings.h
index ceb00eb12f..0b61e28449 100644
--- a/editor/editor_plugin_settings.h
+++ b/editor/editor_plugin_settings.h
@@ -31,7 +31,7 @@
#ifndef EDITORPLUGINSETTINGS_H
#define EDITORPLUGINSETTINGS_H
-#include "core/undo_redo.h"
+#include "core/object/undo_redo.h"
#include "editor/plugin_config_dialog.h"
#include "editor_data.h"
#include "property_editor.h"
diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp
index 9e7ddd9fac..1443302f3f 100644
--- a/editor/editor_properties.cpp
+++ b/editor/editor_properties.cpp
@@ -3645,7 +3645,7 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ
add_property_editor(p_path, editor);
} break;
- case Variant::_RID: {
+ case Variant::RID: {
EditorPropertyRID *editor = memnew(EditorPropertyRID);
add_property_editor(p_path, editor);
} break;
diff --git a/editor/editor_properties_array_dict.cpp b/editor/editor_properties_array_dict.cpp
index 51fac6acec..56fbfbd0c2 100644
--- a/editor/editor_properties_array_dict.cpp
+++ b/editor/editor_properties_array_dict.cpp
@@ -186,7 +186,7 @@ void EditorPropertyArray::_change_type_menu(int p_index) {
Variant value;
Callable::CallError ce;
- value = Variant::construct(Variant::Type(p_index), nullptr, 0, ce);
+ Variant::construct(Variant::Type(p_index), value, nullptr, 0, ce);
Variant array = object->get_array();
array.set(changing_type_idx, value);
@@ -445,7 +445,7 @@ void EditorPropertyArray::drop_data_fw(const Point2 &p_point, const Variant &p_d
// Handle the case where array is not initialised yet
if (!array.is_array()) {
Callable::CallError ce;
- array = Variant::construct(array_type, nullptr, 0, ce);
+ Variant::construct(array_type, array, nullptr, 0, ce);
}
// Loop the file array and add to existing array
@@ -491,7 +491,7 @@ void EditorPropertyArray::_edit_pressed() {
Variant array = get_edited_object()->get(get_edited_property());
if (!array.is_array()) {
Callable::CallError ce;
- array = Variant::construct(array_type, nullptr, 0, ce);
+ Variant::construct(array_type, array, nullptr, 0, ce);
get_edited_object()->set(get_edited_property(), array);
}
@@ -524,7 +524,9 @@ void EditorPropertyArray::_length_changed(double p_page) {
for (int i = previous_size; i < size; i++) {
if (array.get(i).get_type() == Variant::NIL) {
Callable::CallError ce;
- array.set(i, Variant::construct(subtype, nullptr, 0, ce));
+ Variant r;
+ Variant::construct(subtype, r, nullptr, 0, ce);
+ array.set(i, r);
}
}
}
@@ -534,7 +536,9 @@ void EditorPropertyArray::_length_changed(double p_page) {
// Pool*Array don't initialize their elements, have to do it manually
for (int i = previous_size; i < size; i++) {
Callable::CallError ce;
- array.set(i, Variant::construct(array.get(i).get_type(), nullptr, 0, ce));
+ Variant r;
+ Variant::construct(array.get(i).get_type(), r, nullptr, 0, ce);
+ array.set(i, r);
}
}
@@ -657,7 +661,7 @@ void EditorPropertyDictionary::_change_type_menu(int p_index) {
if (changing_type_idx < 0) {
Variant value;
Callable::CallError ce;
- value = Variant::construct(Variant::Type(p_index), nullptr, 0, ce);
+ Variant::construct(Variant::Type(p_index), value, nullptr, 0, ce);
if (changing_type_idx == -1) {
object->set_new_item_key(value);
} else {
@@ -672,7 +676,7 @@ void EditorPropertyDictionary::_change_type_menu(int p_index) {
if (p_index < Variant::VARIANT_MAX) {
Variant value;
Callable::CallError ce;
- value = Variant::construct(Variant::Type(p_index), nullptr, 0, ce);
+ Variant::construct(Variant::Type(p_index), value, nullptr, 0, ce);
Variant key = dict.get_key_at_index(changing_type_idx);
dict[key] = value;
} else {
@@ -888,7 +892,7 @@ void EditorPropertyDictionary::update_property() {
prop = memnew(EditorPropertyNodePath);
} break;
- case Variant::_RID: {
+ case Variant::RID: {
prop = memnew(EditorPropertyRID);
} break;
@@ -1044,7 +1048,7 @@ void EditorPropertyDictionary::_edit_pressed() {
Variant prop_val = get_edited_object()->get(get_edited_property());
if (prop_val.get_type() == Variant::NIL) {
Callable::CallError ce;
- prop_val = Variant::construct(Variant::DICTIONARY, nullptr, 0, ce);
+ Variant::construct(Variant::DICTIONARY, prop_val, nullptr, 0, ce);
get_edited_object()->set(get_edited_property(), prop_val);
}
diff --git a/editor/editor_resource_preview.cpp b/editor/editor_resource_preview.cpp
index 9723ae188b..d1ec50d786 100644
--- a/editor/editor_resource_preview.cpp
+++ b/editor/editor_resource_preview.cpp
@@ -30,11 +30,11 @@
#include "editor_resource_preview.h"
+#include "core/config/project_settings.h"
#include "core/io/resource_loader.h"
#include "core/io/resource_saver.h"
-#include "core/message_queue.h"
+#include "core/object/message_queue.h"
#include "core/os/file_access.h"
-#include "core/project_settings.h"
#include "editor_node.h"
#include "editor_scale.h"
#include "editor_settings.h"
diff --git a/editor/editor_run.cpp b/editor/editor_run.cpp
index 7fada633c9..2bba15c017 100644
--- a/editor/editor_run.cpp
+++ b/editor/editor_run.cpp
@@ -30,7 +30,7 @@
#include "editor_run.h"
-#include "core/project_settings.h"
+#include "core/config/project_settings.h"
#include "editor_settings.h"
#include "servers/display_server.h"
diff --git a/editor/editor_run_script.h b/editor/editor_run_script.h
index 261e2a7e41..3cb751ecc8 100644
--- a/editor/editor_run_script.h
+++ b/editor/editor_run_script.h
@@ -31,7 +31,7 @@
#ifndef EDITOR_RUN_SCRIPT_H
#define EDITOR_RUN_SCRIPT_H
-#include "core/reference.h"
+#include "core/object/reference.h"
#include "editor_plugin.h"
class EditorNode;
class EditorScript : public Reference {
diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp
index ac27c4a837..f5c1de9def 100644
--- a/editor/editor_settings.cpp
+++ b/editor/editor_settings.cpp
@@ -30,6 +30,7 @@
#include "editor_settings.h"
+#include "core/config/project_settings.h"
#include "core/io/certs_compressed.gen.h"
#include "core/io/compression.h"
#include "core/io/config_file.h"
@@ -42,7 +43,6 @@
#include "core/os/file_access.h"
#include "core/os/keyboard.h"
#include "core/os/os.h"
-#include "core/project_settings.h"
#include "core/version.h"
#include "editor/doc_translations.gen.h"
#include "editor/editor_node.h"
diff --git a/editor/editor_settings.h b/editor/editor_settings.h
index c1bb7951fa..41e6bab4ba 100644
--- a/editor/editor_settings.h
+++ b/editor/editor_settings.h
@@ -31,11 +31,11 @@
#ifndef EDITOR_SETTINGS_H
#define EDITOR_SETTINGS_H
-#include "core/class_db.h"
#include "core/io/config_file.h"
+#include "core/io/resource.h"
+#include "core/object/class_db.h"
#include "core/os/thread_safe.h"
-#include "core/resource.h"
-#include "core/translation.h"
+#include "core/string/translation.h"
#include "scene/gui/shortcut.h"
class EditorPlugin;
diff --git a/editor/editor_translation_parser.cpp b/editor/editor_translation_parser.cpp
index 7a90d20000..4e6a397840 100644
--- a/editor/editor_translation_parser.cpp
+++ b/editor/editor_translation_parser.cpp
@@ -30,10 +30,10 @@
#include "editor_translation_parser.h"
-#include "core/error_macros.h"
+#include "core/error/error_macros.h"
+#include "core/object/script_language.h"
#include "core/os/file_access.h"
-#include "core/script_language.h"
-#include "core/set.h"
+#include "core/templates/set.h"
EditorTranslationParser *EditorTranslationParser::singleton = nullptr;
diff --git a/editor/editor_translation_parser.h b/editor/editor_translation_parser.h
index 18f49b3803..bdebdd10a1 100644
--- a/editor/editor_translation_parser.h
+++ b/editor/editor_translation_parser.h
@@ -31,8 +31,8 @@
#ifndef EDITOR_TRANSLATION_PARSER_H
#define EDITOR_TRANSLATION_PARSER_H
-#include "core/error_list.h"
-#include "core/reference.h"
+#include "core/error/error_list.h"
+#include "core/object/reference.h"
class EditorTranslationParserPlugin : public Reference {
GDCLASS(EditorTranslationParserPlugin, Reference);
diff --git a/editor/editor_vcs_interface.h b/editor/editor_vcs_interface.h
index 6ef55f0a46..7de1883fd7 100644
--- a/editor/editor_vcs_interface.h
+++ b/editor/editor_vcs_interface.h
@@ -31,8 +31,8 @@
#ifndef EDITOR_VCS_INTERFACE_H
#define EDITOR_VCS_INTERFACE_H
-#include "core/class_db.h"
-#include "core/ustring.h"
+#include "core/object/class_db.h"
+#include "core/string/ustring.h"
#include "scene/gui/panel_container.h"
class EditorVCSInterface : public Object {
diff --git a/editor/fileserver/editor_file_server.h b/editor/fileserver/editor_file_server.h
index eefaa503c1..ca5a891856 100644
--- a/editor/fileserver/editor_file_server.h
+++ b/editor/fileserver/editor_file_server.h
@@ -31,10 +31,10 @@
#ifndef EDITOR_FILE_SERVER_H
#define EDITOR_FILE_SERVER_H
-#include "core/class_db.h"
#include "core/io/file_access_network.h"
#include "core/io/packet_peer.h"
#include "core/io/tcp_server.h"
+#include "core/object/class_db.h"
#include "core/os/thread.h"
class EditorFileServer : public Object {
diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp
index 14a46d77a2..ee0ee91893 100644
--- a/editor/filesystem_dock.cpp
+++ b/editor/filesystem_dock.cpp
@@ -30,13 +30,13 @@
#include "filesystem_dock.h"
+#include "core/config/project_settings.h"
#include "core/io/resource_loader.h"
-#include "core/list.h"
#include "core/os/dir_access.h"
#include "core/os/file_access.h"
#include "core/os/keyboard.h"
#include "core/os/os.h"
-#include "core/project_settings.h"
+#include "core/templates/list.h"
#include "editor_feature_profile.h"
#include "editor_node.h"
#include "editor_resource_preview.h"
@@ -2665,7 +2665,8 @@ FileSystemDock::FileSystemDock(EditorNode *p_editor) {
editor = p_editor;
path = "res://";
- ED_SHORTCUT("filesystem_dock/copy_path", TTR("Copy Path"), KEY_MASK_CMD | KEY_C);
+ // `KEY_MASK_CMD | KEY_C` conflicts with other editor shortcuts.
+ ED_SHORTCUT("filesystem_dock/copy_path", TTR("Copy Path"), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_C);
ED_SHORTCUT("filesystem_dock/duplicate", TTR("Duplicate..."), KEY_MASK_CMD | KEY_D);
ED_SHORTCUT("filesystem_dock/delete", TTR("Delete"), KEY_DELETE);
ED_SHORTCUT("filesystem_dock/rename", TTR("Rename"));
diff --git a/editor/find_in_files.h b/editor/find_in_files.h
index 5f2c6ee174..3b949a35b4 100644
--- a/editor/find_in_files.h
+++ b/editor/find_in_files.h
@@ -31,7 +31,7 @@
#ifndef FIND_IN_FILES_H
#define FIND_IN_FILES_H
-#include "core/hash_map.h"
+#include "core/templates/hash_map.h"
#include "scene/gui/dialogs.h"
// Performs the actual search
diff --git a/editor/groups_editor.h b/editor/groups_editor.h
index d5daaa19eb..6c3489fffb 100644
--- a/editor/groups_editor.h
+++ b/editor/groups_editor.h
@@ -31,7 +31,7 @@
#ifndef GROUPS_EDITOR_H
#define GROUPS_EDITOR_H
-#include "core/undo_redo.h"
+#include "core/object/undo_redo.h"
#include "editor/scene_tree_editor.h"
#include "scene/gui/button.h"
#include "scene/gui/dialogs.h"
diff --git a/editor/icons/CanvasGroup.svg b/editor/icons/CanvasGroup.svg
new file mode 100644
index 0000000000..232ae53231
--- /dev/null
+++ b/editor/icons/CanvasGroup.svg
@@ -0,0 +1 @@
+<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m7 1v6h-6v8h8v-6h6v-8zm2 2h4v4h-4z" fill="#a5b8f3" fill-opacity=".588235"/><path d="m1 1v2c0 .0000234.446 0 1 0s1 .0000234 1 0v-2c0-.00002341-.446 0-1 0s-1-.00002341-1 0zm12 0v2c0 .0000234.446 0 1 0s1 .0000234 1 0v-2c0-.00002341-.446 0-1 0s-1-.00002341-1 0zm-12 12v2c0 .000023.446 0 1 0s1 .000023 1 0v-2c0-.000023-.446 0-1 0s-1-.000023-1 0zm12 0v2c0 .000023.446 0 1 0s1 .000023 1 0v-2c0-.000023-.446 0-1 0s-1-.000023-1 0z" fill="#a5b7f4"/></svg>
diff --git a/editor/icons/CodeEdit.svg b/editor/icons/CodeEdit.svg
new file mode 100644
index 0000000000..0750b072e7
--- /dev/null
+++ b/editor/icons/CodeEdit.svg
@@ -0,0 +1 @@
+<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><g transform="translate(0 -1036.4)"><path d="m29 1042.4h1v1h-1z" fill="#fefeff"/><path d="m3 1c-1.1046 0-2 .8954-2 2v10c0 1.1046.89543 2 2 2h10c1.1046 0 2-.8954 2-2v-10c0-1.1046-.89543-2-2-2zm0 2h10v10h-10zm2 1-1 1 1 1-1 1 1 1 2-2zm2 3v1h2v-1z" fill="#a5efac" transform="translate(0 1036.4)"/></g></svg>
diff --git a/editor/icons/DirectionalLight2D.svg b/editor/icons/DirectionalLight2D.svg
new file mode 100644
index 0000000000..f30702b502
--- /dev/null
+++ b/editor/icons/DirectionalLight2D.svg
@@ -0,0 +1 @@
+<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m7 1v3h2v-3zm-2.5352 2.0508-1.4141 1.4141 1.4141 1.4141 1.4141-1.4141zm7.0703 0-1.4141 1.4141 1.4141 1.4141 1.4141-1.4141zm-3.5352 1.9492c-1.6569 0-3 1.3432-3 3s1.3431 3 3 3 3-1.3432 3-3-1.3431-3-3-3zm-7 2v2h3v-2zm11 0v2h3v-2zm-7.5352 3.1211-1.4141 1.4141 1.4141 1.4141 1.4141-1.4141zm7.0703 0-1.4141 1.4141 1.4141 1.4141 1.4141-1.4141zm-4.5352 1.8789v3h2v-3z" fill="#a5b7f4"/></svg>
diff --git a/editor/icons/Light2D.svg b/editor/icons/PointLight2D.svg
index d660b82c34..d660b82c34 100644
--- a/editor/icons/Light2D.svg
+++ b/editor/icons/PointLight2D.svg
diff --git a/editor/import/collada.h b/editor/import/collada.h
index 90c6c47e0b..aa0d42035f 100644
--- a/editor/import/collada.h
+++ b/editor/import/collada.h
@@ -31,9 +31,9 @@
#ifndef COLLADA_H
#define COLLADA_H
+#include "core/config/project_settings.h"
#include "core/io/xml_parser.h"
-#include "core/map.h"
-#include "core/project_settings.h"
+#include "core/templates/map.h"
#include "scene/resources/material.h"
class Collada {
diff --git a/editor/import/editor_import_plugin.cpp b/editor/import/editor_import_plugin.cpp
index 6d46d4d2e9..2658031bd9 100644
--- a/editor/import/editor_import_plugin.cpp
+++ b/editor/import/editor_import_plugin.cpp
@@ -29,7 +29,7 @@
/*************************************************************************/
#include "editor_import_plugin.h"
-#include "core/script_language.h"
+#include "core/object/script_language.h"
EditorImportPlugin::EditorImportPlugin() {
}
diff --git a/editor/import/resource_importer_bitmask.cpp b/editor/import/resource_importer_bitmask.cpp
index da2d1c9bdf..06b56fd73f 100644
--- a/editor/import/resource_importer_bitmask.cpp
+++ b/editor/import/resource_importer_bitmask.cpp
@@ -29,8 +29,8 @@
/*************************************************************************/
#include "resource_importer_bitmask.h"
-#include "core/image.h"
#include "core/io/config_file.h"
+#include "core/io/image.h"
#include "core/io/image_loader.h"
#include "editor/editor_file_system.h"
#include "editor/editor_node.h"
diff --git a/editor/import/resource_importer_bitmask.h b/editor/import/resource_importer_bitmask.h
index 0d3cb23697..83959f87cd 100644
--- a/editor/import/resource_importer_bitmask.h
+++ b/editor/import/resource_importer_bitmask.h
@@ -31,7 +31,7 @@
#ifndef RESOURCE_IMPORTER_BITMASK_H
#define RESOURCE_IMPORTER_BITMASK_H
-#include "core/image.h"
+#include "core/io/image.h"
#include "core/io/resource_importer.h"
class StreamBitMap;
diff --git a/editor/import/resource_importer_csv_translation.cpp b/editor/import/resource_importer_csv_translation.cpp
index 04e20dee86..4c6200e033 100644
--- a/editor/import/resource_importer_csv_translation.cpp
+++ b/editor/import/resource_importer_csv_translation.cpp
@@ -30,10 +30,10 @@
#include "resource_importer_csv_translation.h"
-#include "core/compressed_translation.h"
#include "core/io/resource_saver.h"
#include "core/os/file_access.h"
-#include "core/translation.h"
+#include "core/string/compressed_translation.h"
+#include "core/string/translation.h"
String ResourceImporterCSVTranslation::get_importer_name() const {
return "csv_translation";
diff --git a/editor/import/resource_importer_image.h b/editor/import/resource_importer_image.h
index dc9c2c3014..703b36b091 100644
--- a/editor/import/resource_importer_image.h
+++ b/editor/import/resource_importer_image.h
@@ -31,7 +31,7 @@
#ifndef RESOURCE_IMPORTER_IMAGE_H
#define RESOURCE_IMPORTER_IMAGE_H
-#include "core/image.h"
+#include "core/io/image.h"
#include "core/io/resource_importer.h"
class ResourceImporterImage : public ResourceImporter {
diff --git a/editor/import/resource_importer_layered_texture.h b/editor/import/resource_importer_layered_texture.h
index b54923be00..7ac3d55dec 100644
--- a/editor/import/resource_importer_layered_texture.h
+++ b/editor/import/resource_importer_layered_texture.h
@@ -61,7 +61,7 @@
#ifndef RESOURCE_IMPORTER_LAYERED_TEXTURE_H
#define RESOURCE_IMPORTER_LAYERED_TEXTURE_H
-#include "core/image.h"
+#include "core/io/image.h"
#include "core/io/resource_importer.h"
class StreamTexture2D;
diff --git a/editor/import/resource_importer_texture.h b/editor/import/resource_importer_texture.h
index bc41aacae5..97c4622731 100644
--- a/editor/import/resource_importer_texture.h
+++ b/editor/import/resource_importer_texture.h
@@ -31,7 +31,7 @@
#ifndef RESOURCEIMPORTTEXTURE_H
#define RESOURCEIMPORTTEXTURE_H
-#include "core/image.h"
+#include "core/io/image.h"
#include "core/io/resource_importer.h"
#include "core/os/file_access.h"
#include "scene/resources/texture.h"
diff --git a/editor/import/resource_importer_texture_atlas.h b/editor/import/resource_importer_texture_atlas.h
index 25a662a333..9d973c3d8d 100644
--- a/editor/import/resource_importer_texture_atlas.h
+++ b/editor/import/resource_importer_texture_atlas.h
@@ -31,7 +31,7 @@
#ifndef RESOURCE_IMPORTER_TEXTURE_ATLAS_H
#define RESOURCE_IMPORTER_TEXTURE_ATLAS_H
-#include "core/image.h"
+#include "core/io/image.h"
#include "core/io/resource_importer.h"
class ResourceImporterTextureAtlas : public ResourceImporter {
GDCLASS(ResourceImporterTextureAtlas, ResourceImporter);
diff --git a/editor/input_map_editor.h b/editor/input_map_editor.h
index 87a25e91b0..b9a3ce19d4 100644
--- a/editor/input_map_editor.h
+++ b/editor/input_map_editor.h
@@ -31,7 +31,7 @@
#ifndef INPUT_MAP_EDITOR_H
#define INPUT_MAP_EDITOR_H
-#include "core/undo_redo.h"
+#include "core/object/undo_redo.h"
#include "editor/editor_data.h"
class InputMapEditor : public Control {
diff --git a/editor/localization_editor.cpp b/editor/localization_editor.cpp
index e4562c57af..e725ce482d 100644
--- a/editor/localization_editor.cpp
+++ b/editor/localization_editor.cpp
@@ -30,7 +30,7 @@
#include "localization_editor.h"
-#include "core/translation.h"
+#include "core/string/translation.h"
#include "editor_node.h"
#include "editor_translation_parser.h"
#include "pot_generator.h"
diff --git a/editor/localization_editor.h b/editor/localization_editor.h
index b7253fb31d..3c077d9c77 100644
--- a/editor/localization_editor.h
+++ b/editor/localization_editor.h
@@ -31,7 +31,7 @@
#ifndef LOCALIZATION_EDITOR_H
#define LOCALIZATION_EDITOR_H
-#include "core/undo_redo.h"
+#include "core/object/undo_redo.h"
#include "editor_file_dialog.h"
#include "scene/gui/tree.h"
diff --git a/editor/plugins/animation_blend_space_2d_editor.cpp b/editor/plugins/animation_blend_space_2d_editor.cpp
index 805df0cbb9..60a5188af7 100644
--- a/editor/plugins/animation_blend_space_2d_editor.cpp
+++ b/editor/plugins/animation_blend_space_2d_editor.cpp
@@ -30,11 +30,11 @@
#include "animation_blend_space_2d_editor.h"
+#include "core/config/project_settings.h"
#include "core/input/input.h"
#include "core/io/resource_loader.h"
#include "core/math/geometry_2d.h"
#include "core/os/keyboard.h"
-#include "core/project_settings.h"
#include "editor/editor_scale.h"
#include "scene/animation/animation_blend_tree.h"
#include "scene/animation/animation_player.h"
diff --git a/editor/plugins/animation_blend_tree_editor_plugin.cpp b/editor/plugins/animation_blend_tree_editor_plugin.cpp
index 6419f62343..38648b5f0a 100644
--- a/editor/plugins/animation_blend_tree_editor_plugin.cpp
+++ b/editor/plugins/animation_blend_tree_editor_plugin.cpp
@@ -30,10 +30,10 @@
#include "animation_blend_tree_editor_plugin.h"
+#include "core/config/project_settings.h"
#include "core/input/input.h"
#include "core/io/resource_loader.h"
#include "core/os/keyboard.h"
-#include "core/project_settings.h"
#include "editor/editor_inspector.h"
#include "editor/editor_scale.h"
#include "scene/animation/animation_player.h"
diff --git a/editor/plugins/animation_player_editor_plugin.cpp b/editor/plugins/animation_player_editor_plugin.cpp
index 6e4a39d3f0..1e56e3d11f 100644
--- a/editor/plugins/animation_player_editor_plugin.cpp
+++ b/editor/plugins/animation_player_editor_plugin.cpp
@@ -30,11 +30,11 @@
#include "animation_player_editor_plugin.h"
+#include "core/config/project_settings.h"
#include "core/input/input.h"
#include "core/io/resource_loader.h"
#include "core/io/resource_saver.h"
#include "core/os/keyboard.h"
-#include "core/project_settings.h"
#include "editor/animation_track_editor.h"
#include "editor/editor_scale.h"
#include "editor/editor_settings.h"
diff --git a/editor/plugins/animation_state_machine_editor.cpp b/editor/plugins/animation_state_machine_editor.cpp
index 885ec17cb3..4634d15941 100644
--- a/editor/plugins/animation_state_machine_editor.cpp
+++ b/editor/plugins/animation_state_machine_editor.cpp
@@ -30,11 +30,11 @@
#include "animation_state_machine_editor.h"
+#include "core/config/project_settings.h"
#include "core/input/input.h"
#include "core/io/resource_loader.h"
#include "core/math/geometry_2d.h"
#include "core/os/keyboard.h"
-#include "core/project_settings.h"
#include "editor/editor_scale.h"
#include "scene/animation/animation_blend_tree.h"
#include "scene/animation/animation_player.h"
diff --git a/editor/plugins/animation_tree_editor_plugin.cpp b/editor/plugins/animation_tree_editor_plugin.cpp
index 269c54ba2b..1bbb68d224 100644
--- a/editor/plugins/animation_tree_editor_plugin.cpp
+++ b/editor/plugins/animation_tree_editor_plugin.cpp
@@ -34,11 +34,11 @@
#include "animation_blend_space_2d_editor.h"
#include "animation_blend_tree_editor_plugin.h"
#include "animation_state_machine_editor.h"
+#include "core/config/project_settings.h"
#include "core/input/input.h"
#include "core/io/resource_loader.h"
#include "core/math/delaunay_2d.h"
#include "core/os/keyboard.h"
-#include "core/project_settings.h"
#include "editor/editor_scale.h"
#include "scene/animation/animation_blend_tree.h"
#include "scene/animation/animation_player.h"
diff --git a/editor/plugins/audio_stream_editor_plugin.cpp b/editor/plugins/audio_stream_editor_plugin.cpp
index 231f5588a4..e6f6b6f2e0 100644
--- a/editor/plugins/audio_stream_editor_plugin.cpp
+++ b/editor/plugins/audio_stream_editor_plugin.cpp
@@ -30,8 +30,8 @@
#include "audio_stream_editor_plugin.h"
+#include "core/config/project_settings.h"
#include "core/io/resource_loader.h"
-#include "core/project_settings.h"
#include "editor/audio_stream_preview.h"
#include "editor/editor_scale.h"
#include "editor/editor_settings.h"
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp
index 1af60b59a2..e1f2d2c045 100644
--- a/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/editor/plugins/canvas_item_editor_plugin.cpp
@@ -30,11 +30,11 @@
#include "canvas_item_editor_plugin.h"
+#include "core/config/project_settings.h"
#include "core/input/input.h"
#include "core/math/geometry_2d.h"
#include "core/os/keyboard.h"
-#include "core/print_string.h"
-#include "core/project_settings.h"
+#include "core/string/print_string.h"
#include "editor/debugger/editor_debugger_node.h"
#include "editor/editor_node.h"
#include "editor/editor_scale.h"
diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp
index 5038941784..fdbf3415db 100644
--- a/editor/plugins/node_3d_editor_plugin.cpp
+++ b/editor/plugins/node_3d_editor_plugin.cpp
@@ -30,12 +30,12 @@
#include "node_3d_editor_plugin.h"
+#include "core/config/project_settings.h"
#include "core/input/input.h"
#include "core/math/camera_matrix.h"
#include "core/os/keyboard.h"
-#include "core/print_string.h"
-#include "core/project_settings.h"
-#include "core/sort_array.h"
+#include "core/string/print_string.h"
+#include "core/templates/sort_array.h"
#include "editor/debugger/editor_debugger_node.h"
#include "editor/editor_node.h"
#include "editor/editor_scale.h"
@@ -351,8 +351,8 @@ void Node3DEditorViewport::_update_camera(float p_interp_delta) {
update_transform_gizmo_view();
rotation_control->update();
+ spatial_editor->update_grid();
}
- spatial_editor->update_grid();
}
Transform Node3DEditorViewport::to_camera_transform(const Cursor &p_cursor) const {
@@ -2426,6 +2426,7 @@ void Node3DEditorViewport::_notification(int p_what) {
t.basis = t.basis * aabb_s;
RenderingServer::get_singleton()->instance_set_transform(se->sbox_instance, t);
+ RenderingServer::get_singleton()->instance_set_transform(se->sbox_instance_xray, t);
}
if (changed || (spatial_editor->is_gizmo_visible() && !exist)) {
@@ -4417,6 +4418,9 @@ Node3DEditorSelectedItem::~Node3DEditorSelectedItem() {
if (sbox_instance.is_valid()) {
RenderingServer::get_singleton()->free(sbox_instance);
}
+ if (sbox_instance_xray.is_valid()) {
+ RenderingServer::get_singleton()->free(sbox_instance_xray);
+ }
}
void Node3DEditor::select_gizmo_highlight_axis(int p_axis) {
@@ -4500,42 +4504,73 @@ Object *Node3DEditor::_get_editor_data(Object *p_what) {
Node3DEditorSelectedItem *si = memnew(Node3DEditorSelectedItem);
si->sp = sp;
- si->sbox_instance = RenderingServer::get_singleton()->instance_create2(selection_box->get_rid(), sp->get_world_3d()->get_scenario());
- RS::get_singleton()->instance_geometry_set_cast_shadows_setting(si->sbox_instance, RS::SHADOW_CASTING_SETTING_OFF);
+ si->sbox_instance = RenderingServer::get_singleton()->instance_create2(
+ selection_box->get_rid(),
+ sp->get_world_3d()->get_scenario());
+ RS::get_singleton()->instance_geometry_set_cast_shadows_setting(
+ si->sbox_instance,
+ RS::SHADOW_CASTING_SETTING_OFF);
+ si->sbox_instance_xray = RenderingServer::get_singleton()->instance_create2(
+ selection_box_xray->get_rid(),
+ sp->get_world_3d()->get_scenario());
+ RS::get_singleton()->instance_geometry_set_cast_shadows_setting(
+ si->sbox_instance_xray,
+ RS::SHADOW_CASTING_SETTING_OFF);
return si;
}
-void Node3DEditor::_generate_selection_box() {
+void Node3DEditor::_generate_selection_boxes() {
+ // Use two AABBs to create the illusion of a slightly thicker line.
AABB aabb(Vector3(), Vector3(1, 1, 1));
- aabb.grow_by(aabb.get_longest_axis_size() / 20.0);
-
+ AABB aabb_offset(Vector3(), Vector3(1, 1, 1));
+ // Grow the bounding boxes slightly to avoid Z-fighting with the mesh's edges.
+ aabb.grow_by(0.005);
+ aabb_offset.grow_by(0.01);
+
+ // Create a x-ray (visible through solid surfaces) and standard version of the selection box.
+ // Both will be drawn at the same position, but with different opacity.
+ // This lets the user see where the selection is while still having a sense of depth.
Ref<SurfaceTool> st = memnew(SurfaceTool);
+ Ref<SurfaceTool> st_xray = memnew(SurfaceTool);
st->begin(Mesh::PRIMITIVE_LINES);
+ st_xray->begin(Mesh::PRIMITIVE_LINES);
for (int i = 0; i < 12; i++) {
Vector3 a, b;
aabb.get_edge(i, a, b);
- st->add_color(Color(1.0, 1.0, 0.8, 0.8));
st->add_vertex(a);
- st->add_color(Color(1.0, 1.0, 0.8, 0.4));
- st->add_vertex(a.lerp(b, 0.2));
+ st->add_vertex(b);
+ st_xray->add_vertex(a);
+ st_xray->add_vertex(b);
+ }
- st->add_color(Color(1.0, 1.0, 0.8, 0.4));
- st->add_vertex(a.lerp(b, 0.8));
- st->add_color(Color(1.0, 1.0, 0.8, 0.8));
+ for (int i = 0; i < 12; i++) {
+ Vector3 a, b;
+ aabb_offset.get_edge(i, a, b);
+
+ st->add_vertex(a);
st->add_vertex(b);
+ st_xray->add_vertex(a);
+ st_xray->add_vertex(b);
}
Ref<StandardMaterial3D> mat = memnew(StandardMaterial3D);
mat->set_shading_mode(StandardMaterial3D::SHADING_MODE_UNSHADED);
- mat->set_albedo(Color(1, 1, 1));
+ // Use a similar color to the 2D editor selection.
+ mat->set_albedo(Color(1, 0.5, 0));
mat->set_transparency(StandardMaterial3D::TRANSPARENCY_ALPHA);
- mat->set_flag(StandardMaterial3D::FLAG_ALBEDO_FROM_VERTEX_COLOR, true);
- mat->set_flag(StandardMaterial3D::FLAG_SRGB_VERTEX_COLOR, true);
st->set_material(mat);
selection_box = st->commit();
+
+ Ref<StandardMaterial3D> mat_xray = memnew(StandardMaterial3D);
+ mat_xray->set_shading_mode(StandardMaterial3D::SHADING_MODE_UNSHADED);
+ mat_xray->set_flag(StandardMaterial3D::FLAG_DISABLE_DEPTH_TEST, true);
+ mat_xray->set_albedo(Color(1, 0.5, 0, 0.15));
+ mat_xray->set_transparency(StandardMaterial3D::TRANSPARENCY_ALPHA);
+ st_xray->set_material(mat_xray);
+ selection_box_xray = st_xray->commit();
}
Dictionary Node3DEditor::get_state() const {
@@ -4687,7 +4722,7 @@ void Node3DEditor::set_state(const Dictionary &p_state) {
}
int state = EditorNode3DGizmoPlugin::VISIBLE;
for (int i = 0; i < keys.size(); i++) {
- if (gizmo_plugins_by_name.write[j]->get_name() == keys[i]) {
+ if (gizmo_plugins_by_name.write[j]->get_name() == String(keys[i])) {
state = gizmos_status[keys[i]];
break;
}
@@ -5514,7 +5549,7 @@ void Node3DEditor::_init_indicators() {
}
}
- _generate_selection_box();
+ _generate_selection_boxes();
}
void Node3DEditor::_update_gizmos_menu() {
diff --git a/editor/plugins/node_3d_editor_plugin.h b/editor/plugins/node_3d_editor_plugin.h
index e4a384449b..4c4faef07f 100644
--- a/editor/plugins/node_3d_editor_plugin.h
+++ b/editor/plugins/node_3d_editor_plugin.h
@@ -498,6 +498,7 @@ public:
bool last_xform_dirty;
Node3D *sp;
RID sbox_instance;
+ RID sbox_instance_xray;
Node3DEditorSelectedItem() {
sp = nullptr;
@@ -613,6 +614,7 @@ private:
float snap_rotate_value;
float snap_scale_value;
+ Ref<ArrayMesh> selection_box_xray;
Ref<ArrayMesh> selection_box;
RID indicators;
RID indicators_instance;
@@ -701,7 +703,7 @@ private:
HBoxContainer *hbc_menu;
- void _generate_selection_box();
+ void _generate_selection_boxes();
UndoRedo *undo_redo;
int camera_override_viewport_id;
diff --git a/editor/plugins/resource_preloader_editor_plugin.cpp b/editor/plugins/resource_preloader_editor_plugin.cpp
index 9ab5bfd8a3..f317aebe74 100644
--- a/editor/plugins/resource_preloader_editor_plugin.cpp
+++ b/editor/plugins/resource_preloader_editor_plugin.cpp
@@ -30,8 +30,8 @@
#include "resource_preloader_editor_plugin.h"
+#include "core/config/project_settings.h"
#include "core/io/resource_loader.h"
-#include "core/project_settings.h"
#include "editor/editor_scale.h"
#include "editor/editor_settings.h"
diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp
index be8ddf789b..8dd7d6d6e2 100644
--- a/editor/plugins/script_editor_plugin.cpp
+++ b/editor/plugins/script_editor_plugin.cpp
@@ -30,12 +30,12 @@
#include "script_editor_plugin.h"
+#include "core/config/project_settings.h"
#include "core/input/input.h"
#include "core/io/resource_loader.h"
#include "core/os/file_access.h"
#include "core/os/keyboard.h"
#include "core/os/os.h"
-#include "core/project_settings.h"
#include "editor/debugger/editor_debugger_node.h"
#include "editor/editor_node.h"
#include "editor/editor_run_script.h"
@@ -2397,7 +2397,7 @@ void ScriptEditor::_editor_settings_changed() {
if (current_theme == "") {
current_theme = EditorSettings::get_singleton()->get("text_editor/theme/color_theme");
- } else if (current_theme != EditorSettings::get_singleton()->get("text_editor/theme/color_theme")) {
+ } else if (current_theme != String(EditorSettings::get_singleton()->get("text_editor/theme/color_theme"))) {
current_theme = EditorSettings::get_singleton()->get("text_editor/theme/color_theme");
EditorSettings::get_singleton()->load_text_editor_theme();
}
diff --git a/editor/plugins/script_editor_plugin.h b/editor/plugins/script_editor_plugin.h
index c2b0b458eb..32f47239ef 100644
--- a/editor/plugins/script_editor_plugin.h
+++ b/editor/plugins/script_editor_plugin.h
@@ -31,7 +31,7 @@
#ifndef SCRIPT_EDITOR_PLUGIN_H
#define SCRIPT_EDITOR_PLUGIN_H
-#include "core/script_language.h"
+#include "core/object/script_language.h"
#include "editor/code_editor.h"
#include "editor/editor_help.h"
#include "editor/editor_help_search.h"
diff --git a/editor/plugins/sprite_frames_editor_plugin.cpp b/editor/plugins/sprite_frames_editor_plugin.cpp
index 5007983581..69a8a8d92c 100644
--- a/editor/plugins/sprite_frames_editor_plugin.cpp
+++ b/editor/plugins/sprite_frames_editor_plugin.cpp
@@ -30,8 +30,8 @@
#include "sprite_frames_editor_plugin.h"
+#include "core/config/project_settings.h"
#include "core/io/resource_loader.h"
-#include "core/project_settings.h"
#include "editor/editor_scale.h"
#include "editor/editor_settings.h"
#include "scene/3d/sprite_3d.h"
diff --git a/editor/plugins/texture_3d_editor_plugin.cpp b/editor/plugins/texture_3d_editor_plugin.cpp
index ba2eef8484..8447a2346f 100644
--- a/editor/plugins/texture_3d_editor_plugin.cpp
+++ b/editor/plugins/texture_3d_editor_plugin.cpp
@@ -30,8 +30,8 @@
#include "texture_3d_editor_plugin.h"
+#include "core/config/project_settings.h"
#include "core/io/resource_loader.h"
-#include "core/project_settings.h"
#include "editor/editor_settings.h"
void Texture3DEditor::_gui_input(Ref<InputEvent> p_event) {
diff --git a/editor/plugins/texture_editor_plugin.cpp b/editor/plugins/texture_editor_plugin.cpp
index b728a6700c..f8facb0fd5 100644
--- a/editor/plugins/texture_editor_plugin.cpp
+++ b/editor/plugins/texture_editor_plugin.cpp
@@ -30,8 +30,8 @@
#include "texture_editor_plugin.h"
+#include "core/config/project_settings.h"
#include "core/io/resource_loader.h"
-#include "core/project_settings.h"
#include "editor/editor_settings.h"
void TextureEditor::_gui_input(Ref<InputEvent> p_event) {
diff --git a/editor/plugins/texture_layered_editor_plugin.cpp b/editor/plugins/texture_layered_editor_plugin.cpp
index 59e87fb273..eafe4d546b 100644
--- a/editor/plugins/texture_layered_editor_plugin.cpp
+++ b/editor/plugins/texture_layered_editor_plugin.cpp
@@ -30,8 +30,8 @@
#include "texture_layered_editor_plugin.h"
+#include "core/config/project_settings.h"
#include "core/io/resource_loader.h"
-#include "core/project_settings.h"
#include "editor/editor_settings.h"
void TextureLayeredEditor::_gui_input(Ref<InputEvent> p_event) {
diff --git a/editor/plugins/texture_region_editor_plugin.cpp b/editor/plugins/texture_region_editor_plugin.cpp
index 6e722607f7..f599b94428 100644
--- a/editor/plugins/texture_region_editor_plugin.cpp
+++ b/editor/plugins/texture_region_editor_plugin.cpp
@@ -875,7 +875,8 @@ void TextureRegionEditor::_changed_callback(Object *p_changed, const char *p_pro
if (!is_visible()) {
return;
}
- if (p_prop == StringName("atlas") || p_prop == StringName("texture") || p_prop == StringName("region")) {
+ String prop = p_prop;
+ if (prop == "atlas" || prop == "texture" || prop == "region") {
_edit_region();
}
}
diff --git a/editor/plugins/tile_map_editor_plugin.cpp b/editor/plugins/tile_map_editor_plugin.cpp
index e43b8c4b7f..7b516175b2 100644
--- a/editor/plugins/tile_map_editor_plugin.cpp
+++ b/editor/plugins/tile_map_editor_plugin.cpp
@@ -651,9 +651,15 @@ Vector<Vector2> TileMapEditor::_bucket_fill(const Point2i &p_start, bool erase,
return Vector<Vector2>();
}
+ // Check if the tile variation is the same
+ Vector2 prev_position = node->get_cell_autotile_coord(p_start.x, p_start.y);
if (ids.size() == 1 && ids[0] == prev_id) {
- // Same ID, nothing to change
- return Vector<Vector2>();
+ int current = manual_palette->get_current();
+ Vector2 position = manual_palette->get_item_metadata(current);
+ if (prev_position == position) {
+ // Same ID and variation, nothing to change
+ return Vector<Vector2>();
+ }
}
Rect2i r = node->get_used_rect();
diff --git a/editor/plugins/version_control_editor_plugin.cpp b/editor/plugins/version_control_editor_plugin.cpp
index cfbe54ef61..5e98b2d98b 100644
--- a/editor/plugins/version_control_editor_plugin.cpp
+++ b/editor/plugins/version_control_editor_plugin.cpp
@@ -30,7 +30,7 @@
#include "version_control_editor_plugin.h"
-#include "core/script_language.h"
+#include "core/object/script_language.h"
#include "editor/editor_file_system.h"
#include "editor/editor_node.h"
#include "editor/editor_scale.h"
diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp
index ddcba18a78..f3fc22b313 100644
--- a/editor/plugins/visual_shader_editor_plugin.cpp
+++ b/editor/plugins/visual_shader_editor_plugin.cpp
@@ -30,11 +30,11 @@
#include "visual_shader_editor_plugin.h"
+#include "core/config/project_settings.h"
#include "core/input/input.h"
#include "core/io/resource_loader.h"
#include "core/math/math_defs.h"
#include "core/os/keyboard.h"
-#include "core/project_settings.h"
#include "core/version.h"
#include "editor/editor_log.h"
#include "editor/editor_properties.h"
diff --git a/editor/pot_generator.cpp b/editor/pot_generator.cpp
index f09750efdc..9b3227ad28 100644
--- a/editor/pot_generator.cpp
+++ b/editor/pot_generator.cpp
@@ -30,8 +30,8 @@
#include "pot_generator.h"
-#include "core/error_macros.h"
-#include "core/project_settings.h"
+#include "core/config/project_settings.h"
+#include "core/error/error_macros.h"
#include "editor_translation_parser.h"
#include "plugins/packed_scene_translation_parser_plugin.h"
diff --git a/editor/pot_generator.h b/editor/pot_generator.h
index 8853b784ed..1fd2956445 100644
--- a/editor/pot_generator.h
+++ b/editor/pot_generator.h
@@ -31,9 +31,9 @@
#ifndef POT_GENERATOR_H
#define POT_GENERATOR_H
-#include "core/ordered_hash_map.h"
#include "core/os/file_access.h"
-#include "core/set.h"
+#include "core/templates/ordered_hash_map.h"
+#include "core/templates/set.h"
//#define DEBUG_POT
diff --git a/editor/progress_dialog.cpp b/editor/progress_dialog.cpp
index 541cba836b..46a656e0af 100644
--- a/editor/progress_dialog.cpp
+++ b/editor/progress_dialog.cpp
@@ -30,7 +30,7 @@
#include "progress_dialog.h"
-#include "core/message_queue.h"
+#include "core/object/message_queue.h"
#include "core/os/os.h"
#include "editor_scale.h"
#include "main/main.h"
diff --git a/editor/project_export.cpp b/editor/project_export.cpp
index 71522bb253..e8c2b1f954 100644
--- a/editor/project_export.cpp
+++ b/editor/project_export.cpp
@@ -30,14 +30,14 @@
#include "project_export.h"
-#include "core/compressed_translation.h"
+#include "core/config/project_settings.h"
#include "core/io/image_loader.h"
#include "core/io/resource_loader.h"
#include "core/io/resource_saver.h"
#include "core/os/dir_access.h"
#include "core/os/file_access.h"
#include "core/os/os.h"
-#include "core/project_settings.h"
+#include "core/string/compressed_translation.h"
#include "editor_data.h"
#include "editor_node.h"
#include "editor_scale.h"
diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp
index 6393aa30ed..e3c2ba83f2 100644
--- a/editor/project_manager.cpp
+++ b/editor/project_manager.cpp
@@ -38,7 +38,7 @@
#include "core/os/file_access.h"
#include "core/os/keyboard.h"
#include "core/os/os.h"
-#include "core/translation.h"
+#include "core/string/translation.h"
#include "core/version.h"
#include "core/version_hash.gen.h"
#include "editor_scale.h"
diff --git a/editor/project_settings_editor.cpp b/editor/project_settings_editor.cpp
index b6621d0d1e..55d80021c8 100644
--- a/editor/project_settings_editor.cpp
+++ b/editor/project_settings_editor.cpp
@@ -30,7 +30,7 @@
#include "project_settings_editor.h"
-#include "core/project_settings.h"
+#include "core/config/project_settings.h"
#include "editor/editor_export.h"
#include "editor/editor_node.h"
#include "editor/editor_scale.h"
@@ -98,7 +98,8 @@ void ProjectSettingsEditor::_add_setting() {
// Initialize the property with the default value for the given type.
// The type list starts at 1 (as we exclude Nil), so add 1 to the selected value.
Callable::CallError ce;
- const Variant value = Variant::construct(Variant::Type(type->get_selected() + 1), nullptr, 0, ce);
+ Variant value;
+ Variant::construct(Variant::Type(type->get_selected() + 1), value, nullptr, 0, ce);
undo_redo->create_action(TTR("Add Project Setting"));
undo_redo->add_do_property(ps, setting, value);
diff --git a/editor/project_settings_editor.h b/editor/project_settings_editor.h
index 4ecd28e514..73e96d7b03 100644
--- a/editor/project_settings_editor.h
+++ b/editor/project_settings_editor.h
@@ -31,7 +31,7 @@
#ifndef PROJECT_SETTINGS_EDITOR_H
#define PROJECT_SETTINGS_EDITOR_H
-#include "core/undo_redo.h"
+#include "core/object/undo_redo.h"
#include "editor/editor_data.h"
#include "editor/editor_plugin_settings.h"
#include "editor/editor_sectioned_inspector.h"
diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp
index 7f1b5347cf..1e4ed0c552 100644
--- a/editor/property_editor.cpp
+++ b/editor/property_editor.cpp
@@ -30,16 +30,16 @@
#include "property_editor.h"
-#include "core/class_db.h"
+#include "core/config/project_settings.h"
#include "core/input/input.h"
#include "core/io/image_loader.h"
#include "core/io/marshalls.h"
#include "core/io/resource_loader.h"
#include "core/math/expression.h"
+#include "core/object/class_db.h"
#include "core/os/keyboard.h"
-#include "core/pair.h"
-#include "core/print_string.h"
-#include "core/project_settings.h"
+#include "core/string/print_string.h"
+#include "core/templates/pair.h"
#include "editor/array_property_edit.h"
#include "editor/create_dialog.h"
#include "editor/dictionary_property_edit.h"
@@ -345,7 +345,7 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant::
checks20[i]->hide();
}
- type = (p_variant.get_type() != Variant::NIL && p_variant.get_type() != Variant::_RID && p_type != Variant::OBJECT) ? p_variant.get_type() : p_type;
+ type = (p_variant.get_type() != Variant::NIL && p_variant.get_type() != Variant::RID && p_type != Variant::OBJECT) ? p_variant.get_type() : p_type;
switch (type) {
case Variant::BOOL: {
diff --git a/editor/property_selector.cpp b/editor/property_selector.cpp
index 27b11e4fb5..75420a1ef4 100644
--- a/editor/property_selector.cpp
+++ b/editor/property_selector.cpp
@@ -95,7 +95,7 @@ void PropertySelector::_update_search() {
} else if (type != Variant::NIL) {
Variant v;
Callable::CallError ce;
- v = Variant::construct(type, nullptr, 0, ce);
+ Variant::construct(type, v, nullptr, 0, ce);
v.get_property_list(&props);
} else {
@@ -200,7 +200,7 @@ void PropertySelector::_update_search() {
if (type != Variant::NIL) {
Variant v;
Callable::CallError ce;
- v = Variant::construct(type, nullptr, 0, ce);
+ Variant::construct(type, v, nullptr, 0, ce);
v.get_method_list(&methods);
} else {
Object *obj = ObjectDB::get_instance(script);
diff --git a/editor/pvrtc_compress.h b/editor/pvrtc_compress.h
index 77bc11b224..7b6c17d3c4 100644
--- a/editor/pvrtc_compress.h
+++ b/editor/pvrtc_compress.h
@@ -31,7 +31,7 @@
#ifndef PVRTC_COMPRESS_H
#define PVRTC_COMPRESS_H
-#include "core/image.h"
+#include "core/io/image.h"
void _pvrtc_register_compressors();
diff --git a/editor/quick_open.h b/editor/quick_open.h
index 6486ee0221..3b199f9561 100644
--- a/editor/quick_open.h
+++ b/editor/quick_open.h
@@ -31,7 +31,7 @@
#ifndef EDITOR_QUICK_OPEN_H
#define EDITOR_QUICK_OPEN_H
-#include "core/oa_hash_map.h"
+#include "core/templates/oa_hash_map.h"
#include "editor_file_system.h"
#include "scene/gui/dialogs.h"
#include "scene/gui/tree.h"
diff --git a/editor/rename_dialog.cpp b/editor/rename_dialog.cpp
index 23990bca07..318324e56d 100644
--- a/editor/rename_dialog.cpp
+++ b/editor/rename_dialog.cpp
@@ -30,7 +30,7 @@
#include "rename_dialog.h"
-#include "core/print_string.h"
+#include "core/string/print_string.h"
#include "editor_node.h"
#include "editor_scale.h"
#include "editor_settings.h"
diff --git a/editor/rename_dialog.h b/editor/rename_dialog.h
index 100426af4f..164d7ab1b0 100644
--- a/editor/rename_dialog.h
+++ b/editor/rename_dialog.h
@@ -36,7 +36,7 @@
#include "scene/gui/option_button.h"
#include "scene/gui/spin_box.h"
-#include "core/undo_redo.h"
+#include "core/object/undo_redo.h"
#include "editor/scene_tree_editor.h"
/**
diff --git a/editor/reparent_dialog.cpp b/editor/reparent_dialog.cpp
index 1615336a4b..0ff27af7c1 100644
--- a/editor/reparent_dialog.cpp
+++ b/editor/reparent_dialog.cpp
@@ -30,7 +30,7 @@
#include "reparent_dialog.h"
-#include "core/print_string.h"
+#include "core/string/print_string.h"
#include "scene/gui/box_container.h"
#include "scene/gui/label.h"
diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp
index 46e9cd4676..add5047c99 100644
--- a/editor/scene_tree_dock.cpp
+++ b/editor/scene_tree_dock.cpp
@@ -30,10 +30,10 @@
#include "scene_tree_dock.h"
+#include "core/config/project_settings.h"
#include "core/input/input.h"
#include "core/io/resource_saver.h"
#include "core/os/keyboard.h"
-#include "core/project_settings.h"
#include "editor/debugger/editor_debugger_node.h"
#include "editor/editor_feature_profile.h"
#include "editor/editor_node.h"
diff --git a/editor/scene_tree_editor.cpp b/editor/scene_tree_editor.cpp
index 3dee4a229f..3ec012ce3c 100644
--- a/editor/scene_tree_editor.cpp
+++ b/editor/scene_tree_editor.cpp
@@ -30,8 +30,8 @@
#include "scene_tree_editor.h"
-#include "core/message_queue.h"
-#include "core/print_string.h"
+#include "core/object/message_queue.h"
+#include "core/string/print_string.h"
#include "editor/editor_node.h"
#include "editor/editor_scale.h"
#include "editor/node_dock.h"
diff --git a/editor/scene_tree_editor.h b/editor/scene_tree_editor.h
index 21bb0ec062..9373ef41f9 100644
--- a/editor/scene_tree_editor.h
+++ b/editor/scene_tree_editor.h
@@ -31,7 +31,7 @@
#ifndef SCENE_TREE_EDITOR_H
#define SCENE_TREE_EDITOR_H
-#include "core/undo_redo.h"
+#include "core/object/undo_redo.h"
#include "editor_data.h"
#include "editor_settings.h"
#include "scene/gui/button.h"
diff --git a/editor/script_create_dialog.cpp b/editor/script_create_dialog.cpp
index 90efb11b7d..b5f11fc6f9 100644
--- a/editor/script_create_dialog.cpp
+++ b/editor/script_create_dialog.cpp
@@ -30,11 +30,11 @@
#include "script_create_dialog.h"
+#include "core/config/project_settings.h"
#include "core/io/resource_saver.h"
+#include "core/object/script_language.h"
#include "core/os/file_access.h"
-#include "core/project_settings.h"
-#include "core/script_language.h"
-#include "core/string_builder.h"
+#include "core/string/string_builder.h"
#include "editor/create_dialog.h"
#include "editor/editor_node.h"
#include "editor/editor_scale.h"
diff --git a/editor/settings_config_dialog.cpp b/editor/settings_config_dialog.cpp
index 5da682a148..864e5976b2 100644
--- a/editor/settings_config_dialog.cpp
+++ b/editor/settings_config_dialog.cpp
@@ -30,8 +30,8 @@
#include "settings_config_dialog.h"
+#include "core/config/project_settings.h"
#include "core/os/keyboard.h"
-#include "core/project_settings.h"
#include "editor/debugger/editor_debugger_node.h"
#include "editor_file_system.h"
#include "editor_log.h"
diff --git a/editor/shader_globals_editor.h b/editor/shader_globals_editor.h
index 33f527f314..00b6cdef9f 100644
--- a/editor/shader_globals_editor.h
+++ b/editor/shader_globals_editor.h
@@ -31,7 +31,7 @@
#ifndef SHADER_GLOBALS_EDITOR_H
#define SHADER_GLOBALS_EDITOR_H
-#include "core/undo_redo.h"
+#include "core/object/undo_redo.h"
#include "editor/editor_autoload_settings.h"
#include "editor/editor_data.h"
#include "editor/editor_plugin_settings.h"