summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
Diffstat (limited to 'editor')
-rw-r--r--editor/code_editor.cpp2
-rw-r--r--editor/create_dialog.cpp23
-rw-r--r--editor/debugger/editor_debugger_inspector.cpp10
-rw-r--r--editor/debugger/editor_debugger_inspector.h1
-rw-r--r--editor/doc_data.cpp11
-rw-r--r--editor/doc_data.h7
-rw-r--r--editor/editor_export.cpp19
-rw-r--r--editor/editor_export.h2
-rw-r--r--editor/editor_help.cpp4
-rw-r--r--editor/editor_node.cpp21
-rw-r--r--editor/editor_node.h2
-rw-r--r--editor/editor_plugin.cpp7
-rw-r--r--editor/editor_plugin.h1
-rw-r--r--editor/editor_properties.cpp103
-rw-r--r--editor/import/editor_scene_importer_gltf.cpp6
-rw-r--r--editor/import/editor_scene_importer_gltf.h3
-rw-r--r--editor/import/resource_importer_layered_texture.cpp2
-rw-r--r--editor/import/resource_importer_texture_atlas.cpp3
-rw-r--r--editor/plugins/canvas_item_editor_plugin.cpp54
-rw-r--r--editor/plugins/canvas_item_editor_plugin.h1
-rw-r--r--editor/plugins/debugger_editor_plugin.cpp7
-rw-r--r--editor/plugins/node_3d_editor_plugin.cpp27
-rw-r--r--editor/plugins/node_3d_editor_plugin.h4
-rw-r--r--editor/plugins/script_editor_plugin.cpp1
-rw-r--r--editor/plugins/script_text_editor.cpp23
-rw-r--r--editor/plugins/tile_map_editor_plugin.cpp16
-rw-r--r--editor/plugins/tile_map_editor_plugin.h1
-rw-r--r--editor/plugins/tile_set_editor_plugin.cpp33
-rw-r--r--editor/plugins/tile_set_editor_plugin.h1
-rw-r--r--editor/project_export.cpp1
-rw-r--r--editor/property_editor.cpp29
-rw-r--r--editor/property_editor.h2
-rw-r--r--editor/scene_tree_dock.cpp4
33 files changed, 307 insertions, 124 deletions
diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp
index 3ea970a0f0..9888013ce6 100644
--- a/editor/code_editor.cpp
+++ b/editor/code_editor.cpp
@@ -657,7 +657,7 @@ FindReplaceBar::FindReplaceBar() {
// be handled too late if they weren't handled here.
void CodeTextEditor::_input(const Ref<InputEvent> &event) {
const Ref<InputEventKey> key_event = event;
- if (!key_event.is_valid() || !key_event->is_pressed()) {
+ if (!key_event.is_valid() || !key_event->is_pressed() || !text_editor->has_focus()) {
return;
}
diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp
index 75fff03297..e4a853dbd7 100644
--- a/editor/create_dialog.cpp
+++ b/editor/create_dialog.cpp
@@ -53,13 +53,15 @@ void CreateDialog::popup_create(bool p_dont_clear, bool p_replace_mode, const St
if (f) {
TreeItem *root = recent->create_item();
+ String icon_fallback = search_options->has_theme_icon(base_type, "EditorIcons") ? base_type : "Object";
+
while (!f->eof_reached()) {
String l = f->get_line().strip_edges();
String name = l.split(" ")[0];
if ((ClassDB::class_exists(name) || ScriptServer::is_global_class(name)) && !_is_class_disabled_by_feature_profile(name)) {
TreeItem *ti = recent->create_item(root);
ti->set_text(0, l);
- ti->set_icon(0, EditorNode::get_singleton()->get_class_icon(l, base_type));
+ ti->set_icon(0, EditorNode::get_singleton()->get_class_icon(name, icon_fallback));
}
}
@@ -248,7 +250,8 @@ void CreateDialog::add_type(const String &p_type, HashMap<String, TreeItem *> &p
const String &description = DTR(EditorHelp::get_doc_data()->class_list[p_type].brief_description);
item->set_tooltip(0, description);
- item->set_icon(0, EditorNode::get_singleton()->get_class_icon(p_type, base_type));
+ String icon_fallback = search_options->has_theme_icon(base_type, "EditorIcons") ? base_type : "Object";
+ item->set_icon(0, EditorNode::get_singleton()->get_class_icon(p_type, icon_fallback));
p_types[p_type] = item;
}
@@ -305,9 +308,8 @@ void CreateDialog::_update_search() {
EditorData &ed = EditorNode::get_editor_data();
root->set_text(0, base_type);
- if (search_options->has_theme_icon(base_type, "EditorIcons")) {
- root->set_icon(0, search_options->get_theme_icon(base_type, "EditorIcons"));
- }
+ String base_icon = search_options->has_theme_icon(base_type, "EditorIcons") ? base_type : "Object";
+ root->set_icon(0, search_options->get_theme_icon(base_icon, "EditorIcons"));
TreeItem *to_select = search_box->get_text() == base_type ? root : nullptr;
@@ -393,9 +395,7 @@ void CreateDialog::_update_search() {
TreeItem *item = search_options->create_item(ti);
item->set_metadata(0, type);
item->set_text(0, ct[i].name);
- if (ct[i].icon.is_valid()) {
- item->set_icon(0, ct[i].icon);
- }
+ item->set_icon(0, ct[i].icon.is_valid() ? ct[i].icon : search_options->get_theme_icon(base_icon, "EditorIcons"));
if (!to_select || ct[i].name == search_box->get_text()) {
to_select = item;
@@ -598,16 +598,21 @@ void CreateDialog::_save_favorite_list() {
void CreateDialog::_update_favorite_list() {
favorites->clear();
+
TreeItem *root = favorites->create_item();
+
+ String icon_fallback = search_options->has_theme_icon(base_type, "EditorIcons") ? base_type : "Object";
+
for (int i = 0; i < favorite_list.size(); i++) {
String l = favorite_list[i];
String name = l.split(" ")[0];
if (!((ClassDB::class_exists(name) || ScriptServer::is_global_class(name)) && !_is_class_disabled_by_feature_profile(name))) {
continue;
}
+
TreeItem *ti = favorites->create_item(root);
ti->set_text(0, l);
- ti->set_icon(0, EditorNode::get_singleton()->get_class_icon(l, base_type));
+ ti->set_icon(0, EditorNode::get_singleton()->get_class_icon(name, icon_fallback));
}
emit_signal("favorites_updated");
}
diff --git a/editor/debugger/editor_debugger_inspector.cpp b/editor/debugger/editor_debugger_inspector.cpp
index 125439d09b..dcd7220ed0 100644
--- a/editor/debugger/editor_debugger_inspector.cpp
+++ b/editor/debugger/editor_debugger_inspector.cpp
@@ -153,12 +153,9 @@ ObjectID EditorDebuggerInspector::add_object(const Array &p_arr) {
if (path.find("::") != -1) {
// built-in resource
String base_path = path.get_slice("::", 0);
- if (ResourceLoader::get_resource_type(base_path) == "PackedScene") {
- if (!EditorNode::get_singleton()->is_scene_open(base_path)) {
- EditorNode::get_singleton()->load_scene(base_path);
- }
- } else {
- EditorNode::get_singleton()->load_resource(base_path);
+ RES dependency = ResourceLoader::load(base_path);
+ if (dependency.is_valid()) {
+ remote_dependencies.insert(dependency);
}
}
var = ResourceLoader::load(path);
@@ -211,6 +208,7 @@ void EditorDebuggerInspector::clear_cache() {
memdelete(E->value());
}
remote_objects.clear();
+ remote_dependencies.clear();
}
Object *EditorDebuggerInspector::get_object(ObjectID p_id) {
diff --git a/editor/debugger/editor_debugger_inspector.h b/editor/debugger/editor_debugger_inspector.h
index 638dee3c3f..7d13a4c362 100644
--- a/editor/debugger/editor_debugger_inspector.h
+++ b/editor/debugger/editor_debugger_inspector.h
@@ -69,6 +69,7 @@ class EditorDebuggerInspector : public EditorInspector {
private:
ObjectID inspected_object_id;
Map<ObjectID, EditorDebuggerRemoteObject *> remote_objects;
+ Set<RES> remote_dependencies;
EditorDebuggerRemoteObject *variables;
void _object_selected(ObjectID p_object);
diff --git a/editor/doc_data.cpp b/editor/doc_data.cpp
index 53641da0e9..c52d91b03d 100644
--- a/editor/doc_data.cpp
+++ b/editor/doc_data.cpp
@@ -881,9 +881,14 @@ Error DocData::_load(Ref<XMLParser> parser) {
String name3 = parser->get_node_name();
if (name3 == "link") {
+ TutorialDoc tutorial;
+ if (parser->has_attribute("title")) {
+ tutorial.title = parser->get_attribute_value("title");
+ }
parser->read();
if (parser->get_node_type() == XMLParser::NODE_TEXT) {
- c.tutorials.push_back(parser->get_node_data().strip_edges());
+ tutorial.link = parser->get_node_data().strip_edges();
+ c.tutorials.push_back(tutorial);
}
} else {
ERR_FAIL_V_MSG(ERR_FILE_CORRUPT, "Invalid tag in doc file: " + name3 + ".");
@@ -1055,7 +1060,9 @@ Error DocData::save_classes(const String &p_default_path, const Map<String, Stri
_write_string(f, 1, "<tutorials>");
for (int i = 0; i < c.tutorials.size(); i++) {
- _write_string(f, 2, "<link>" + c.tutorials.get(i).xml_escape() + "</link>");
+ TutorialDoc tutorial = c.tutorials.get(i);
+ String title_attribute = (!tutorial.title.empty()) ? " title=\"" + tutorial.title.xml_escape() + "\"" : "";
+ _write_string(f, 2, "<link" + title_attribute + ">" + tutorial.link.xml_escape() + "</link>");
}
_write_string(f, 1, "</tutorials>");
diff --git a/editor/doc_data.h b/editor/doc_data.h
index 8c93bfa597..1880be81ed 100644
--- a/editor/doc_data.h
+++ b/editor/doc_data.h
@@ -82,13 +82,18 @@ public:
}
};
+ struct TutorialDoc {
+ String link;
+ String title;
+ };
+
struct ClassDoc {
String name;
String inherits;
String category;
String brief_description;
String description;
- Vector<String> tutorials;
+ Vector<TutorialDoc> tutorials;
Vector<MethodDoc> methods;
Vector<MethodDoc> signals;
Vector<ConstantDoc> constants;
diff --git a/editor/editor_export.cpp b/editor/editor_export.cpp
index 716ead9afc..25594bf7c8 100644
--- a/editor/editor_export.cpp
+++ b/editor/editor_export.cpp
@@ -90,6 +90,19 @@ Ref<EditorExportPlatform> EditorExportPreset::get_platform() const {
return platform;
}
+void EditorExportPreset::update_files_to_export() {
+ Vector<String> to_remove;
+ for (Set<String>::Element *E = selected_files.front(); E; E = E->next()) {
+ if (!FileAccess::exists(E->get())) {
+ to_remove.push_back(E->get());
+ }
+ }
+ for (int i = 0; i < to_remove.size(); ++i) {
+ selected_files.erase(to_remove[i]);
+ }
+ EditorExport::singleton->save_presets();
+}
+
Vector<String> EditorExportPreset::get_files_to_export() const {
Vector<String> files;
for (Set<String>::Element *E = selected_files.front(); E; E = E->next()) {
@@ -1298,7 +1311,11 @@ void EditorExport::load_config() {
Vector<String> files = config->get_value(section, "export_files");
for (int i = 0; i < files.size(); i++) {
- preset->add_export_file(files[i]);
+ if (!FileAccess::exists(files[i])) {
+ preset->remove_export_file(files[i]);
+ } else {
+ preset->add_export_file(files[i]);
+ }
}
}
diff --git a/editor/editor_export.h b/editor/editor_export.h
index 4978b39248..8ad8326f10 100644
--- a/editor/editor_export.h
+++ b/editor/editor_export.h
@@ -94,6 +94,8 @@ public:
bool has(const StringName &p_property) const { return values.has(p_property); }
+ void update_files_to_export();
+
Vector<String> get_files_to_export() const;
void add_export_file(const String &p_path);
diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp
index 30cf7d1e7a..bad2203423 100644
--- a/editor/editor_help.cpp
+++ b/editor/editor_help.cpp
@@ -480,8 +480,8 @@ void EditorHelp::_update_doc() {
class_desc->add_newline();
for (int i = 0; i < cd.tutorials.size(); i++) {
- const String link = DTR(cd.tutorials[i]);
- String linktxt = link;
+ const String link = DTR(cd.tutorials[i].link);
+ String linktxt = (cd.tutorials[i].title.empty()) ? link : DTR(cd.tutorials[i].title);
const int seppos = linktxt.find("//");
if (seppos != -1) {
linktxt = link.right(seppos + 2);
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index 8b7014fabe..9a9a1bfdeb 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -619,7 +619,9 @@ void EditorNode::_fs_changed() {
preset.unref();
}
if (preset.is_null()) {
- export_error = vformat("Invalid export preset name: %s.", preset_name);
+ export_error = vformat(
+ "Invalid export preset name: %s. Make sure `export_presets.cfg` is present in the current directory.",
+ preset_name);
} else {
Ref<EditorExportPlatform> platform = preset->get_platform();
if (platform.is_null()) {
@@ -903,19 +905,19 @@ void EditorNode::_dialog_display_load_error(String p_file, Error p_error) {
if (p_error) {
switch (p_error) {
case ERR_CANT_OPEN: {
- show_accept(vformat(TTR("Can't open '%s'. The file could have been moved or deleted."), p_file.get_file()), TTR("OK"));
+ show_accept(vformat(TTR("Can't open file '%s'. The file could have been moved or deleted."), p_file.get_file()), TTR("OK"));
} break;
case ERR_PARSE_ERROR: {
- show_accept(vformat(TTR("Error while parsing '%s'."), p_file.get_file()), TTR("OK"));
+ show_accept(vformat(TTR("Error while parsing file '%s'."), p_file.get_file()), TTR("OK"));
} break;
case ERR_FILE_CORRUPT: {
- show_accept(vformat(TTR("Unexpected end of file '%s'."), p_file.get_file()), TTR("OK"));
+ show_accept(vformat(TTR("Scene file '%s' appears to be invalid/corrupt."), p_file.get_file()), TTR("OK"));
} break;
case ERR_FILE_NOT_FOUND: {
- show_accept(vformat(TTR("Missing '%s' or its dependencies."), p_file.get_file()), TTR("OK"));
+ show_accept(vformat(TTR("Missing file '%s' or one its dependencies."), p_file.get_file()), TTR("OK"));
} break;
default: {
- show_accept(vformat(TTR("Error while loading '%s'."), p_file.get_file()), TTR("OK"));
+ show_accept(vformat(TTR("Error while loading file '%s'."), p_file.get_file()), TTR("OK"));
} break;
}
}
@@ -3254,13 +3256,13 @@ Error EditorNode::load_scene(const String &p_scene, bool p_ignore_broken_deps, b
if (!new_scene) {
sdata.unref();
- _dialog_display_load_error(lpath, ERR_FILE_NOT_FOUND);
+ _dialog_display_load_error(lpath, ERR_FILE_CORRUPT);
opening_prev = false;
if (prev != -1) {
set_current_scene(prev);
editor_data.remove_scene(idx);
}
- return ERR_FILE_NOT_FOUND;
+ return ERR_FILE_CORRUPT;
}
if (p_set_inherited) {
@@ -4782,7 +4784,7 @@ void EditorNode::set_distraction_free_mode(bool p_enter) {
}
}
-bool EditorNode::get_distraction_free_mode() const {
+bool EditorNode::is_distraction_free_mode_enabled() const {
return distraction_free->is_pressed();
}
@@ -6568,6 +6570,7 @@ EditorNode::EditorNode() {
gui_base->add_child(load_error_dialog);
execute_outputs = memnew(RichTextLabel);
+ execute_outputs->set_selection_enabled(true);
execute_output_dialog = memnew(AcceptDialog);
execute_output_dialog->add_child(execute_outputs);
execute_output_dialog->set_title("");
diff --git a/editor/editor_node.h b/editor/editor_node.h
index dfe3d91c07..7c9cf44d6c 100644
--- a/editor/editor_node.h
+++ b/editor/editor_node.h
@@ -693,7 +693,7 @@ public:
bool get_docks_visible() const;
void set_distraction_free_mode(bool p_enter);
- bool get_distraction_free_mode() const;
+ bool is_distraction_free_mode_enabled() const;
void add_control_to_dock(DockSlot p_slot, Control *p_control);
void remove_control_from_dock(Control *p_control);
diff --git a/editor/editor_plugin.cpp b/editor/editor_plugin.cpp
index 2365090f03..6d93e92555 100644
--- a/editor/editor_plugin.cpp
+++ b/editor/editor_plugin.cpp
@@ -270,6 +270,10 @@ void EditorInterface::set_distraction_free_mode(bool p_enter) {
EditorNode::get_singleton()->set_distraction_free_mode(p_enter);
}
+bool EditorInterface::is_distraction_free_mode_enabled() const {
+ return EditorNode::get_singleton()->is_distraction_free_mode_enabled();
+}
+
EditorInterface *EditorInterface::singleton = nullptr;
void EditorInterface::_bind_methods() {
@@ -302,6 +306,9 @@ void EditorInterface::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_main_screen_editor", "name"), &EditorInterface::set_main_screen_editor);
ClassDB::bind_method(D_METHOD("set_distraction_free_mode", "enter"), &EditorInterface::set_distraction_free_mode);
+ ClassDB::bind_method(D_METHOD("is_distraction_free_mode_enabled"), &EditorInterface::is_distraction_free_mode_enabled);
+
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "distraction_free_mode"), "set_distraction_free_mode", "is_distraction_free_mode_enabled");
}
EditorInterface::EditorInterface() {
diff --git a/editor/editor_plugin.h b/editor/editor_plugin.h
index 2792c8bf19..aac36bfdfd 100644
--- a/editor/editor_plugin.h
+++ b/editor/editor_plugin.h
@@ -105,6 +105,7 @@ public:
void set_main_screen_editor(const String &p_name);
void set_distraction_free_mode(bool p_enter);
+ bool is_distraction_free_mode_enabled() const;
EditorInterface();
};
diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp
index 81c4e48974..cfa0c7a063 100644
--- a/editor/editor_properties.cpp
+++ b/editor/editor_properties.cpp
@@ -581,6 +581,7 @@ public:
Vector<Rect2> flag_rects;
Vector<String> names;
Vector<String> tooltips;
+ int hovered_index;
virtual Size2 get_minimum_size() const {
Ref<Font> font = get_theme_font("font", "Label");
@@ -596,56 +597,79 @@ public:
return String();
}
void _gui_input(const Ref<InputEvent> &p_ev) {
- Ref<InputEventMouseButton> mb = p_ev;
- if (mb.is_valid() && mb->get_button_index() == BUTTON_LEFT && mb->is_pressed()) {
+ const Ref<InputEventMouseMotion> mm = p_ev;
+
+ if (mm.is_valid()) {
for (int i = 0; i < flag_rects.size(); i++) {
- if (flag_rects[i].has_point(mb->get_position())) {
- //toggle
- if (value & (1 << i)) {
- value &= ~(1 << i);
- } else {
- value |= (1 << i);
- }
- emit_signal("flag_changed", value);
+ if (flag_rects[i].has_point(mm->get_position())) {
+ // Used to highlight the hovered flag in the layers grid.
+ hovered_index = i;
update();
+ break;
}
}
}
- }
- void _notification(int p_what) {
- if (p_what == NOTIFICATION_DRAW) {
- Rect2 rect;
- rect.size = get_size();
- flag_rects.clear();
+ const Ref<InputEventMouseButton> mb = p_ev;
- int bsize = (rect.size.height * 80 / 100) / 2;
+ if (mb.is_valid() && mb->get_button_index() == BUTTON_LEFT && mb->is_pressed()) {
+ // Toggle the flag.
+ // We base our choice on the hovered flag, so that it always matches the hovered flag.
+ if (value & (1 << hovered_index)) {
+ value &= ~(1 << hovered_index);
+ } else {
+ value |= (1 << hovered_index);
+ }
- int h = bsize * 2 + 1;
- int vofs = (rect.size.height - h) / 2;
+ emit_signal("flag_changed", value);
+ update();
+ }
+ }
- Color color = get_theme_color("highlight_color", "Editor");
- for (int i = 0; i < 2; i++) {
- Point2 ofs(4, vofs);
- if (i == 1) {
- ofs.y += bsize + 1;
- }
+ void _notification(int p_what) {
+ switch (p_what) {
+ case NOTIFICATION_DRAW: {
+ Rect2 rect;
+ rect.size = get_size();
+ flag_rects.clear();
+
+ const int bsize = (rect.size.height * 80 / 100) / 2;
+ const int h = bsize * 2 + 1;
+ const int vofs = (rect.size.height - h) / 2;
+
+ Color color = get_theme_color("highlight_color", "Editor");
+ for (int i = 0; i < 2; i++) {
+ Point2 ofs(4, vofs);
+ if (i == 1)
+ ofs.y += bsize + 1;
+
+ ofs += rect.position;
+ for (int j = 0; j < 10; j++) {
+ Point2 o = ofs + Point2(j * (bsize + 1), 0);
+ if (j >= 5)
+ o.x += 1;
+
+ const int idx = i * 10 + j;
+ const bool on = value & (1 << idx);
+ Rect2 rect2 = Rect2(o, Size2(bsize, bsize));
+
+ color.a = on ? 0.6 : 0.2;
+ if (idx == hovered_index) {
+ // Add visual feedback when hovering a flag.
+ color.a += 0.15;
+ }
- ofs += rect.position;
- for (int j = 0; j < 10; j++) {
- Point2 o = ofs + Point2(j * (bsize + 1), 0);
- if (j >= 5) {
- o.x += 1;
+ draw_rect(rect2, color);
+ flag_rects.push_back(rect2);
}
-
- uint32_t idx = i * 10 + j;
- bool on = value & (1 << idx);
- Rect2 rect2 = Rect2(o, Size2(bsize, bsize));
- color.a = on ? 0.6 : 0.2;
- draw_rect(rect2, color);
- flag_rects.push_back(rect2);
}
- }
+ } break;
+ case NOTIFICATION_MOUSE_EXIT: {
+ hovered_index = -1;
+ update();
+ } break;
+ default:
+ break;
}
}
@@ -661,6 +685,7 @@ public:
EditorPropertyLayersGrid() {
value = 0;
+ hovered_index = -1; // Nothing is hovered.
}
};
void EditorPropertyLayers::_grid_changed(uint32_t p_grid) {
@@ -752,7 +777,7 @@ EditorPropertyLayers::EditorPropertyLayers() {
hb->add_child(grid);
button = memnew(Button);
button->set_toggle_mode(true);
- button->set_text("..");
+ button->set_text("...");
button->connect("pressed", callable_mp(this, &EditorPropertyLayers::_button_pressed));
hb->add_child(button);
set_bottom_editor(hb);
diff --git a/editor/import/editor_scene_importer_gltf.cpp b/editor/import/editor_scene_importer_gltf.cpp
index 6ffff09ce5..e340f41e3b 100644
--- a/editor/import/editor_scene_importer_gltf.cpp
+++ b/editor/import/editor_scene_importer_gltf.cpp
@@ -952,6 +952,9 @@ Error EditorSceneImporterGLTF::_parse_meshes(GLTFState &state) {
return OK;
}
+ bool compress_vert_data = state.import_flags & IMPORT_USE_COMPRESSION;
+ uint32_t mesh_flags = compress_vert_data ? Mesh::ARRAY_COMPRESS_DEFAULT : 0;
+
Array meshes = state.json["meshes"];
for (GLTFMeshIndex i = 0; i < meshes.size(); i++) {
print_verbose("glTF: Parsing mesh: " + itos(i));
@@ -1206,7 +1209,7 @@ Error EditorSceneImporterGLTF::_parse_meshes(GLTFState &state) {
}
//just add it
- mesh.mesh->add_surface_from_arrays(primitive, array, morphs);
+ mesh.mesh->add_surface_from_arrays(primitive, array, morphs, Dictionary(), mesh_flags);
if (p.has("material")) {
const int material = p["material"];
@@ -2951,6 +2954,7 @@ Node *EditorSceneImporterGLTF::import_scene(const String &p_path, uint32_t p_fla
String version = asset["version"];
+ state.import_flags = p_flags;
state.major_version = version.get_slice(".", 0).to_int();
state.minor_version = version.get_slice(".", 1).to_int();
state.use_named_skin_binds = p_flags & IMPORT_USE_NAMED_SKIN_BINDS;
diff --git a/editor/import/editor_scene_importer_gltf.h b/editor/import/editor_scene_importer_gltf.h
index eee978ce16..d45410fa57 100644
--- a/editor/import/editor_scene_importer_gltf.h
+++ b/editor/import/editor_scene_importer_gltf.h
@@ -279,6 +279,9 @@ class EditorSceneImporterGLTF : public EditorSceneImporter {
Map<GLTFNodeIndex, Node *> scene_nodes;
+ // EditorSceneImporter::ImportFlags
+ uint32_t import_flags;
+
~GLTFState() {
for (int i = 0; i < nodes.size(); i++) {
memdelete(nodes[i]);
diff --git a/editor/import/resource_importer_layered_texture.cpp b/editor/import/resource_importer_layered_texture.cpp
index 1f39a12c25..b57ea3745d 100644
--- a/editor/import/resource_importer_layered_texture.cpp
+++ b/editor/import/resource_importer_layered_texture.cpp
@@ -134,7 +134,7 @@ String ResourceImporterLayeredTexture::get_preset_name(int p_idx) const {
}
void ResourceImporterLayeredTexture::get_import_options(List<ImportOption> *r_options, int p_preset) const {
- r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "compress/mode", PROPERTY_HINT_ENUM, "Lossless,Lossy,Video RAM,Uncompressed,Basis Universal", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED), 1));
+ r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "compress/mode", PROPERTY_HINT_ENUM, "Lossless (PNG),Lossy (WebP),Video RAM (S3TC/ETC/BPTC),Uncompressed,Basis Universal", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED), 1));
r_options->push_back(ImportOption(PropertyInfo(Variant::FLOAT, "compress/lossy_quality", PROPERTY_HINT_RANGE, "0,1,0.01"), 0.7));
r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "compress/hdr_compression", PROPERTY_HINT_ENUM, "Disabled,Opaque Only,Always"), 1));
r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "compress/bptc_ldr", PROPERTY_HINT_ENUM, "Disabled,Enabled,RGBA Only"), 0));
diff --git a/editor/import/resource_importer_texture_atlas.cpp b/editor/import/resource_importer_texture_atlas.cpp
index 2848d13160..2423553d22 100644
--- a/editor/import/resource_importer_texture_atlas.cpp
+++ b/editor/import/resource_importer_texture_atlas.cpp
@@ -130,7 +130,8 @@ static void _plot_triangle(Vector2 *vertices, const Vector2 &p_offset, bool p_tr
double dx_low = double(x[2] - x[1]) / (y[2] - y[1] + 1);
double xf = x[0];
double xt = x[0] + dx_upper; // if y[0] == y[1], special case
- for (int yi = y[0]; yi <= (y[2] > height - 1 ? height - 1 : y[2]); yi++) {
+ int max_y = MIN(y[2], height - p_offset.y - 1);
+ for (int yi = y[0]; yi <= max_y; yi++) {
if (yi >= 0) {
for (int xi = (xf > 0 ? int(xf) : 0); xi <= (xt < width ? xt : width - 1); xi++) {
int px = xi, py = yi;
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp
index 573876c488..2f7080b1a5 100644
--- a/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/editor/plugins/canvas_item_editor_plugin.cpp
@@ -54,8 +54,10 @@
#include "scene/main/window.h"
#include "scene/resources/packed_scene.h"
-#define MIN_ZOOM 0.01
-#define MAX_ZOOM 100
+// Min and Max are power of two in order to play nicely with successive increment.
+// That way, we can naturally reach a 100% zoom from boundaries.
+#define MIN_ZOOM 1. / 128
+#define MAX_ZOOM 128
#define RULER_WIDTH (15 * EDSCALE)
#define SCALE_HANDLE_DISTANCE 25
@@ -87,7 +89,6 @@ public:
GridContainer *child_container;
set_title(TTR("Configure Snap"));
- get_ok()->set_text(TTR("Close"));
container = memnew(VBoxContainer);
add_child(container);
@@ -1214,7 +1215,11 @@ bool CanvasItemEditor::_gui_input_zoom_or_pan(const Ref<InputEvent> &p_event, bo
view_offset.y += int(EditorSettings::get_singleton()->get("editors/2d/pan_speed")) / zoom * b->get_factor();
update_viewport();
} else {
- _zoom_on_position(zoom * (1 - (0.05 * b->get_factor())), b->get_position());
+ float new_zoom = _get_next_zoom_value(-1);
+ if (b->get_factor() != 1.f) {
+ new_zoom = zoom * ((new_zoom / zoom - 1.f) * b->get_factor() + 1.f);
+ }
+ _zoom_on_position(new_zoom, b->get_position());
}
return true;
}
@@ -1225,7 +1230,11 @@ bool CanvasItemEditor::_gui_input_zoom_or_pan(const Ref<InputEvent> &p_event, bo
view_offset.y -= int(EditorSettings::get_singleton()->get("editors/2d/pan_speed")) / zoom * b->get_factor();
update_viewport();
} else {
- _zoom_on_position(zoom * ((0.95 + (0.05 * b->get_factor())) / 0.95), b->get_position());
+ float new_zoom = _get_next_zoom_value(1);
+ if (b->get_factor() != 1.f) {
+ new_zoom = zoom * ((new_zoom / zoom - 1.f) * b->get_factor() + 1.f);
+ }
+ _zoom_on_position(new_zoom, b->get_position());
}
return true;
}
@@ -4334,8 +4343,37 @@ void CanvasItemEditor::_set_anchors_preset(Control::LayoutPreset p_preset) {
undo_redo->commit_action();
}
+float CanvasItemEditor::_get_next_zoom_value(int p_increment_count) const {
+ // Base increment factor defined as the twelveth root of two.
+ // This allow a smooth geometric evolution of the zoom, with the advantage of
+ // visiting all integer power of two scale factors.
+ // note: this is analogous to the 'semitones' interval in the music world
+ // In order to avoid numerical imprecisions, we compute and edit a zoom index
+ // with the following relation: zoom = 2 ^ (index / 12)
+
+ if (zoom < CMP_EPSILON || p_increment_count == 0) {
+ return 1.f;
+ }
+
+ // Remove Editor scale from the index computation
+ float zoom_noscale = zoom / MAX(1, EDSCALE);
+
+ // zoom = 2**(index/12) => log2(zoom) = index/12
+ float closest_zoom_index = Math::round(Math::log(zoom_noscale) * 12.f / Math::log(2.f));
+
+ float new_zoom_index = closest_zoom_index + p_increment_count;
+ float new_zoom = Math::pow(2.f, new_zoom_index / 12.f);
+
+ // Restore Editor scale transformation
+ new_zoom *= MAX(1, EDSCALE);
+
+ return new_zoom;
+}
+
void CanvasItemEditor::_zoom_on_position(float p_zoom, Point2 p_position) {
- if (p_zoom < MIN_ZOOM || p_zoom > MAX_ZOOM) {
+ p_zoom = CLAMP(p_zoom, MIN_ZOOM, MAX_ZOOM);
+
+ if (p_zoom == zoom) {
return;
}
@@ -4377,7 +4415,7 @@ void CanvasItemEditor::_update_zoom_label() {
}
void CanvasItemEditor::_button_zoom_minus() {
- _zoom_on_position(zoom / Math_SQRT2, viewport_scrollable->get_size() / 2.0);
+ _zoom_on_position(_get_next_zoom_value(-6), viewport_scrollable->get_size() / 2.0);
}
void CanvasItemEditor::_button_zoom_reset() {
@@ -4385,7 +4423,7 @@ void CanvasItemEditor::_button_zoom_reset() {
}
void CanvasItemEditor::_button_zoom_plus() {
- _zoom_on_position(zoom * Math_SQRT2, viewport_scrollable->get_size() / 2.0);
+ _zoom_on_position(_get_next_zoom_value(6), viewport_scrollable->get_size() / 2.0);
}
void CanvasItemEditor::_button_toggle_smart_snap(bool p_status) {
diff --git a/editor/plugins/canvas_item_editor_plugin.h b/editor/plugins/canvas_item_editor_plugin.h
index a686c98f65..765d5f81d0 100644
--- a/editor/plugins/canvas_item_editor_plugin.h
+++ b/editor/plugins/canvas_item_editor_plugin.h
@@ -528,6 +528,7 @@ private:
VBoxContainer *controls_vb;
HBoxContainer *zoom_hb;
+ float _get_next_zoom_value(int p_increment_count) const;
void _zoom_on_position(float p_zoom, Point2 p_position = Point2());
void _update_zoom_label();
void _button_zoom_minus();
diff --git a/editor/plugins/debugger_editor_plugin.cpp b/editor/plugins/debugger_editor_plugin.cpp
index 0ca479555d..0a4d173923 100644
--- a/editor/plugins/debugger_editor_plugin.cpp
+++ b/editor/plugins/debugger_editor_plugin.cpp
@@ -68,13 +68,10 @@ DebuggerEditorPlugin::DebuggerEditorPlugin(EditorNode *p_editor, MenuButton *p_d
p->add_check_shortcut(ED_SHORTCUT("editor/visible_navigation", TTR("Visible Navigation")), RUN_DEBUG_NAVIGATION);
p->set_item_tooltip(p->get_item_count() - 1, TTR("Navigation meshes and polygons will be visible on the running game if this option is turned on."));
p->add_separator();
- //those are now on by default, since they are harmless
p->add_check_shortcut(ED_SHORTCUT("editor/sync_scene_changes", TTR("Sync Scene Changes")), RUN_LIVE_DEBUG);
p->set_item_tooltip(p->get_item_count() - 1, TTR("When this option is turned on, any changes made to the scene in the editor will be replicated in the running game.\nWhen used remotely on a device, this is more efficient with network filesystem."));
- p->set_item_checked(p->get_item_count() - 1, true);
p->add_check_shortcut(ED_SHORTCUT("editor/sync_script_changes", TTR("Sync Script Changes")), RUN_RELOAD_SCRIPTS);
p->set_item_tooltip(p->get_item_count() - 1, TTR("When this option is turned on, any script that is saved will be reloaded on the running game.\nWhen used remotely on a device, this is more efficient with network filesystem."));
- p->set_item_checked(p->get_item_count() - 1, true);
// Multi-instance, start/stop
instances_menu = memnew(PopupMenu);
@@ -174,8 +171,8 @@ void DebuggerEditorPlugin::_update_debug_options() {
bool check_file_server = EditorSettings::get_singleton()->get_project_metadata("debug_options", "run_file_server", false);
bool check_debug_collisions = EditorSettings::get_singleton()->get_project_metadata("debug_options", "run_debug_collisons", false);
bool check_debug_navigation = EditorSettings::get_singleton()->get_project_metadata("debug_options", "run_debug_navigation", false);
- bool check_live_debug = EditorSettings::get_singleton()->get_project_metadata("debug_options", "run_live_debug", false);
- bool check_reload_scripts = EditorSettings::get_singleton()->get_project_metadata("debug_options", "run_reload_scripts", false);
+ bool check_live_debug = EditorSettings::get_singleton()->get_project_metadata("debug_options", "run_live_debug", true);
+ bool check_reload_scripts = EditorSettings::get_singleton()->get_project_metadata("debug_options", "run_reload_scripts", true);
int instances = EditorSettings::get_singleton()->get_project_metadata("debug_options", "run_debug_instances", 1);
if (check_deploy_remote) {
diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp
index f59b4171b4..796dd3f8b2 100644
--- a/editor/plugins/node_3d_editor_plugin.cpp
+++ b/editor/plugins/node_3d_editor_plugin.cpp
@@ -3419,11 +3419,7 @@ void Node3DEditorViewport::reset() {
last_message = "";
name = "";
- cursor.x_rot = 0.5;
- cursor.y_rot = 0.5;
- cursor.distance = 4;
- cursor.region_select = false;
- cursor.pos = Vector3();
+ cursor = Cursor();
_update_name();
}
@@ -3658,15 +3654,19 @@ bool Node3DEditorViewport::_create_instance(Node *parent, String &path, const Po
editor_data->get_undo_redo().add_do_method(ed, "live_debug_instance_node", editor->get_edited_scene()->get_path_to(parent), path, new_name);
editor_data->get_undo_redo().add_undo_method(ed, "live_debug_remove_node", NodePath(String(editor->get_edited_scene()->get_path_to(parent)) + "/" + new_name));
- Transform global_transform;
- Node3D *parent_spatial = Object::cast_to<Node3D>(parent);
- if (parent_spatial) {
- global_transform = parent_spatial->get_global_gizmo_transform();
- }
+ Node3D *node3d = Object::cast_to<Node3D>(instanced_scene);
+ if (node3d) {
+ Transform global_transform;
+ Node3D *parent_node3d = Object::cast_to<Node3D>(parent);
+ if (parent_node3d) {
+ global_transform = parent_node3d->get_global_gizmo_transform();
+ }
- global_transform.origin = spatial_editor->snap_point(_get_instance_position(p_point));
+ global_transform.origin = spatial_editor->snap_point(_get_instance_position(p_point));
+ global_transform.basis *= node3d->get_transform().basis;
- editor_data->get_undo_redo().add_do_method(instanced_scene, "set_global_transform", global_transform);
+ editor_data->get_undo_redo().add_do_method(instanced_scene, "set_global_transform", global_transform);
+ }
return true;
}
@@ -5397,6 +5397,9 @@ void Node3DEditor::_update_gizmos_menu() {
const int plugin_state = gizmo_plugins_by_name[i]->get_state();
gizmos_menu->add_multistate_item(TTR(plugin_name), 3, plugin_state, i);
const int idx = gizmos_menu->get_item_index(i);
+ gizmos_menu->set_item_tooltip(
+ idx,
+ TTR("Click to toggle between visibility states.\n\nOpen eye: Gizmo is visible.\nClosed eye: Gizmo is hidden.\nHalf-open eye: Gizmo is also visible through opaque surfaces (\"x-ray\")."));
switch (plugin_state) {
case EditorNode3DGizmoPlugin::VISIBLE:
gizmos_menu->set_item_icon(idx, gizmos_menu->get_theme_icon("visibility_visible"));
diff --git a/editor/plugins/node_3d_editor_plugin.h b/editor/plugins/node_3d_editor_plugin.h
index 32b087c372..83173b5ad2 100644
--- a/editor/plugins/node_3d_editor_plugin.h
+++ b/editor/plugins/node_3d_editor_plugin.h
@@ -391,7 +391,9 @@ private:
Point2 region_begin, region_end;
Cursor() {
- x_rot = y_rot = 0.5;
+ // These rotations place the camera in +X +Y +Z, aka south east, facing north west.
+ x_rot = 0.5;
+ y_rot = -0.5;
distance = 4;
region_select = false;
}
diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp
index 8d6dac3907..48a9febcf9 100644
--- a/editor/plugins/script_editor_plugin.cpp
+++ b/editor/plugins/script_editor_plugin.cpp
@@ -837,7 +837,6 @@ void ScriptEditor::_file_dialog_action(String p_file) {
Error err;
FileAccess *file = FileAccess::open(p_file, FileAccess::WRITE, &err);
if (err) {
- memdelete(file);
editor->show_warning(TTR("Error writing TextFile:") + "\n" + p_file, TTR("Error!"));
break;
}
diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp
index e7f8a56e5e..4b79d8c344 100644
--- a/editor/plugins/script_text_editor.cpp
+++ b/editor/plugins/script_text_editor.cpp
@@ -609,6 +609,18 @@ void ScriptTextEditor::_validate_script() {
for (List<ScriptLanguage::Warning>::Element *E = warnings.front(); E; E = E->next()) {
ScriptLanguage::Warning w = E->get();
+ Dictionary ignore_meta;
+ ignore_meta["line"] = w.line;
+ ignore_meta["code"] = w.string_code.to_lower();
+ warnings_panel->push_cell();
+ warnings_panel->push_meta(ignore_meta);
+ warnings_panel->push_color(
+ warnings_panel->get_theme_color("accent_color", "Editor").lerp(warnings_panel->get_theme_color("mono_color", "Editor"), 0.5));
+ warnings_panel->add_text(TTR("[Ignore]"));
+ warnings_panel->pop(); // Color.
+ warnings_panel->pop(); // Meta ignore.
+ warnings_panel->pop(); // Cell.
+
warnings_panel->push_cell();
warnings_panel->push_meta(w.line - 1);
warnings_panel->push_color(warnings_panel->get_theme_color("warning_color", "Editor"));
@@ -621,15 +633,6 @@ void ScriptTextEditor::_validate_script() {
warnings_panel->push_cell();
warnings_panel->add_text(w.message);
warnings_panel->pop(); // Cell.
-
- Dictionary ignore_meta;
- ignore_meta["line"] = w.line;
- ignore_meta["code"] = w.string_code.to_lower();
- warnings_panel->push_cell();
- warnings_panel->push_meta(ignore_meta);
- warnings_panel->add_text(TTR("(ignore)"));
- warnings_panel->pop(); // Meta ignore.
- warnings_panel->pop(); // Cell.
}
warnings_panel->pop(); // Table.
@@ -1747,6 +1750,8 @@ ScriptTextEditor::ScriptTextEditor() {
warnings_panel = memnew(RichTextLabel);
editor_box->add_child(warnings_panel);
+ warnings_panel->add_theme_font_override(
+ "normal_font", EditorNode::get_singleton()->get_gui_base()->get_theme_font("main", "EditorFonts"));
warnings_panel->set_custom_minimum_size(Size2(0, 100 * EDSCALE));
warnings_panel->set_h_size_flags(SIZE_EXPAND_FILL);
warnings_panel->set_meta_underline(true);
diff --git a/editor/plugins/tile_map_editor_plugin.cpp b/editor/plugins/tile_map_editor_plugin.cpp
index 6c037f94a0..3281a59c1c 100644
--- a/editor/plugins/tile_map_editor_plugin.cpp
+++ b/editor/plugins/tile_map_editor_plugin.cpp
@@ -194,6 +194,21 @@ void TileMapEditor::_palette_multi_selected(int index, bool selected) {
_update_palette();
}
+void TileMapEditor::_palette_input(const Ref<InputEvent> &p_event) {
+ const Ref<InputEventMouseButton> mb = p_event;
+
+ // Zoom in/out using Ctrl + mouse wheel.
+ if (mb.is_valid() && mb->is_pressed() && mb->get_command()) {
+ if (mb->is_pressed() && mb->get_button_index() == BUTTON_WHEEL_UP) {
+ size_slider->set_value(size_slider->get_value() + 0.2);
+ }
+
+ if (mb->is_pressed() && mb->get_button_index() == BUTTON_WHEEL_DOWN) {
+ size_slider->set_value(size_slider->get_value() - 0.2);
+ }
+ }
+}
+
void TileMapEditor::_canvas_mouse_enter() {
mouse_over = true;
CanvasItemEditor::get_singleton()->update_viewport();
@@ -1913,6 +1928,7 @@ TileMapEditor::TileMapEditor(EditorNode *p_editor) {
palette->add_theme_constant_override("vseparation", 8 * EDSCALE);
palette->connect("item_selected", callable_mp(this, &TileMapEditor::_palette_selected));
palette->connect("multi_selected", callable_mp(this, &TileMapEditor::_palette_multi_selected));
+ palette->connect("gui_input", callable_mp(this, &TileMapEditor::_palette_input));
palette_container->add_child(palette);
// Add message for when no texture is selected.
diff --git a/editor/plugins/tile_map_editor_plugin.h b/editor/plugins/tile_map_editor_plugin.h
index 5f82d7bfb8..e25e2d2add 100644
--- a/editor/plugins/tile_map_editor_plugin.h
+++ b/editor/plugins/tile_map_editor_plugin.h
@@ -182,6 +182,7 @@ class TileMapEditor : public VBoxContainer {
void _menu_option(int p_option);
void _palette_selected(int index);
void _palette_multi_selected(int index, bool selected);
+ void _palette_input(const Ref<InputEvent> &p_event);
Dictionary _create_cell_dictionary(int tile, bool flip_x, bool flip_y, bool transpose, Vector2 autotile_coord);
void _start_undo(const String &p_action);
diff --git a/editor/plugins/tile_set_editor_plugin.cpp b/editor/plugins/tile_set_editor_plugin.cpp
index 644facd5bd..b3d4b391d3 100644
--- a/editor/plugins/tile_set_editor_plugin.cpp
+++ b/editor/plugins/tile_set_editor_plugin.cpp
@@ -569,6 +569,7 @@ TileSetEditor::TileSetEditor(EditorNode *p_editor) {
scroll = memnew(ScrollContainer);
main_vb->add_child(scroll);
scroll->set_v_size_flags(SIZE_EXPAND_FILL);
+ scroll->connect("gui_input", callable_mp(this, &TileSetEditor::_on_scroll_container_input));
scroll->set_clip_contents(true);
empty_message = memnew(Label);
@@ -1198,6 +1199,27 @@ bool TileSetEditor::is_within_grabbing_distance_of_first_point(const Vector2 &p_
return distance < p_grab_threshold;
}
+void TileSetEditor::_on_scroll_container_input(const Ref<InputEvent> &p_event) {
+ const Ref<InputEventMouseButton> mb = p_event;
+
+ if (mb.is_valid()) {
+ // Zoom in/out using Ctrl + mouse wheel. This is done on the ScrollContainer
+ // to allow performing this action anywhere, even if the cursor isn't
+ // hovering the texture in the workspace.
+ if (mb->get_button_index() == BUTTON_WHEEL_UP && mb->is_pressed() && mb->get_control()) {
+ print_line("zooming in");
+ _zoom_in();
+ // Don't scroll up after zooming in.
+ accept_event();
+ } else if (mb->get_button_index() == BUTTON_WHEEL_DOWN && mb->is_pressed() && mb->get_control()) {
+ print_line("zooming out");
+ _zoom_out();
+ // Don't scroll down after zooming out.
+ accept_event();
+ }
+ }
+}
+
void TileSetEditor::_on_workspace_input(const Ref<InputEvent> &p_ie) {
if (tileset.is_null() || !get_current_texture().is_valid()) {
return;
@@ -1214,8 +1236,8 @@ void TileSetEditor::_on_workspace_input(const Ref<InputEvent> &p_ie) {
}
current_tile_region.position += WORKSPACE_MARGIN;
- Ref<InputEventMouseButton> mb = p_ie;
- Ref<InputEventMouseMotion> mm = p_ie;
+ const Ref<InputEventMouseButton> mb = p_ie;
+ const Ref<InputEventMouseMotion> mm = p_ie;
if (mb.is_valid()) {
if (mb->is_pressed() && mb->get_button_index() == BUTTON_LEFT && !creating_shape) {
@@ -1239,13 +1261,6 @@ void TileSetEditor::_on_workspace_input(const Ref<InputEvent> &p_ie) {
delete tiles;
}
}
-
- // Mouse Wheel Event
- if (mb->get_button_index() == BUTTON_WHEEL_UP && mb->is_pressed() && mb->get_control()) {
- _zoom_in();
- } else if (mb->get_button_index() == BUTTON_WHEEL_DOWN && mb->is_pressed() && mb->get_control()) {
- _zoom_out();
- }
}
// Drag Middle Mouse
if (mm.is_valid()) {
diff --git a/editor/plugins/tile_set_editor_plugin.h b/editor/plugins/tile_set_editor_plugin.h
index 827325cfd7..2955dda244 100644
--- a/editor/plugins/tile_set_editor_plugin.h
+++ b/editor/plugins/tile_set_editor_plugin.h
@@ -200,6 +200,7 @@ private:
void _on_workspace_overlay_draw();
void _on_workspace_draw();
void _on_workspace_process();
+ void _on_scroll_container_input(const Ref<InputEvent> &p_event);
void _on_workspace_input(const Ref<InputEvent> &p_ie);
void _on_tool_clicked(int p_tool);
void _on_priority_changed(float val);
diff --git a/editor/project_export.cpp b/editor/project_export.cpp
index e5372a5d47..c53a59604a 100644
--- a/editor/project_export.cpp
+++ b/editor/project_export.cpp
@@ -163,6 +163,7 @@ void ProjectExportDialog::_update_presets() {
if (preset->is_runnable()) {
name += " (" + TTR("Runnable") + ")";
}
+ preset->update_files_to_export();
presets->add_item(name, preset->get_platform()->get_logo());
}
diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp
index c6efcc944b..49b9ca167b 100644
--- a/editor/property_editor.cpp
+++ b/editor/property_editor.cpp
@@ -326,6 +326,9 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant::
menu->set_size(Size2(1, 1) * EDSCALE);
for (int i = 0; i < MAX_VALUE_EDITORS; i++) {
+ if (i < MAX_VALUE_EDITORS / 4) {
+ value_hboxes[i]->hide();
+ }
value_editor[i]->hide();
value_label[i]->hide();
if (i < 4) {
@@ -1701,6 +1704,14 @@ void CustomPropertyEditor::config_value_editors(int p_amount, int p_columns, int
set_size(Size2(cell_margin + p_label_w + (cell_width + cell_margin + p_label_w) * p_columns, cell_margin + (cell_height + cell_margin) * rows) * EDSCALE);
for (int i = 0; i < MAX_VALUE_EDITORS; i++) {
+ if (i < MAX_VALUE_EDITORS / 4) {
+ if (i <= p_amount / 4) {
+ value_hboxes[i]->show();
+ } else {
+ value_hboxes[i]->hide();
+ }
+ }
+
int c = i % p_columns;
int r = i / p_columns;
@@ -1729,13 +1740,23 @@ CustomPropertyEditor::CustomPropertyEditor() {
read_only = false;
updating = false;
+ value_vbox = memnew(VBoxContainer);
+ add_child(value_vbox);
+
for (int i = 0; i < MAX_VALUE_EDITORS; i++) {
- value_editor[i] = memnew(LineEdit);
- add_child(value_editor[i]);
+ if (i < MAX_VALUE_EDITORS / 4) {
+ value_hboxes[i] = memnew(HBoxContainer);
+ value_vbox->add_child(value_hboxes[i]);
+ value_hboxes[i]->hide();
+ }
+ int hbox_idx = i / 4;
value_label[i] = memnew(Label);
- add_child(value_label[i]);
- value_editor[i]->hide();
+ value_hboxes[hbox_idx]->add_child(value_label[i]);
value_label[i]->hide();
+ value_editor[i] = memnew(LineEdit);
+ value_hboxes[hbox_idx]->add_child(value_editor[i]);
+ value_editor[i]->set_h_size_flags(Control::SIZE_EXPAND_FILL);
+ value_editor[i]->hide();
value_editor[i]->connect("text_entered", callable_mp(this, &CustomPropertyEditor::_modified));
value_editor[i]->connect("focus_entered", callable_mp(this, &CustomPropertyEditor::_focus_enter));
value_editor[i]->connect("focus_exited", callable_mp(this, &CustomPropertyEditor::_focus_exit));
diff --git a/editor/property_editor.h b/editor/property_editor.h
index 5b7db3b83f..75c6fd372b 100644
--- a/editor/property_editor.h
+++ b/editor/property_editor.h
@@ -100,6 +100,8 @@ class CustomPropertyEditor : public PopupPanel {
List<String> field_names;
int hint;
String hint_text;
+ HBoxContainer *value_hboxes[MAX_VALUE_EDITORS / 4];
+ VBoxContainer *value_vbox;
LineEdit *value_editor[MAX_VALUE_EDITORS];
int focused_value_editor;
Label *value_label[MAX_VALUE_EDITORS];
diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp
index c37d32b26b..5795d85e66 100644
--- a/editor/scene_tree_dock.cpp
+++ b/editor/scene_tree_dock.cpp
@@ -2658,7 +2658,9 @@ void SceneTreeDock::_remote_tree_selected() {
}
void SceneTreeDock::_local_tree_selected() {
- scene_tree->show();
+ if (!bool(EDITOR_GET("interface/editors/show_scene_tree_root_selection")) || get_tree()->get_edited_scene_root() != nullptr) {
+ scene_tree->show();
+ }
if (remote_tree) {
remote_tree->hide();
}