From 34220c4ad10520ab6583e8a3a6d15fccf101f96f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lera=20Elvo=C3=A9?= Date: Tue, 13 Feb 2024 14:17:05 +0300 Subject: [PATCH] add colors to ports depending on data type --- .../deck_node_renderer_graph_node.gd | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/graph_node_renderer/deck_node_renderer_graph_node.gd b/graph_node_renderer/deck_node_renderer_graph_node.gd index 76f2322..377c594 100644 --- a/graph_node_renderer/deck_node_renderer_graph_node.gd +++ b/graph_node_renderer/deck_node_renderer_graph_node.gd @@ -10,6 +10,15 @@ class_name DeckNodeRendererGraphNode ## are based off. var node: DeckNode +const TYPE_COLORS := { + DeckType.Types.BOOL: Color("#7048e0"), + DeckType.Types.STRING: Color("#dbe048"), + DeckType.Types.NUMERIC: Color("#68e36c"), + DeckType.Types.ARRAY: Color("#e36868"), + DeckType.Types.DICTIONARY: Color("#79ede3"), + DeckType.Types.ANY: Color.WHITE, +} + ## Setups up all the properties based off [member node]. Including looping through ## [method DeckNode.get_all_ports()] and setting up all the descriptors. @@ -191,8 +200,8 @@ func update_port(port: Port) -> void: port.index, port.port_type == DeckNode.PortType.INPUT, port.type, - Color.WHITE, + TYPE_COLORS[port.type], port.port_type == DeckNode.PortType.OUTPUT, port.type, - Color.WHITE, + TYPE_COLORS[port.type], )