25 lines
644 B
GDScript
25 lines
644 B
GDScript
@tool
|
|
class_name WaitActionNode
|
|
extends "res://addons/cutscene_editor/editor/nodes/BaseGraphNode.gd"
|
|
|
|
# Node for WaitAction
|
|
|
|
func _init() -> void:
|
|
node_type = "wait"
|
|
node_id = "wait_" + str(randi())
|
|
title = "Wait"
|
|
modulate = Color(0.7, 0.7, 0.7) # Gray
|
|
|
|
# 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)
|