feat: updated engine
This commit is contained in:
parent
cbe99774ff
commit
f4cf6b3999
6607 changed files with 910135 additions and 430025 deletions
|
|
@ -30,14 +30,18 @@
|
|||
|
||||
#include "editor_debugger_tree.h"
|
||||
|
||||
#include "core/io/resource_saver.h"
|
||||
#include "core/object/callable_mp.h"
|
||||
#include "core/object/class_db.h"
|
||||
#include "editor/debugger/editor_debugger_node.h"
|
||||
#include "editor/docks/inspector_dock.h"
|
||||
#include "editor/docks/scene_tree_dock.h"
|
||||
#include "editor/editor_node.h"
|
||||
#include "editor/editor_string_names.h"
|
||||
#include "editor/gui/editor_file_dialog.h"
|
||||
#include "editor/gui/editor_toaster.h"
|
||||
#include "editor/settings/editor_settings.h"
|
||||
#include "scene/debugger/scene_debugger.h"
|
||||
#include "scene/debugger/scene_debugger_object.h"
|
||||
#include "scene/gui/texture_rect.h"
|
||||
#include "scene/resources/packed_scene.h"
|
||||
#include "servers/display/display_server.h"
|
||||
|
|
@ -58,6 +62,7 @@ EditorDebuggerTree::EditorDebuggerTree() {
|
|||
add_child(file_dialog);
|
||||
|
||||
accept = memnew(AcceptDialog);
|
||||
accept->set_flag(Window::FLAG_RESIZE_DISABLED, true);
|
||||
add_child(accept);
|
||||
}
|
||||
|
||||
|
|
@ -279,18 +284,15 @@ void EditorDebuggerTree::update_scene_tree(const SceneDebuggerTree *p_tree, int
|
|||
if (debugger_id == p_debugger) { // Can use remote id.
|
||||
if (inspected_object_ids.has(uint64_t(node.id))) {
|
||||
ids_present.append(node.id);
|
||||
|
||||
if (selection_uncollapse_all) {
|
||||
selection_uncollapse_all = false;
|
||||
|
||||
// Temporarily set to `false`, to allow caching the unfolds.
|
||||
updating_scene_tree = false;
|
||||
item->uncollapse_tree();
|
||||
updating_scene_tree = true;
|
||||
}
|
||||
|
||||
select_items.push_back(item);
|
||||
if (should_scroll) {
|
||||
// Temporarily set to `false`, to allow caching the unfolds.
|
||||
updating_scene_tree = false;
|
||||
// Expand ancestors to make the item visible.
|
||||
if (TreeItem *parent_item = item->get_parent()) {
|
||||
parent_item->uncollapse_tree();
|
||||
}
|
||||
updating_scene_tree = true;
|
||||
scroll_item = item;
|
||||
}
|
||||
}
|
||||
|
|
@ -412,10 +414,18 @@ void EditorDebuggerTree::update_scene_tree(const SceneDebuggerTree *p_tree, int
|
|||
|
||||
void EditorDebuggerTree::select_nodes(const TypedArray<int64_t> &p_ids) {
|
||||
// Manually select, as the tree control may be out-of-date for some reason (e.g. not shown yet).
|
||||
selection_uncollapse_all = true;
|
||||
inspected_object_ids = p_ids;
|
||||
scrolling_to_item = true;
|
||||
|
||||
// If we have not previously selected any of these items, expand the inspector's properties for this item.
|
||||
for (ObjectID id : p_ids) {
|
||||
if (!selection_cache.has(id)) {
|
||||
selection_cache.insert(id);
|
||||
|
||||
InspectorDock::get_inspector_singleton()->expand_all_folding();
|
||||
}
|
||||
}
|
||||
|
||||
if (!updating_scene_tree) {
|
||||
// Request a tree refresh.
|
||||
EditorDebuggerNode::get_singleton()->request_remote_tree();
|
||||
|
|
@ -471,6 +481,11 @@ Variant EditorDebuggerTree::get_drag_data(const Point2 &p_point) {
|
|||
return vformat("\"%s\"", path);
|
||||
}
|
||||
|
||||
void EditorDebuggerTree::set_new_session() {
|
||||
new_session = true;
|
||||
selection_cache.clear();
|
||||
}
|
||||
|
||||
void EditorDebuggerTree::update_icon_max_width() {
|
||||
add_theme_constant_override("icon_max_width", get_theme_constant("class_icon_size", EditorStringName(Editor)));
|
||||
}
|
||||
|
|
@ -504,16 +519,12 @@ void EditorDebuggerTree::_item_menu_id_pressed(int p_option) {
|
|||
String text = get_selected_path();
|
||||
if (text.is_empty()) {
|
||||
return;
|
||||
} else if (text == "/root") {
|
||||
}
|
||||
// Keep full remote path but strip the "/root" prefix for user-facing copy.
|
||||
if (text == "/root") {
|
||||
text = ".";
|
||||
} else {
|
||||
text = text.replace("/root/", "");
|
||||
int slash = text.find_char('/');
|
||||
if (slash < 0) {
|
||||
text = ".";
|
||||
} else {
|
||||
text = text.substr(slash + 1);
|
||||
}
|
||||
} else if (text.begins_with("/root/")) {
|
||||
text = text.substr(String("/root/").length());
|
||||
}
|
||||
DisplayServer::get_singleton()->clipboard_set(text);
|
||||
} break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue