Skip to content

Commit

Permalink
[plugin|licenses] Add hint if a referenced path does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
IceflowRE committed Sep 25, 2023
1 parent aeb03e4 commit 5a315d1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions addons/licenses/internal/components_tree.gd
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,15 @@ func _add_tree_item(component: Component, idx: int, parent: TreeItem) -> TreeIte
tooltip += "\n- no license"
if component.copyright.is_empty():
tooltip += "\n- no copyright"
var path_missing: bool = false
for path in component.paths:
if FileAccess.file_exists(path) || DirAccess.dir_exists_absolute(path):
continue
if !path_missing:
tooltip += "\n- referenced path do not exist"
tooltip += "\n - " + path
path_missing = true

if tooltip != component.name:
item.set_icon(0, self.get_theme_icon("NodeWarning", "EditorIcons"))
item.set_tooltip_text(0, tooltip)
Expand Down
Loading

0 comments on commit 5a315d1

Please sign in to comment.