-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #178 from V-Sekai/next
Next
- Loading branch information
Showing
96 changed files
with
4,763 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2023 Jan Thomä | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
@tool | ||
@icon("all_of_guard.svg") | ||
|
||
## A composite guard that is satisfied when all of its guards are satisfied. | ||
class_name AllOfGuard | ||
extends Guard | ||
|
||
## The guards that need to be satisified. When empty, returns true. | ||
@export var guards:Array[Guard] = [] | ||
|
||
func is_satisfied(context_transition:Transition, context_state:StateChartState) -> bool: | ||
for guard in guards: | ||
if not guard.is_satisfied(context_transition, context_state): | ||
return false | ||
return true |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 38 additions & 0 deletions
38
11_vsekai_game/addons/godot_state_charts/all_of_guard.svg.import
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
[remap] | ||
|
||
importer="texture" | ||
type="CompressedTexture2D" | ||
uid="uid://ux4ia8xhhjrx" | ||
path="res://.godot/imported/all_of_guard.svg-49642db22a4a20844b2d39e67c930c8b.ctex" | ||
metadata={ | ||
"has_editor_variant": true, | ||
"vram_texture": false | ||
} | ||
|
||
[deps] | ||
|
||
source_file="res://addons/godot_state_charts/all_of_guard.svg" | ||
dest_files=["res://.godot/imported/all_of_guard.svg-49642db22a4a20844b2d39e67c930c8b.ctex"] | ||
|
||
[params] | ||
|
||
compress/mode=0 | ||
compress/high_quality=false | ||
compress/lossy_quality=0.7 | ||
compress/hdr_compression=1 | ||
compress/normal_map=0 | ||
compress/channel_pack=0 | ||
mipmaps/generate=false | ||
mipmaps/limit=-1 | ||
roughness/mode=0 | ||
roughness/src_normal="" | ||
process/fix_alpha_border=true | ||
process/premult_alpha=false | ||
process/normal_map_invert_y=false | ||
process/hdr_as_srgb=false | ||
process/hdr_clamp_exposure=false | ||
process/size_limit=0 | ||
detect_3d/compress_to=1 | ||
svg/scale=0.5 | ||
editor/scale_with_editor_scale=true | ||
editor/convert_colors_with_editor_theme=false |
62 changes: 62 additions & 0 deletions
62
11_vsekai_game/addons/godot_state_charts/animation_player_state.gd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
@tool | ||
@icon("animation_player_state.svg") | ||
class_name AnimationPlayerState | ||
extends AtomicState | ||
|
||
## Animation player that this state will use. | ||
@export_node_path("AnimationPlayer") var animation_player: NodePath: | ||
set(value): | ||
animation_player = value | ||
update_configuration_warnings() | ||
|
||
## The name of the animation that should be played when this state is entered. | ||
## When this is empty, the name of this state will be used. | ||
@export var animation_name: StringName = "" | ||
|
||
## A custom blend time for the animation. The default value of -1.0 will use the | ||
## default blend time of the animation player. | ||
@export var custom_blend: float = -1.0 | ||
|
||
## A custom speed for the animation. Use negative values to play the animation | ||
## backwards. | ||
@export var custom_speed: float = 1.0 | ||
|
||
## Whether the animation should be played from the end. | ||
@export var from_end: bool = false | ||
|
||
var _animation_player: AnimationPlayer | ||
|
||
func _ready(): | ||
if Engine.is_editor_hint(): | ||
return | ||
|
||
super._ready() | ||
_animation_player = get_node_or_null(animation_player) | ||
|
||
if not is_instance_valid(_animation_player): | ||
push_error("The animation player is invalid. This node will not work.") | ||
|
||
func _state_enter(expect_transition: bool = false): | ||
super._state_enter() | ||
|
||
if not is_instance_valid(_animation_player): | ||
return | ||
|
||
var target_animation = animation_name | ||
if target_animation == "": | ||
target_animation = get_name() | ||
|
||
if _animation_player.current_animation == target_animation and _animation_player.is_playing(): | ||
return | ||
|
||
_animation_player.play(target_animation, custom_blend, custom_speed, from_end) | ||
|
||
func _get_configuration_warnings(): | ||
var warnings = super._get_configuration_warnings() | ||
|
||
if animation_player.is_empty(): | ||
warnings.append("No animation player is set.") | ||
elif get_node_or_null(animation_player) == null: | ||
warnings.append("The animation player path is invalid.") | ||
|
||
return warnings |
20 changes: 20 additions & 0 deletions
20
11_vsekai_game/addons/godot_state_charts/animation_player_state.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 38 additions & 0 deletions
38
11_vsekai_game/addons/godot_state_charts/animation_player_state.svg.import
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
[remap] | ||
|
||
importer="texture" | ||
type="CompressedTexture2D" | ||
uid="uid://b3m20gsesp4i0" | ||
path="res://.godot/imported/animation_player_state.svg-1acd03c414690dd7446458c5293935cb.ctex" | ||
metadata={ | ||
"has_editor_variant": true, | ||
"vram_texture": false | ||
} | ||
|
||
[deps] | ||
|
||
source_file="res://addons/godot_state_charts/animation_player_state.svg" | ||
dest_files=["res://.godot/imported/animation_player_state.svg-1acd03c414690dd7446458c5293935cb.ctex"] | ||
|
||
[params] | ||
|
||
compress/mode=0 | ||
compress/high_quality=false | ||
compress/lossy_quality=0.7 | ||
compress/hdr_compression=1 | ||
compress/normal_map=0 | ||
compress/channel_pack=0 | ||
mipmaps/generate=false | ||
mipmaps/limit=-1 | ||
roughness/mode=0 | ||
roughness/src_normal="" | ||
process/fix_alpha_border=true | ||
process/premult_alpha=false | ||
process/normal_map_invert_y=false | ||
process/hdr_as_srgb=false | ||
process/hdr_clamp_exposure=false | ||
process/size_limit=0 | ||
detect_3d/compress_to=1 | ||
svg/scale=0.5 | ||
editor/scale_with_editor_scale=true | ||
editor/convert_colors_with_editor_theme=false |
Oops, something went wrong.