cutscene progress.
This commit is contained in:
@@ -91,7 +91,8 @@ func _process(delta: float) -> void:
|
||||
# Main update loop
|
||||
if state != State.RUNNING:
|
||||
return
|
||||
# Find actions with no dependencies to start with
|
||||
|
||||
# Find actions with no dependencies to start with
|
||||
_find_ready_actions()
|
||||
|
||||
# Start all ready actions
|
||||
@@ -143,10 +144,44 @@ func _execute_action(action_id: String) -> void:
|
||||
# Start the action
|
||||
emit_signal("action_started", action)
|
||||
action.start()
|
||||
|
||||
_debug_state()
|
||||
|
||||
func _on_action_started(action: Action) -> void:
|
||||
# Handle action started
|
||||
emit_signal("action_started", action)
|
||||
_debug_state()
|
||||
|
||||
func _debug_state() -> void:
|
||||
# Print debug information about all actions and their dependencies
|
||||
print("=== Cutscene Manager Debug State ===")
|
||||
print("State: %s" % ["IDLE", "RUNNING", "PAUSED"][state])
|
||||
print("Actions count: %d" % actions.size())
|
||||
print("Ready actions: %d" % ready_actions.size())
|
||||
print("Active actions: %d" % active_actions.size())
|
||||
print("Completed actions: %d" % completed_actions.size())
|
||||
|
||||
for action_id in actions:
|
||||
var action = actions[action_id]
|
||||
var action_state = ["PENDING", "RUNNING", "COMPLETED", "FAILED"][action.state]
|
||||
|
||||
# Get dependencies for this action
|
||||
var deps = dependencies.get(action_id, [])
|
||||
var deps_status = []
|
||||
for dep_id in deps:
|
||||
if completed_actions.has(dep_id):
|
||||
deps_status.append("%s:COMPLETED" % dep_id)
|
||||
elif active_actions.has(actions[dep_id]):
|
||||
# Check if the dependency action is actually running
|
||||
deps_status.append("%s:RUNNING" % dep_id)
|
||||
else:
|
||||
deps_status.append("%s:PENDING" % dep_id)
|
||||
|
||||
var deps_str = ", ".join(deps_status) if deps_status.size() > 0 else "None"
|
||||
|
||||
print("Action '%s': %s (deps: %s)" % [action_id, action_state, deps_str])
|
||||
|
||||
print("====================================")
|
||||
|
||||
func _on_action_completed(action_id: String) -> void:
|
||||
# Handle action completion
|
||||
@@ -165,6 +200,8 @@ func _on_action_completed(action_id: String) -> void:
|
||||
# Start all newly ready actions
|
||||
for new_action_id in ready_actions:
|
||||
_execute_action(new_action_id)
|
||||
|
||||
_debug_state()
|
||||
|
||||
func _on_action_failed(action: Action, error_message: String) -> void:
|
||||
# Handle action failure
|
||||
|
||||
0
cutscene/actions/MoveAction.gd
Executable file → Normal file
0
cutscene/actions/MoveAction.gd
Executable file → Normal file
Reference in New Issue
Block a user