-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix InstructionTree and Block circular dependency #182
Conversation
Since 4338632 there's been a circular dependency between InstructionTree and Block that manifests as a script error due to a non-existent resource in a seemingly unrelated object. Several components use InstructionTree.TreeNode including Block, and prior to 4338632 there were no references to any non-native classes. Split out the block tree functions to a new BlockTreeUtil class so that InstructionTree no longer contains references to Block.
This will almost certainly cause conflicts in the decoupling PRs. |
@@ -3,6 +3,7 @@ extends Control | |||
|
|||
const Background = preload("res://addons/block_code/ui/blocks/utilities/background/background.gd") | |||
const BlockCanvas = preload("res://addons/block_code/ui/block_canvas/block_canvas.gd") | |||
const BlockTreeUtil = preload("res://addons/block_code/ui/block_tree_util.gd") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not at all convinced of this name or path. What seemed to be in common in the functions moved was that they were about a tree of Block
nodes. @wnbaum's work completely changes the way this is handled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is going to be changed anyways maybe the current name/path doesn't matter that much?
No problem, we can rebase. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent, this fixes the circular dependency in a decent way with a separate script. I tested it in both the development project and by copying the plugin to a new project and then enabling it. No errors present.
Since 4338632 there's been a circular dependency between InstructionTree and Block that manifests as a script error due to a non-existent resource in a seemingly unrelated object. Several components use InstructionTree.TreeNode including Block, and prior to 4338632 there were no references to any non-native classes. Split out the block tree functions to a new BlockTreeUtil class so that InstructionTree no longer contains references to Block.