1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

Add UID to file tooltip

This commit is contained in:
kobewi
2025-04-05 22:00:30 +02:00
parent a210fe6dbd
commit 7d186cb28e

View File

@@ -30,6 +30,7 @@
#include "editor_resource_tooltip_plugins.h"
#include "editor/editor_file_system.h"
#include "editor/editor_resource_preview.h"
#include "editor/themes/editor_scale.h"
#include "scene/gui/box_container.h"
@@ -63,6 +64,12 @@ VBoxContainer *EditorResourceTooltipPlugin::make_default_tooltip(const String &p
vb->add_child(label);
}
ResourceUID::ID id = EditorFileSystem::get_singleton()->get_file_uid(p_resource_path);
if (id != ResourceUID::INVALID_ID) {
Label *label = memnew(Label(ResourceUID::get_singleton()->id_to_text(id)));
vb->add_child(label);
}
{
Ref<FileAccess> f = FileAccess::open(p_resource_path, FileAccess::READ);
Label *label = memnew(Label(vformat(TTR("Size: %s"), String::humanize_size(f->get_length()))));