Simplified pick value applying, timeline node added

This commit is contained in:
The 64th Gamer 2025-04-08 04:30:16 -06:00
parent 9a5b9e6601
commit 917eb8d1c9
17 changed files with 92 additions and 36 deletions

View file

@ -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"]

View file

@ -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

View file

@ -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

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -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")

View file

@ -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")

View file

@ -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")

View file

@ -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"]

View file

@ -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:

View file

@ -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"]

View file

@ -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):

View file

@ -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

View file

@ -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")

17
Scripts/GL_Timeline.gd Normal file
View file

@ -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")

View file

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