diff --git a/classes/deck/deck.gd b/classes/deck/deck.gd index 42e31cf..4528d38 100644 --- a/classes/deck/deck.gd +++ b/classes/deck/deck.gd @@ -158,6 +158,11 @@ func group_nodes(nodes_to_group: Array) -> Deck: if !(connection.keys()[0] in node_ids_to_keep): disconnect_nodes(node, get_node(connection.keys()[0]), from_port, connection.values()[0]) + for to_port: int in node.incoming_connections: + for from_node: String in node.incoming_connections[to_port]: + if !(from_node in node_ids_to_keep): + disconnect_nodes(get_node(from_node), node, node.incoming_connections[to_port].values()[0], to_port) + midpoint += node.position_as_vector2() remove_node(node._id) group.add_node_inst(node, node._id) diff --git a/classes/deck/node_db.gd b/classes/deck/node_db.gd index 93cd551..b9a1d5f 100644 --- a/classes/deck/node_db.gd +++ b/classes/deck/node_db.gd @@ -3,8 +3,8 @@ class_name NodeDB_ ## Filepath used for referencing all [DeckNode] Files from. const BASE_NODE_PATH := "res://classes/deck/nodes/" -## Filepath where an Index of [NodeDB_.NodeDescriptor]s are saved to avoid reloading -## everything each run. +## Filepath where an Index of [NodeDB_.NodeDescriptor]s are saved to avoid reloading +## everything each run. ## @experimental const NODE_INDEX_CACHE_PATH := "user://nodes_index.json" ## Filepath where the the list of Favorite Nodes is stored. @@ -14,11 +14,11 @@ const FAVORITE_NODES_PATH := "user://favorite_nodes.json" var favorite_nodes: Array[String] # Dictionary[node_type, NodeDescriptor] -## [Dictionary] filled with node_type, or [String] keys. Correlating to +## [Dictionary] filled with node_type, or [String] keys. Correlating to ## [NodeDB_.NodeDescriptor]'s. Essentially where all the nodes are loaded in for data reference. var nodes: Dictionary = {} -## Loads in all the [DeckNode]s from [member BASE_NODE_PATH]. Or if a working +## Loads in all the [DeckNode]s from [member BASE_NODE_PATH]. Or if a working ## cache exists at [member NODE_INDEX_CACHE_PATH] that takes priority func _init() -> void: load_favorites() @@ -69,7 +69,7 @@ func save_node_index() -> void: var f := FileAccess.open(NODE_INDEX_CACHE_PATH, FileAccess.WRITE) f.store_string(json) -## Loads the Node Index from [member NODE_INDEX_CACHE_PATH] adding all of the +## Loads the Node Index from [member NODE_INDEX_CACHE_PATH] adding all of the ## [NodeDB_.NodeDescriptor]s in it to the [member nodes] [Dictionary] func load_node_index() -> bool: var f := FileAccess.open(NODE_INDEX_CACHE_PATH, FileAccess.READ) @@ -90,7 +90,7 @@ func load_node_index() -> bool: print("node index file exists, loaded") return true -## Sets a specific [member DeckNode.node_type] to be a "favorite" for use in +## Sets a specific [member DeckNode.node_type] to be a "favorite" for use in ## [AddNodeMenu]. Then stores the updated list of favorites at [member FAVORITE_NODES_PATH] func set_node_favorite(node_type: String, favorite: bool) -> void: if (favorite && node_type in favorite_nodes) || (!favorite && !(node_type in favorite_nodes)): @@ -113,14 +113,14 @@ func load_favorites() -> void: favorite_nodes.clear() favorite_nodes.assign(data) -## Returns [code]true[/code] if the specified [member DeckNode.node_type] is marked Favorite +## Returns [code]true[/code] if the specified [member DeckNode.node_type] is marked Favorite ## by the user. func is_node_favorite(node_type: String) -> bool: return node_type in favorite_nodes ## Used for storing the shorthand data of a [DeckNode]. ## -## Allows for more simply storing [DeckNode]s properties without needing to +## Allows for more simply storing [DeckNode]s properties without needing to ## keep an instance class NodeDescriptor: ## Default Name of the [DeckNode] type this is storing properties of. @@ -135,10 +135,10 @@ class NodeDescriptor: var category: String ## The description of the [DeckNode] reference [member DeckNode.appears_in_search] var appears_in_search: bool - + ## Stores the path to this nodes [Script] in res:// for later instantiation. var script_path: String - + func _init( p_script_path: String, p_name: String, @@ -170,7 +170,7 @@ class NodeDescriptor: } return d - ## Creates a [NodeDB_.NodeDescriptor] from a given [Dictionary] of properties. + ## Creates a [NodeDB_.NodeDescriptor] from a given [Dictionary] of properties. static func from_dictionary(data: Dictionary) -> NodeDescriptor: var nd := NodeDescriptor.new( data.get("script_path", ""),