Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions addons/panku_console/modules/variable_tracker/module.gd
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ func _update_project_singleton_files() -> void:

# Check if given node is autoload singleton.
func _is_singleton(node: Node) -> bool:
# Comparing scene file and script file with list of autoload files
# from project settings. I'm not sure that approach hundred percent perfect,
# but it works so far.
if node.scene_file_path in _user_singleton_files:
return true

var script = node.get_script()
if script and (script.get_path() in _user_singleton_files):
return true
if script:
var uid_int := ResourceLoader.get_resource_uid(script.get_path())
var uid := ResourceUID.id_to_text(uid_int)
if (script.get_path() in _user_singleton_files) or (uid in _user_singleton_files):
return true

return false

Expand Down