improvement

This commit is contained in:
2025-07-31 12:25:46 -07:00
parent 2edf692ce9
commit 2be97ea27c
22 changed files with 1351 additions and 314 deletions

View File

@@ -21,37 +21,6 @@ func _ready() -> void:
action_parameters["animation_name"] = ""
action_parameters["loop"] = false
func _setup_parameter_fields() -> void:
# Character field
var char_label = Label.new()
char_label.text = "Character:"
add_child(char_label)
var char_field = LineEdit.new()
char_field.text = action_parameters["character"]
char_field.connect("text_changed", _on_character_changed)
add_child(char_field)
# Animation name field
var anim_label = Label.new()
anim_label.text = "Animation:"
add_child(anim_label)
var anim_field = LineEdit.new()
anim_field.text = action_parameters["animation_name"]
anim_field.connect("text_changed", _on_animation_changed)
add_child(anim_field)
# Loop checkbox
var loop_label = Label.new()
loop_label.text = "Loop:"
add_child(loop_label)
var loop_checkbox = CheckBox.new()
loop_checkbox.button_pressed = action_parameters["loop"]
loop_checkbox.connect("toggled", _on_loop_toggled)
add_child(loop_checkbox)
func _on_character_changed(new_text: String) -> void:
set_parameter("character", new_text)

View File

@@ -0,0 +1,36 @@
[gd_scene load_steps=2 format=3 uid="uid://animationactionnodetscn"]
[ext_resource type="Script" path="res://addons/cutscene_editor/editor/nodes/AnimationActionNode.gd" id="1_animation"]
[node name="AnimationActionNode" type="GraphNode"]
modulate = Color(0.8, 0.4, 0.8, 1)
custom_minimum_size = Vector2(150, 0)
title = "Animation"
slot/0/left_enabled = true
slot/0/left_type = 0
slot/0/left_color = Color(0, 0, 0, 1)
slot/0/right_enabled = true
slot/0/right_type = 0
slot/0/right_color = Color(0, 0, 0, 1)
slot/0/draw_stylebox = true
script = ExtResource("1_animation")
[node name="VBoxContainer" type="VBoxContainer" parent="."]
layout_mode = 2
[node name="Character" type="Label" parent="VBoxContainer"]
layout_mode = 2
text = "Character"
[node name="character" type="LineEdit" parent="VBoxContainer"]
layout_mode = 2
placeholder_text = "Character name"
[node name="Animation" type="Label" parent="VBoxContainer"]
layout_mode = 2
text = "Animation"
[node name="animation_name" type="LineEdit" parent="VBoxContainer"]
layout_mode = 2
placeholder_text = "Animation name"
[node name="Loop" type="Label" parent="VBoxContainer"]
layout_mode = 2
text = "Loop"
[node name="loop" type="CheckBox" parent="VBoxContainer"]
layout_mode = 2
[connection signal="text_changed" from="VBoxContainer/character" to="." method="_on_character_changed"]
[connection signal="text_changed" from="VBoxContainer/animation_name" to="." method="_on_animation_changed"]
[connection signal="toggled" from="VBoxContainer/loop" to="." method="_on_loop_toggled"]

View File

