Browse Source

actually added the example

Jonathan Higgins 7 months ago
parent
commit
fa0f22fc21
3 changed files with 41 additions and 0 deletions
  1. 17 0
      graph_node.gd
  2. 1 0
      graph_node.gd.uid
  3. 23 0
      node_test.tscn

+ 17 - 0
graph_node.gd

@@ -0,0 +1,17 @@
+extends GraphNode
+
+
+# Called when the node enters the scene tree for the first time.
+func _ready() -> void:
+	var titlebar = self.get_titlebar_hbox()
+	var btn = Button.new()
+	btn.text = "?"
+	btn.connect("pressed", Callable(self, "_open_help").bind("help_pressed")) #pass key (process name) when button is pressed
+	titlebar.add_child(btn)
+
+# Called every frame. 'delta' is the elapsed time since the previous frame.
+func _process(delta: float) -> void:
+	pass
+
+func _open_help(key: String):
+	print(key)

+ 1 - 0
graph_node.gd.uid

@@ -0,0 +1 @@
+uid://b362lflsl8oov

+ 23 - 0
node_test.tscn

@@ -0,0 +1,23 @@
+[gd_scene load_steps=2 format=3 uid="uid://0o42n3yf5uah"]
+
+[ext_resource type="Script" uid="uid://b362lflsl8oov" path="res://graph_node.gd" id="1_h6fog"]
+
+[node name="GraphNode" type="GraphNode"]
+offset_left = 230.0
+offset_top = 100.0
+offset_right = 621.0
+offset_bottom = 543.0
+title = "TestNode"
+slot/0/left_enabled = false
+slot/0/left_type = 0
+slot/0/left_color = Color(1, 1, 1, 1)
+slot/0/left_icon = null
+slot/0/right_enabled = false
+slot/0/right_type = 0
+slot/0/right_color = Color(1, 1, 1, 1)
+slot/0/right_icon = null
+slot/0/draw_stylebox = true
+script = ExtResource("1_h6fog")
+
+[node name="Control" type="Control" parent="."]
+layout_mode = 2