Skip to content

Commit

Permalink
chore: prepare release
Browse files Browse the repository at this point in the history
  • Loading branch information
derkork committed Dec 14, 2023
1 parent c8a1c15 commit 08cb648
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
8 changes: 8 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [0.11.0] - 2023-12-14
### Added
- When adding the first child state to a compound state in the editor, this will now automatically be set as the initial state of the compound state. A big thanks goes out to [Roger](https://github.com/RogerRandomDev) for submitting a PR with this feature.

### Fixed
- Some of the node warnings have been clarified to make it easier to understand what is going on.
- Some fringe errors that may happen when you add unrelated nodes below state or transition nodes have been addressed.


## [0.10.0] - 2023-12-13
### Added
Expand Down
14 changes: 14 additions & 0 deletions addons/godot_state_charts/compound_state.gd
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,20 @@ func _handle_transition(transition:Transition, source:State):
get_parent()._handle_transition(transition, source)


func add_child(node:Node, force_readable_name:bool = false, internal:InternalMode = INTERNAL_MODE_DISABLED) -> void:
super.add_child(node, force_readable_name, internal)
# when a child is added in the editor and the child is a state
# and we don't have an initial state yet, set the initial state
# to the newly added child
if Engine.is_editor_hint() and node is State:
if initial_state.is_empty():
# the newly added node may have a random name now,
# so we need to defer the call to build a node path
# to the next frame, so the editor has time to rename
# the node to its final name
(func(): initial_state = get_path_to(node)).call_deferred()


func _get_configuration_warnings() -> PackedStringArray:
var warnings = super._get_configuration_warnings()

Expand Down
2 changes: 1 addition & 1 deletion addons/godot_state_charts/plugin.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
name="Godot State Charts"
description="A simple, yet powerful state charts library for Godot"
author="Jan Thomä & Contributors"
version="0.10.0"
version="0.11.0"
script="godot_state_charts.gd"

0 comments on commit 08cb648

Please sign in to comment.