Files
experiment-adventure-ai/addons/cutscene_editor/editor/nodes/WaitActionNode.gd
2025-08-01 16:06:32 -07:00

24 lines
642 B
GDScript

@tool
class_name WaitActionNode
extends "res://addons/cutscene_editor/editor/nodes/BaseGraphNode.gd"
# Node for WaitAction
func _init() -> void:
node_type = "wait"
title = "Wait"
modulate = Color(0.7, 0.7, 0.7) # Gray
node_id= "wait_" + str(randi())
# One input and one output connection
var slot = 0
set_slot(slot, true, 0, Color(0, 0, 0), true, 0, Color(0, 0, 0))
func _ready() -> void:
super._ready()
# Initialize default parameters
action_parameters["duration"] = 1.0
func _on_duration_changed(new_text: String) -> void:
var value = float(new_text) if new_text.is_valid_float() else 1.0
set_parameter("duration", value)