33 lines
922 B
GDScript
Executable File
33 lines
922 B
GDScript
Executable File
@tool
|
|
class_name DialogueActionNode
|
|
extends "res://addons/cutscene_editor/editor/nodes/BaseGraphNode.gd"
|
|
|
|
# Node for DialogueAction
|
|
|
|
func _init() -> void:
|
|
node_type = "dialogue"
|
|
name = "dialogue_" + str(randi())
|
|
title = "Dialogue"
|
|
modulate = Color(1.0, 1.0, 0.5) # Yellow
|
|
resizable=true
|
|
# 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["character"] = ""
|
|
action_parameters["text"] = ""
|
|
action_parameters["duration"] = 0.0
|
|
|
|
func _on_character_changed(new_text: String) -> void:
|
|
set_parameter("character", new_text)
|
|
|
|
func _on_text_changed(new_text: String) -> void:
|
|
set_parameter("text", new_text)
|
|
|
|
func _on_duration_changed(new_text: String) -> void:
|
|
var value = float(new_text) if new_text.is_valid_float() else 0.0
|
|
set_parameter("duration", value)
|