32 lines
874 B
GDScript
Executable File
32 lines
874 B
GDScript
Executable File
@tool
|
|
class_name AnimationActionNode
|
|
extends "res://addons/cutscene_editor/editor/nodes/BaseGraphNode.gd"
|
|
|
|
# Node for AnimationAction
|
|
|
|
func _init() -> void:
|
|
node_type = "animation"
|
|
name = "animation_" + str(randi())
|
|
title = "Animation"
|
|
modulate = Color(0.8, 0.4, 0.8) # Purple
|
|
|
|
# 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["animation_name"] = ""
|
|
action_parameters["loop"] = false
|
|
|
|
func _on_character_changed(new_text: String) -> void:
|
|
set_parameter("character", new_text)
|
|
|
|
func _on_animation_changed(new_text: String) -> void:
|
|
set_parameter("animation_name", new_text)
|
|
|
|
func _on_loop_toggled(button_pressed: bool) -> void:
|
|
set_parameter("loop", button_pressed)
|