Skip to content

FrayCompoundState : change ready ordering for substate #86

Description

@Remi123

Welcome back.

Didn't play too much with new features yet, but I appreciate the get_node function. Reduce my code size by a lot.

here is my change for the ready function :

func ready(context: Dictionary) -> void:
	if not context.is_read_only():
		context.make_read_only()
	_ready_impl(context) # <--- new emplacement
	for state_name in _states:
		var state: FrayState = _states[state_name]

		if state is FrayCompoundState:
			state.ready(context)
		else:
			state._ready_impl(context)
        #_ready_impl(context) # <--- Changed ordering

I use _ready_impl to create new states and keep things together in the code.

Substate are created in _ready_impl, then each of them are made ready afterward.

Thank you

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions