You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-17 14:11:06 +00:00
Add UID to file tooltip
This commit is contained in:
@@ -30,6 +30,7 @@
|
|||||||
|
|
||||||
#include "editor_resource_tooltip_plugins.h"
|
#include "editor_resource_tooltip_plugins.h"
|
||||||
|
|
||||||
|
#include "editor/editor_file_system.h"
|
||||||
#include "editor/editor_resource_preview.h"
|
#include "editor/editor_resource_preview.h"
|
||||||
#include "editor/themes/editor_scale.h"
|
#include "editor/themes/editor_scale.h"
|
||||||
#include "scene/gui/box_container.h"
|
#include "scene/gui/box_container.h"
|
||||||
@@ -63,6 +64,12 @@ VBoxContainer *EditorResourceTooltipPlugin::make_default_tooltip(const String &p
|
|||||||
vb->add_child(label);
|
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);
|
Ref<FileAccess> f = FileAccess::open(p_resource_path, FileAccess::READ);
|
||||||
Label *label = memnew(Label(vformat(TTR("Size: %s"), String::humanize_size(f->get_length()))));
|
Label *label = memnew(Label(vformat(TTR("Size: %s"), String::humanize_size(f->get_length()))));
|
||||||
|
|||||||
Reference in New Issue
Block a user