@@ -21,47 +21,11 @@ func _ready() -> void:
action_parameters["text"] = ""
action_parameters["duration"] = 0.0
func _setup_parameter_fields() -> void:
# Character field
var x = VBoxContainer.new()
add_child(x)
var char_label = Label.new()
char_label.text = "Character:"
char_label.hide()
x.add_child(char_label)
var char_field = LineEdit.new()
char_field.text = action_parameters["character"]
char_field.connect("text_changed", _on_character_changed)
x.add_child(char_field)
# Text field
var text_label = Label.new()
text_label.text = "Text:"
x.add_child(text_label)
var text_field = TextEdit.new()
text_field.text = action_parameters["text"]
text_field.size_flags_vertical = Control.SIZE_EXPAND_FILL
text_field.connect("text_changed", _on_text_changed)
x.add_child(text_field)
# Duration field
var duration_label = Label.new()
duration_label.text = "Duration:"
x.add_child(duration_label)
var duration_field = LineEdit.new()
duration_field.text = str(action_parameters["duration"])
duration_field.connect("text_changed", _on_duration_changed)
x.add_child(duration_field)
func _on_character_changed(new_text: String) -> void:
set_parameter("character", new_text)
func _on_text_changed() -> void:
var text_edit = get_child(get_child_count() - 2) # TextEdit is second to last child
set_parameter("text", text_edit.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

View File

@@ -0,0 +1,38 @@
[gd_scene load_steps=2 format=3 uid="uid://dialogueactionnodetscn"]
[ext_resource type="Script" path="res://addons/cutscene_editor/editor/nodes/DialogueActionNode.gd" id="1_dialogue"]
[node name="DialogueActionNode" type="GraphNode"]
modulate = Color(1.0, 1.0, 0.5, 1)
custom_minimum_size = Vector2(200, 100)
title = "Dialogue"
resizable = true
slot/0/left_enabled = true
slot/0/left_type = 0
slot/0/left_color = Color(0, 0, 0, 1)
slot/0/right_enabled = true
slot/0/right_type = 0
slot/0/right_color = Color(0, 0, 0, 1)
slot/0/draw_stylebox = true
script = ExtResource("1_dialogue")
[node name="VBoxContainer" type="VBoxContainer" parent="."]
layout_mode = 2
[node name="Character" type="Label" parent="VBoxContainer"]
layout_mode = 2
text = "Character"
[node name="character" type="LineEdit" parent="VBoxContainer"]
layout_mode = 2
placeholder_text = "Character name"
[node name="Text" type="Label" parent="VBoxContainer"]
layout_mode = 2
text = "Text"
[node name="text" type="TextEdit" parent="VBoxContainer"]
layout_mode = 2
size_flags_vertical = 3
[node name="Duration" type="Label" parent="VBoxContainer"]
layout_mode = 2
text = "Duration"
[node name="duration" type="LineEdit" parent="VBoxContainer"]
layout_mode = 2
placeholder_text = "Duration in seconds"
[connection signal="text_changed" from="VBoxContainer/character" to="." method="_on_character_changed"]
[connection signal="text_changed" from="VBoxContainer/text" to="." method="_on_text_changed"]
[connection signal="text_changed" from="VBoxContainer/duration" to="." method="_on_duration_changed"]

View File

@@ -0,0 +1,15 @@
[gd_scene load_steps=2 format=3 uid="uid://entrynodetscn"]
[ext_resource type="Script" path="res://addons/cutscene_editor/editor/nodes/EntryNode.gd" id="1_entry"]
[node name="EntryNode" type="GraphNode"]
modulate = Color(0.5, 1.0, 0.5, 1)
custom_minimum_size = Vector2(100, 0)
title = "Start"
slot/0/left_enabled = false
slot/0/left_type = 0
slot/0/left_color = Color(0, 0, 0, 0)
slot/0/right_enabled = true
slot/0/right_type = 0
slot/0/right_color = Color(0, 0, 0, 1)
slot/0/right_icon = null
slot/0/draw_stylebox = true
script = ExtResource("1_entry")

View File

@@ -0,0 +1,14 @@
[gd_scene load_steps=2 format=3 uid="uid://exitnodetscn"]
[ext_resource type="Script" path="res://addons/cutscene_editor/editor/nodes/ExitNode.gd" id="1_exit"]
[node name="ExitNode" type="GraphNode"]
modulate = Color(1.0, 0.5, 0.5, 1)
custom_minimum_size = Vector2(100, 0)
title = "End"
slot/0/left_enabled = true
slot/0/left_type = 0
slot/0/left_color = Color(0, 0, 0, 1)
slot/0/right_enabled = false
slot/0/right_type = 0
slot/0/right_color = Color(0, 0, 0, 0)
slot/0/draw_stylebox = true
script = ExtResource("1_exit")

View File

@@ -22,56 +22,6 @@ func _ready() -> void:
action_parameters["target_y"] = 0.0
action_parameters["speed"] = 100.0
func _setup_parameter_fields() -> void:
# Character field
var char_label = Label.new()
char_label.text = "Character:"
add_child(char_label)
var char_field = LineEdit.new()
char_field.text = action_parameters["character"]
char_field.connect("text_changed", _on_character_changed)
add_child(char_field)
# Target position fields
var pos_label = Label.new()
pos_label.text = "Target Position:"
add_child(pos_label)
var pos_container = HBoxContainer.new()
var x_label = Label.new()
x_label.text = "X:"
pos_container.add_child(x_label)
var x_field = LineEdit.new()
x_field.text = str(action_parameters["target_x"])
x_field.size_flags_horizontal = Control.SIZE_EXPAND_FILL
x_field.connect("text_changed", _on_target_x_changed)
pos_container.add_child(x_field)
var y_label = Label.new()
y_label.text = "Y:"
pos_container.add_child(y_label)
var y_field = LineEdit.new()
y_field.text = str(action_parameters["target_y"])
y_field.size_flags_horizontal = Control.SIZE_EXPAND_FILL
y_field.connect("text_changed", _on_target_y_changed)
pos_container.add_child(y_field)
add_child(pos_container)
# Speed field
var speed_label = Label.new()
speed_label.text = "Speed:"
add_child(speed_label)
var speed_field = LineEdit.new()
speed_field.text = str(action_parameters["speed"])
speed_field.connect("text_changed", _on_speed_changed)
add_child(speed_field)
func _on_character_changed(new_text: String) -> void:
set_parameter("character", new_text)
@@ -80,9 +30,12 @@ func _on_target_x_changed(new_text: String) -> void:
set_parameter("target_x", value)
func _on_target_y_changed(new_text: String) -> void:
print("toarget y")
var value = float(new_text) if new_text.is_valid_float() else 0.0
set_parameter("target_y", value)
func _on_speed_changed(new_text: String) -> void:
print("speed")
var value = float(new_text) if new_text.is_valid_float() else 100.0
set_parameter("speed", value)

View File

@@ -0,0 +1,56 @@
[gd_scene load_steps=2 format=3 uid="uid://y74lqsx8bpxn"]
[ext_resource type="Script" path="res://addons/cutscene_editor/editor/nodes/MoveActionNode.gd" id="1_5aood"]
[node name="MoveActionNode" type="GraphNode"]
modulate = Color(0.4, 0.6, 1, 1)
custom_minimum_size = Vector2(150, 0)
title = "Move"
slot/0/left_enabled = true
slot/0/left_type = 0
slot/0/left_color = Color(0, 0, 0, 1)
slot/0/left_icon = null
slot/0/right_enabled = true
slot/0/right_type = 0
slot/0/right_color = Color(0, 0, 0, 1)
slot/0/right_icon = null
slot/0/draw_stylebox = true
script = ExtResource("1_5aood")
[node name="VBoxContainer" type="VBoxContainer" parent="."]
layout_mode = 2
[node name="Character" type="Label" parent="VBoxContainer"]
layout_mode = 2
[node name="TextEdit" type="LineEdit" parent="VBoxContainer"]
custom_minimum_size = Vector2(0, 32.865)
layout_mode = 2
text = "aoeu"
placeholder_text = "aoeu"
[node name="Location" type="Label" parent="VBoxContainer"]
layout_mode = 2
text = "Location"
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"]
layout_mode = 2
[node name="x" type="LineEdit" parent="VBoxContainer/HBoxContainer"]
layout_mode = 2
[node name="y" type="LineEdit" parent="VBoxContainer/HBoxContainer"]
layout_mode = 2
[node name="Speed" type="Label" parent="VBoxContainer"]
layout_mode = 2
text = "Speed"
[node name="speed" type="LineEdit" parent="VBoxContainer"]
layout_mode = 2
[connection signal="text_changed" from="VBoxContainer/TextEdit" to="." method="_on_character_changed"]
[connection signal="text_changed" from="VBoxContainer/HBoxContainer/x" to="." method="_on_target_x_changed"]
[connection signal="text_changed" from="VBoxContainer/HBoxContainer/y" to="." method="_on_target_y_changed"]
[connection signal="text_change_rejected" from="VBoxContainer/speed" to="." method="_on_speed_text_change_rejected"]
[connection signal="text_changed" from="VBoxContainer/speed" to="." method="_on_speed_changed"]

View File

@@ -21,37 +21,6 @@ func _ready() -> void:
action_parameters["target"] = ""
action_parameters["turn_speed"] = 2.0
func _setup_parameter_fields() -> void:
# Character field
var char_label = Label.new()
char_label.text = "Character:"
add_child(char_label)
var char_field = LineEdit.new()
char_field.text = action_parameters["character"]
char_field.connect("text_changed", _on_character_changed)
add_child(char_field)
# Target field
var target_label = Label.new()
target_label.text = "Target:"
add_child(target_label)
var target_field = LineEdit.new()
target_field.text = action_parameters["target"]
target_field.connect("text_changed", _on_target_changed)
add_child(target_field)
# Turn speed field
var speed_label = Label.new()
speed_label.text = "Turn Speed:"
add_child(speed_label)
var speed_field = LineEdit.new()
speed_field.text = str(action_parameters["turn_speed"])
speed_field.connect("text_changed", _on_turn_speed_changed)
add_child(speed_field)
func _on_character_changed(new_text: String) -> void:
set_parameter("character", new_text)

View File

@@ -0,0 +1,37 @@
[gd_scene load_steps=2 format=3 uid="uid://turnactionnodetscn"]
[ext_resource type="Script" path="res://addons/cutscene_editor/editor/nodes/TurnActionNode.gd" id="1_turn"]
[node name="TurnActionNode" type="GraphNode"]
modulate = Color(0.5, 1.0, 0.5, 1)
custom_minimum_size = Vector2(150, 0)
title = "Turn"
slot/0/left_enabled = true
slot/0/left_type = 0
slot/0/left_color = Color(0, 0, 0, 1)
slot/0/right_enabled = true
slot/0/right_type = 0
slot/0/right_color = Color(0, 0, 0, 1)
slot/0/draw_stylebox = true
script = ExtResource("1_turn")
[node name="VBoxContainer" type="VBoxContainer" parent="."]
layout_mode = 2
[node name="Character" type="Label" parent="VBoxContainer"]
layout_mode = 2
text = "Character"
[node name="character" type="LineEdit" parent="VBoxContainer"]
layout_mode = 2
placeholder_text = "Character name"
[node name="Target" type="Label" parent="VBoxContainer"]
layout_mode = 2
text = "Target"
[node name="target" type="LineEdit" parent="VBoxContainer"]
layout_mode = 2
placeholder_text = "Target name"
[node name="TurnSpeed" type="Label" parent="VBoxContainer"]
layout_mode = 2
text = "Turn Speed"
[node name="turn_speed" type="LineEdit" parent="VBoxContainer"]
layout_mode = 2
placeholder_text = "Turn speed"
[connection signal="text_changed" from="VBoxContainer/character" to="." method="_on_character_changed"]
[connection signal="text_changed" from="VBoxContainer/target" to="." method="_on_target_changed"]
[connection signal="text_changed" from="VBoxContainer/turn_speed" to="." method="_on_turn_speed_changed"]

View File

@@ -19,17 +19,6 @@ func _ready() -> void:
# Initialize default parameters
action_parameters["duration"] = 1.0
func _setup_parameter_fields() -> void:
# Duration field
var duration_label = Label.new()
duration_label.text = "Duration:"
add_child(duration_label)
var duration_field = LineEdit.new()
duration_field.text = str(action_parameters["duration"])
duration_field.connect("text_changed", _on_duration_changed)
add_child(duration_field)
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)

