diff --git a/Scenes/Node Types/Timeline.tscn b/Scenes/Node Types/Timeline.tscn new file mode 100644 index 0000000..3fb2368 --- /dev/null +++ b/Scenes/Node Types/Timeline.tscn @@ -0,0 +1,17 @@ +[gd_scene load_steps=3 format=3 uid="uid://bh0jvghfbjita"] + +[ext_resource type="PackedScene" uid="uid://b0arjg8r75f8y" path="res://Scenes/Nodes/Node.tscn" id="1_1cicv"] +[ext_resource type="Script" uid="uid://bmayx1doxjhg1" path="res://Scripts/GL_Timeline.gd" id="2_1cicv"] + +[node name="Node" type="Control"] +layout_mode = 3 +anchors_preset = 0 +mouse_filter = 1 + +[node name="Node" parent="." groups=["GL Node"] instance=ExtResource("1_1cicv")] +layout_mode = 0 +tooltip_text = "Generates a time that always counts up. 'Play' toggle determines if it counts or not. 'Rewind' determines if playback is in reverse. 'Restart' sets time back to 0." +script = ExtResource("2_1cicv") + +[connection signal="mouse_entered" from="Node" to="Node" method="mouse_enter"] +[connection signal="mouse_exited" from="Node" to="Node" method="mouse_exit"] diff --git a/Scenes/Nodes/Node Add.tscn b/Scenes/Nodes/Node Add.tscn new file mode 100644 index 0000000..753bff7 --- /dev/null +++ b/Scenes/Nodes/Node Add.tscn @@ -0,0 +1,14 @@ +[gd_scene format=3 uid="uid://bwvshov2sptun"] + +[node name="OptionButton" type="OptionButton"] +offset_right = 68.0 +offset_bottom = 31.0 +selected = 0 +allow_reselect = true +item_count = 3 +popup/item_0/text = "+Add Float" +popup/item_0/id = 0 +popup/item_1/text = "+Add Bool" +popup/item_1/id = 1 +popup/item_2/text = "+Add Color" +popup/item_2/id = 2 diff --git a/Scenes/UI/Search Row.tscn b/Scenes/UI/Search Row.tscn index 68595c9..d92b653 100644 --- a/Scenes/UI/Search Row.tscn +++ b/Scenes/UI/Search Row.tscn @@ -9,8 +9,3 @@ size_flags_horizontal = 3 text = "The Crazy Node of Crazy" alignment = 0 clip_text = true - -[node name="Label" type="Label" parent="."] -layout_mode = 2 -text = "x3" -horizontal_alignment = 2 diff --git a/Scripts/GL_Float.gd b/Scripts/GL_Float.gd index 9b59f8d..25afcdb 100644 --- a/Scripts/GL_Float.gd +++ b/Scripts/GL_Float.gd @@ -1,9 +1,10 @@ extends GL_Node func _ready(): + super._ready() _set_title("Float") _create_row("Output",null,0.0,true,0.0,1) - pass + _update_visuals() func _process(delta): super._process(delta) diff --git a/Scripts/GL_Keystroke_Ramp.gd b/Scripts/GL_Keystroke_Ramp.gd index a8868ab..b9f7fad 100644 --- a/Scripts/GL_Keystroke_Ramp.gd +++ b/Scripts/GL_Keystroke_Ramp.gd @@ -27,9 +27,11 @@ var toggle_to_value = { } func _ready(): + super._ready() _set_title("Keystroke Ramp") _create_row("Output", null, 0.0, false, 0.0, 0) _create_row("Toggle", null, null, true, false, 0) + _update_visuals() func _process(delta): super._process(delta) diff --git a/Scripts/GL_Keystrokes.gd b/Scripts/GL_Keystrokes.gd index c0aa740..2b916ce 100644 --- a/Scripts/GL_Keystrokes.gd +++ b/Scripts/GL_Keystrokes.gd @@ -1,6 +1,7 @@ extends GL_Node func _ready(): + super._ready() _set_title("Keystrokes") _create_row("KEY #1",null,false,false,0.0,1) _create_row("KEY #2",null,false,false,0.0,1) @@ -12,7 +13,8 @@ func _ready(): _create_row("KEY #8",null,false,false,0.0,1) _create_row("KEY #9",null,false,false,0.0,1) _create_row("KEY #0",null,false,false,0.0,1) - pass + _update_visuals() + func _process(delta): super._process(delta) diff --git a/Scripts/GL_Lerp.gd b/Scripts/GL_Lerp.gd index e49492d..ac95de8 100644 --- a/Scripts/GL_Lerp.gd +++ b/Scripts/GL_Lerp.gd @@ -2,17 +2,15 @@ extends GL_Node func _ready(): + super._ready() _set_title("Lerp") _create_row("Value",0.0,0.0,true,0.0,1.0) _create_row("Speed",1.0,null,true,1.0,25.0) - pass + _update_visuals() func _process(delta): super._process(delta) - - for key in rows: - if rows[key]["picker"] == true && rows[key]["backConnected"] == false: - rows[key]["input"] = rows[key]["pickValue"] + apply_pick_values() rows["Value"]["output"] = lerp(float(rows["Value"]["output"]),float(rows["Value"]["input"]),delta * rows["Speed"]["input"]) _send_input("Value") diff --git a/Scripts/GL_Mix_Colors.gd b/Scripts/GL_Mix_Colors.gd index 8998cc9..4a5684b 100644 --- a/Scripts/GL_Mix_Colors.gd +++ b/Scripts/GL_Mix_Colors.gd @@ -1,18 +1,16 @@ extends GL_Node func _ready(): + super._ready() _set_title("Mix Colors") _create_row("Factor",0.0,Color.WHITE,false,null,0) _create_row("Color A",Color.RED,null,true,Color.RED,0) _create_row("Color B",Color.BLUE,null,true,Color.BLUE,0) - pass + _update_visuals() func _process(delta): super._process(delta) - - for key in rows: - if rows[key]["picker"] == true && rows[key]["backConnected"] == false: - rows[key]["input"] = rows[key]["pickValue"] + apply_pick_values() rows["Factor"]["output"] = rows["Color A"]["input"].lerp(rows["Color B"]["input"],rows["Factor"]["input"]) _send_input("Factor") diff --git a/Scripts/GL_Mouse_Wheel.gd b/Scripts/GL_Mouse_Wheel.gd index 751fa6a..13a4fb9 100644 --- a/Scripts/GL_Mouse_Wheel.gd +++ b/Scripts/GL_Mouse_Wheel.gd @@ -1,16 +1,15 @@ extends GL_Node func _ready(): + super._ready() _set_title("Mouse Wheel") _create_row("Output", null, 0.0, false, 0.0, 0) _create_row("Step Size", 0.0, null, true, 0.1, 1.0) + _update_visuals() func _process(delta): super._process(delta) - - for key in rows: - if rows[key]["picker"] == true && rows[key]["backConnected"] == false: - rows[key]["input"] = rows[key]["pickValue"] + apply_pick_values() _send_input("Output") diff --git a/Scripts/GL_Node.gd b/Scripts/GL_Node.gd index 5326ede..3a9831f 100644 --- a/Scripts/GL_Node.gd +++ b/Scripts/GL_Node.gd @@ -5,6 +5,10 @@ var uuid : int #REMEMBER TO SET THIS ON CREATION var dragging : bool var canDrag : bool var dragOffset : Vector2 +var loadNodeRow : Resource + +func _ready(): + loadNodeRow = preload("res://Scenes/Nodes/Node Row.tscn") func _process(delta): if dragging: @@ -29,7 +33,7 @@ func _update_visuals(): if child.name.contains("Node Row"): child.queue_free() for key in rows: - var nodeRow = load("res://Scenes/Nodes/Node Row.tscn").instantiate() + var nodeRow = loadNodeRow.instantiate() holder.add_child(nodeRow) nodeRow.name = "Node Row" (nodeRow.get_node("Label") as Label).text = str(key) @@ -93,7 +97,6 @@ func _set_title(name:String): func _create_row(name:String,input,output,picker:bool,pickDefault,pickFloatMaximum:float): rows[name] = {"input": input, "output": output, "connections": [], "picker":picker,"pickValue":pickDefault,"backConnected":false,"pickFloatMax":pickFloatMaximum} - _update_visuals() func _recieve_input(inputName:String,value): if rows.has(inputName): @@ -170,3 +173,8 @@ func mouse_enter(): canDrag = true func mouse_exit(): canDrag = false + +func apply_pick_values(): + for key in rows: + if rows[key]["picker"] == true && rows[key]["backConnected"] == false: + rows[key]["input"] = rows[key]["pickValue"] diff --git a/Scripts/GL_Output.gd b/Scripts/GL_Output.gd index cdd5420..55b8342 100644 --- a/Scripts/GL_Output.gd +++ b/Scripts/GL_Output.gd @@ -5,6 +5,7 @@ extends GL_Node @export var types : PackedStringArray func _ready(): + super._ready() _set_title(identification) for i in names.size(): match(types[i].to_lower()): @@ -14,14 +15,11 @@ func _ready(): _create_row(str(names[i]),Color.WHITE,null,true,Color.WHITE,0) "bool": _create_row(str(names[i]),false,null,true,false,0) - pass + _update_visuals() func _process(delta): super._process(delta) - - for key in rows: - if rows[key]["picker"] == true && rows[key]["backConnected"] == false: - rows[key]["input"] = rows[key]["pickValue"] + apply_pick_values() for node in get_tree().get_nodes_in_group(identification): if node is GL_Animatable: diff --git a/Scripts/GL_Random.gd b/Scripts/GL_Random.gd index c26c2ae..1213be0 100644 --- a/Scripts/GL_Random.gd +++ b/Scripts/GL_Random.gd @@ -3,17 +3,19 @@ var rng : RandomNumberGenerator var timing : float func _ready(): + super._ready() _set_title("Random") _create_row("Output",null,0.0,false,null,0) _create_row("Time",0.01,null,true,0.01,5) rng = RandomNumberGenerator.new() rng.seed = Time.get_ticks_msec() + _update_visuals() pass func _process(delta): super._process(delta) - if rows["Time"]["picker"] == true && rows["Time"]["backConnected"] == false: - rows["Time"]["input"] = rows["Time"]["pickValue"] + apply_pick_values() + timing -= delta if timing <= 0: timing = rows["Time"]["input"] diff --git a/Scripts/GL_Record.gd b/Scripts/GL_Record.gd index 3858c7b..47d8944 100644 --- a/Scripts/GL_Record.gd +++ b/Scripts/GL_Record.gd @@ -1,9 +1,11 @@ extends GL_Node func _ready(): + super._ready() _set_title("Record") _create_row("Recording",false,null,true,false,0) _create_row("Current Time",0.0,null,false,0,0) + _update_visuals() pass func _process(delta): diff --git a/Scripts/GL_Search.gd b/Scripts/GL_Search.gd index b669838..14c7e0d 100644 --- a/Scripts/GL_Search.gd +++ b/Scripts/GL_Search.gd @@ -1,17 +1,18 @@ extends Control var rows : Dictionary = { - "Sine":99, - "Random":99, - "Float":99, "Chica":1, "ChicaSpot":1, + "Float":1, "Keystrokes":1, "Keystroke Ramp":1, - "Mix Colors":1, "Lerp":1, + "Mix Colors":1, "Mouse Wheel":1, + "Random":1, "Record":1, + "Sine":1, + "Timeline":1, } var searching : bool var lastMousePos : Vector2 diff --git a/Scripts/GL_Sine.gd b/Scripts/GL_Sine.gd index acb1da8..5abcd3c 100644 --- a/Scripts/GL_Sine.gd +++ b/Scripts/GL_Sine.gd @@ -1,14 +1,15 @@ extends GL_Node func _ready(): + super._ready() _set_title("Sine") _create_row("Output",null,0.0,false,null,0) _create_row("Time",0.01,null,true,0.01,0.05) + _update_visuals() pass func _process(delta): super._process(delta) - if rows["Time"]["picker"] == true && rows["Time"]["backConnected"] == false: - rows["Time"]["input"] = rows["Time"]["pickValue"] + apply_pick_values() rows["Output"]["output"] = (sin(Time.get_ticks_msec() * rows["Time"].get("input",1)) / 2) + 0.5 _send_input("Output") diff --git a/Scripts/GL_Timeline.gd b/Scripts/GL_Timeline.gd new file mode 100644 index 0000000..e41854b --- /dev/null +++ b/Scripts/GL_Timeline.gd @@ -0,0 +1,17 @@ +extends GL_Node + +func _ready(): + super._ready() + _set_title("Timeline") + _create_row("Time",null,0.0,false,0,0) + #_create_row("Play Speed",1.0,null,true,1.0,5.0) #Enable when you can default values + _create_row("Play",false,null,true,false,0) + _create_row("Rewind",false,null,true,false,0) + _create_row("Restart",false,null,true,false,0) + _update_visuals() + +func _process(delta): + super._process(delta) + apply_pick_values() + #rows["Output"]["output"] = rows["Output"]["pickValue"] + _send_input("Time") diff --git a/Scripts/GL_Timeline.gd.uid b/Scripts/GL_Timeline.gd.uid new file mode 100644 index 0000000..709fd02 --- /dev/null +++ b/Scripts/GL_Timeline.gd.uid @@ -0,0 +1 @@ +uid://bmayx1doxjhg1