cutscene progress.
This commit is contained in:
31
addons/cutscene_editor/editor/nodes/MoveActionNode.gd
Executable file → Normal file
31
addons/cutscene_editor/editor/nodes/MoveActionNode.gd
Executable file → Normal file
@@ -6,46 +6,43 @@ extends "res://addons/cutscene_editor/editor/nodes/BaseGraphNode.gd"
|
||||
|
||||
func _init() -> void:
|
||||
node_type = "move"
|
||||
name = "move_" + str(randi())
|
||||
node_id = "move_" + str(randi())
|
||||
title = "Move"
|
||||
modulate = Color(0.4, 0.6, 1.0) # Blue
|
||||
|
||||
# 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["target_x"] = 0.0
|
||||
action_parameters["target_y"] = 0.0
|
||||
action_parameters["speed"] = 100.0
|
||||
|
||||
func set_parameter(pname, value) -> void:
|
||||
super.set_parameter(name, value)
|
||||
if pname == "character":
|
||||
$VBoxContainer/CharacterEDit.text = value
|
||||
elif pname == "target_x":
|
||||
$VBoxContainer/HBoxContainer/x.text = value
|
||||
elif pname == "target_y":
|
||||
$VBoxContainer/HBoxContainer/y.text = value
|
||||
elif pname == "speed":
|
||||
$VBoxContainer/speed.text = value
|
||||
func _ready() -> void:
|
||||
super._ready()
|
||||
func _parameters_to_view() -> void:
|
||||
$VBoxContainer/CharacterEDit.text = action_parameters["character"]
|
||||
$VBoxContainer/HBoxContainer/x.text = str(action_parameters["target_x"])
|
||||
$VBoxContainer/HBoxContainer/y.text = str(action_parameters["target_y"])
|
||||
$VBoxContainer/speed.text = str(action_parameters["speed"])
|
||||
|
||||
func _on_character_changed(new_text: String) -> void:
|
||||
print("character" , new_text)
|
||||
set_parameter("character", new_text)
|
||||
|
||||
func _on_target_x_changed(new_text: String) -> void:
|
||||
print("target x" , new_text)
|
||||
var value = float(new_text) if new_text.is_valid_float() else 0.0
|
||||
set_parameter("target_x", value)
|
||||
|
||||
func _on_target_y_changed(new_text: String) -> void:
|
||||
print("toarget y")
|
||||
print("toarget y" , new_text)
|
||||
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")
|
||||
print("speed", new_text)
|
||||
var value = float(new_text) if new_text.is_valid_float() else 100.0
|
||||
set_parameter("speed", value)
|
||||
|
||||
Reference in New Issue
Block a user