View File

@@ -0,0 +1,26 @@
[gd_scene load_steps=2 format=3 uid="uid://waitnodetscn"]
[ext_resource type="Script" path="res://addons/cutscene_editor/editor/nodes/WaitActionNode.gd" id="1_wait"]
[node name="WaitActionNode" type="GraphNode"]
modulate = Color(0.7, 0.7, 0.7, 1)
custom_minimum_size = Vector2(150, 0)
title = "Wait"
slot/0/left_enabled = true
slot/0/left_type = 0
slot/0/left_color = Color(0, 0, 0, 1)
slot/0/left_icon = null
slot/0/right_enabled = true
slot/0/right_type = 0
slot/0/right_color = Color(0, 0, 0, 1)
slot/0/right_icon = null
slot/0/draw_stylebox = true
script = ExtResource("1_wait")
[node name="VBoxContainer" type="VBoxContainer" parent="."]
layout_mode = 2
[node name="Duration" type="Label" parent="VBoxContainer"]
layout_mode = 2
text = "Duration"
[node name="duration" type="LineEdit" parent="VBoxContainer"]
layout_mode = 2
text = "1.0"
placeholder_text = "Duration in seconds"
[connection signal="text_changed" from="VBoxContainer/duration" to="." method="_on_duration_changed"]