summaryrefslogtreecommitdiff
path: root/editor/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'editor/plugins')
-rw-r--r--editor/plugins/sprite_frames_editor_plugin.cpp27
-rw-r--r--editor/plugins/visual_shader_editor_plugin.cpp1
2 files changed, 19 insertions, 9 deletions
diff --git a/editor/plugins/sprite_frames_editor_plugin.cpp b/editor/plugins/sprite_frames_editor_plugin.cpp
index 3350cec912..9013eaf9d8 100644
--- a/editor/plugins/sprite_frames_editor_plugin.cpp
+++ b/editor/plugins/sprite_frames_editor_plugin.cpp
@@ -821,19 +821,30 @@ void SpriteFramesEditor::_update_library(bool p_skip_selector) {
for (int i = 0; i < frames->get_frame_count(edited_anim); i++) {
String name;
- Ref<Texture2D> icon;
+ Ref<Texture> frame = frames->get_frame(edited_anim, i);
- if (frames->get_frame(edited_anim, i).is_null()) {
+ if (frame.is_null()) {
name = itos(i) + ": " + TTR("(empty)");
-
} else {
- name = itos(i) + ": " + frames->get_frame(edited_anim, i)->get_name();
- icon = frames->get_frame(edited_anim, i);
+ name = itos(i) + ": " + frame->get_name();
}
- tree->add_item(name, icon);
- if (frames->get_frame(edited_anim, i).is_valid()) {
- tree->set_item_tooltip(tree->get_item_count() - 1, frames->get_frame(edited_anim, i)->get_path());
+ tree->add_item(name, frame);
+ if (frame.is_valid()) {
+ String tooltip = frame->get_path();
+
+ // Frame is often saved as an AtlasTexture subresource within a scene/resource file,
+ // thus its path might be not what the user is looking for. So we're also showing
+ // subsequent source texture paths.
+ String prefix = String::utf8("┖╴");
+ Ref<AtlasTexture> at = frame;
+ while (at.is_valid() && at->get_atlas().is_valid()) {
+ tooltip += "\n" + prefix + at->get_atlas()->get_path();
+ prefix = " " + prefix;
+ at = at->get_atlas();
+ }
+
+ tree->set_item_tooltip(tree->get_item_count() - 1, tooltip);
}
if (sel == i) {
tree->select(tree->get_item_count() - 1);
diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp
index e0f08b3574..c4fda0231c 100644
--- a/editor/plugins/visual_shader_editor_plugin.cpp
+++ b/editor/plugins/visual_shader_editor_plugin.cpp
@@ -4496,7 +4496,6 @@ VisualShaderEditor::VisualShaderEditor() {
add_options.push_back(AddOption("ObjectPosition", "Input", "Fog", "VisualShaderNodeInput", vformat(input_param_for_fog_shader_mode, "object_position"), "object_position", VisualShaderNode::PORT_TYPE_VECTOR, TYPE_FLAGS_FOG, Shader::MODE_FOG));
add_options.push_back(AddOption("UVW", "Input", "Fog", "VisualShaderNodeInput", vformat(input_param_for_fog_shader_mode, "uvw"), "uvw", VisualShaderNode::PORT_TYPE_VECTOR, TYPE_FLAGS_FOG, Shader::MODE_FOG));
add_options.push_back(AddOption("Extents", "Input", "Fog", "VisualShaderNodeInput", vformat(input_param_for_fog_shader_mode, "extents"), "extents", VisualShaderNode::PORT_TYPE_VECTOR, TYPE_FLAGS_FOG, Shader::MODE_FOG));
- add_options.push_back(AddOption("Transform", "Input", "Fog", "VisualShaderNodeInput", vformat(input_param_for_fog_shader_mode, "transform"), "transform", VisualShaderNode::PORT_TYPE_TRANSFORM, TYPE_FLAGS_FOG, Shader::MODE_FOG));
add_options.push_back(AddOption("SDF", "Input", "Fog", "VisualShaderNodeInput", vformat(input_param_for_fog_shader_mode, "sdf"), "sdf", VisualShaderNode::PORT_TYPE_SCALAR, TYPE_FLAGS_FOG, Shader::MODE_FOG));
add_options.push_back(AddOption("Time", "Input", "Fog", "VisualShaderNodeInput", vformat(input_param_for_fog_shader_mode, "time"), "time", VisualShaderNode::PORT_TYPE_SCALAR, TYPE_FLAGS_FOG, Shader::MODE_FOG));