If resource name set, show it instead of path

This commit is contained in:
don-tnowe 2023-07-22 07:54:39 +03:00
parent 0be896b40f
commit a7b7bce4e4

View File

@ -26,11 +26,12 @@ func set_value(node : Control, value):
if !value is Resource: return
node.editor_description = value.resource_path
node.get_node("Box/Label").text = (
"[" + value.resource_path.get_file().get_basename() + "]"
if value.resource_name == "" else
value.resource_name
)
if value.resource_name == "":
node.get_node("Box/Label").text = "[" + value.resource_path.get_file().get_basename() + "]"
else:
node.get_node("Box/Label").text = value.resource_name
if value is Texture:
node.get_node("Box/Tex").visible = true
node.get_node("Box/Tex").texture = value