From 563fda39bbdae250aa402568229de036e1bc744e Mon Sep 17 00:00:00 2001 From: miguel Date: Sat, 21 Jan 2023 10:27:29 +0000 Subject: [PATCH] :bug: Godot4 beta 13+ fix: move @icon above class name (#96) :bug: move @icon above class name --- addons/beehave/nodes/beehave_root.gd | 2 +- addons/beehave/nodes/beehave_tree.gd | 2 +- addons/beehave/nodes/composites/composite.gd | 2 +- addons/beehave/nodes/composites/selector.gd | 2 +- .../nodes/composites/selector_random.gd | 2 +- .../beehave/nodes/composites/selector_star.gd | 2 +- addons/beehave/nodes/composites/sequence.gd | 2 +- .../nodes/composites/sequence_random.gd | 2 +- .../beehave/nodes/composites/sequence_star.gd | 2 +- addons/beehave/nodes/decorators/decorator.gd | 2 +- addons/beehave/nodes/decorators/failer.gd | 2 +- addons/beehave/nodes/decorators/inverter.gd | 2 +- addons/beehave/nodes/decorators/limiter.gd | 2 +- addons/beehave/nodes/decorators/succeeder.gd | 2 +- addons/beehave/nodes/leaves/action.gd | 2 +- addons/beehave/nodes/leaves/condition.gd | 2 +- addons/beehave/nodes/leaves/leaf.gd | 2 +- project.godot | 122 +----------------- 18 files changed, 21 insertions(+), 135 deletions(-) diff --git a/addons/beehave/nodes/beehave_root.gd b/addons/beehave/nodes/beehave_root.gd index e04a43a3..c5030a3a 100644 --- a/addons/beehave/nodes/beehave_root.gd +++ b/addons/beehave/nodes/beehave_root.gd @@ -1,7 +1,7 @@ ## Controls the flow of execution of the entire behaviour tree. @tool -class_name BeehaveRoot extends BeehaveTree @icon("../icons/tree.svg") +class_name BeehaveRoot extends BeehaveTree @export var enabled: bool = true: diff --git a/addons/beehave/nodes/beehave_tree.gd b/addons/beehave/nodes/beehave_tree.gd index 9712753c..5f8c7379 100644 --- a/addons/beehave/nodes/beehave_tree.gd +++ b/addons/beehave/nodes/beehave_tree.gd @@ -1,7 +1,7 @@ ## Base class for all parts of the behaviour tree. @tool -class_name BeehaveTree extends Node @icon("../icons/category_bt.svg") +class_name BeehaveTree extends Node enum { diff --git a/addons/beehave/nodes/composites/composite.gd b/addons/beehave/nodes/composites/composite.gd index 0d5ab771..303b6901 100644 --- a/addons/beehave/nodes/composites/composite.gd +++ b/addons/beehave/nodes/composites/composite.gd @@ -1,7 +1,7 @@ ## A Composite node controls the flow of execution of its children in a specific manner. @tool -class_name Composite extends BeehaveNode @icon("../../icons/category_composite.svg") +class_name Composite extends BeehaveNode var running_child: BeehaveNode = null diff --git a/addons/beehave/nodes/composites/selector.gd b/addons/beehave/nodes/composites/selector.gd index 137571d0..7b9b70a0 100644 --- a/addons/beehave/nodes/composites/selector.gd +++ b/addons/beehave/nodes/composites/selector.gd @@ -3,8 +3,8 @@ ## return `FAILURE`. This node will attempt to process all its children every ## single tick, even if one of them is currently `RUNNING` already. @tool -class_name SelectorComposite extends Composite @icon("../../icons/selector.svg") +class_name SelectorComposite extends Composite func tick(actor: Node, blackboard: Blackboard) -> int: for c in get_children(): diff --git a/addons/beehave/nodes/composites/selector_random.gd b/addons/beehave/nodes/composites/selector_random.gd index b1d90e25..5a5cee1a 100644 --- a/addons/beehave/nodes/composites/selector_random.gd +++ b/addons/beehave/nodes/composites/selector_random.gd @@ -2,8 +2,8 @@ ## [code]SelectorStar[/code] would, with the exception that the children ## will be executed in a random order. @tool -class_name SelectorRandomComposite extends Composite @icon("../../icons/selector_random.svg") +class_name SelectorRandomComposite extends Composite ## A shuffled list of the children that will be executed in reverse order. diff --git a/addons/beehave/nodes/composites/selector_star.gd b/addons/beehave/nodes/composites/selector_star.gd index b4b6edd8..ce05a6fd 100644 --- a/addons/beehave/nodes/composites/selector_star.gd +++ b/addons/beehave/nodes/composites/selector_star.gd @@ -3,8 +3,8 @@ ## return `FAILURE`. This node will skip all previous child nodes that were ## executed prior, in case one of the children is currently in `RUNNING` state. @tool -class_name SelectorStarComposite extends Composite @icon("../../icons/selector_reactive.svg") +class_name SelectorStarComposite extends Composite var last_execution_index = 0 diff --git a/addons/beehave/nodes/composites/sequence.gd b/addons/beehave/nodes/composites/sequence.gd index 33db5020..3aecf9a2 100644 --- a/addons/beehave/nodes/composites/sequence.gd +++ b/addons/beehave/nodes/composites/sequence.gd @@ -4,8 +4,8 @@ ## return `FAILURE`. This node will attempt to process all its children every ## single tick, even if one of them is currently `RUNNING` already. @tool -class_name SequenceComposite extends Composite @icon("../../icons/sequence.svg") +class_name SequenceComposite extends Composite func tick(actor: Node, blackboard: Blackboard) -> int: for c in get_children(): diff --git a/addons/beehave/nodes/composites/sequence_random.gd b/addons/beehave/nodes/composites/sequence_random.gd index b751c31b..72db771e 100644 --- a/addons/beehave/nodes/composites/sequence_random.gd +++ b/addons/beehave/nodes/composites/sequence_random.gd @@ -2,8 +2,8 @@ ## [code]SequenceStar[/code] would, with the exception that the children ## will be executed in a random order. @tool -class_name SequenceRandomComposite extends Composite @icon("../../icons/sequence_random.svg") +class_name SequenceRandomComposite extends Composite ## Whether the sequence should start where it left off after a previous failure. diff --git a/addons/beehave/nodes/composites/sequence_star.gd b/addons/beehave/nodes/composites/sequence_star.gd index 8ff8004b..eaeb3967 100644 --- a/addons/beehave/nodes/composites/sequence_star.gd +++ b/addons/beehave/nodes/composites/sequence_star.gd @@ -4,8 +4,8 @@ ## return `FAILURE`. This node will skip all previous child nodes that succeeded ## prior, in case one of the children is currently in `RUNNING` state @tool -class_name SequenceStarComposite extends Composite @icon("../../icons/sequence_reactive.svg") +class_name SequenceStarComposite extends Composite var successful_index = 0 diff --git a/addons/beehave/nodes/decorators/decorator.gd b/addons/beehave/nodes/decorators/decorator.gd index e2ec4fcd..b85086f8 100644 --- a/addons/beehave/nodes/decorators/decorator.gd +++ b/addons/beehave/nodes/decorators/decorator.gd @@ -1,8 +1,8 @@ ## Decorator nodes are used to transform the result received by its child. ## Must only have one child. @tool -class_name Decorator extends BeehaveNode @icon("../../icons/category_decorator.svg") +class_name Decorator extends BeehaveNode func _ready(): diff --git a/addons/beehave/nodes/decorators/failer.gd b/addons/beehave/nodes/decorators/failer.gd index 5a1a4878..43907865 100644 --- a/addons/beehave/nodes/decorators/failer.gd +++ b/addons/beehave/nodes/decorators/failer.gd @@ -1,7 +1,7 @@ ## A Failer node will always return a `FAILURE` status code. @tool -class_name AlwaysFailDecorator extends Decorator @icon("../../icons/failer.svg") +class_name AlwaysFailDecorator extends Decorator func tick(actor: Node, blackboard: Blackboard) -> int: diff --git a/addons/beehave/nodes/decorators/inverter.gd b/addons/beehave/nodes/decorators/inverter.gd index e834011a..48395435 100644 --- a/addons/beehave/nodes/decorators/inverter.gd +++ b/addons/beehave/nodes/decorators/inverter.gd @@ -1,8 +1,8 @@ ## An inverter will return `FAILURE` in case it's child returns a `SUCCESS` status ## code or `SUCCESS` in case its child returns a `FAILURE` status code. @tool -class_name InverterDecorator extends Decorator @icon("../../icons/inverter.svg") +class_name InverterDecorator extends Decorator func tick(actor: Node, blackboard: Blackboard) -> int: for c in get_children(): diff --git a/addons/beehave/nodes/decorators/limiter.gd b/addons/beehave/nodes/decorators/limiter.gd index deddaf9c..701974fb 100644 --- a/addons/beehave/nodes/decorators/limiter.gd +++ b/addons/beehave/nodes/decorators/limiter.gd @@ -1,8 +1,8 @@ ## The limiter will execute its child `x` amount of times. When the number of ## maximum ticks is reached, it will return a `FAILURE` status code. @tool -class_name LimiterDecorator extends Decorator @icon("../../icons/limiter.svg") +class_name LimiterDecorator extends Decorator @onready var cache_key = 'limiter_%s' % self.get_instance_id() diff --git a/addons/beehave/nodes/decorators/succeeder.gd b/addons/beehave/nodes/decorators/succeeder.gd index 5219ee8b..798e2e6e 100644 --- a/addons/beehave/nodes/decorators/succeeder.gd +++ b/addons/beehave/nodes/decorators/succeeder.gd @@ -1,7 +1,7 @@ ## A succeeder node will always return a `SUCCESS` status code. @tool -class_name AlwaysSucceedDecorator extends Decorator @icon("../../icons/succeeder.svg") +class_name AlwaysSucceedDecorator extends Decorator func tick(actor: Node, blackboard: Blackboard) -> int: diff --git a/addons/beehave/nodes/leaves/action.gd b/addons/beehave/nodes/leaves/action.gd index 81f46557..90376fe3 100644 --- a/addons/beehave/nodes/leaves/action.gd +++ b/addons/beehave/nodes/leaves/action.gd @@ -3,5 +3,5 @@ ## frame executions. In this case, the node should return `RUNNING` until the ## action is completed. @tool -class_name ActionLeaf extends Leaf @icon("../../icons/action.svg") +class_name ActionLeaf extends Leaf diff --git a/addons/beehave/nodes/leaves/condition.gd b/addons/beehave/nodes/leaves/condition.gd index e3bda68c..5a3ca08e 100644 --- a/addons/beehave/nodes/leaves/condition.gd +++ b/addons/beehave/nodes/leaves/condition.gd @@ -1,5 +1,5 @@ ## Conditions are leaf nodes that either return SUCCESS or FAILURE depending on ## a single simple condition. They should never return `RUNNING`. @tool -class_name ConditionLeaf extends Leaf @icon("../../icons/condition.svg") +class_name ConditionLeaf extends Leaf diff --git a/addons/beehave/nodes/leaves/leaf.gd b/addons/beehave/nodes/leaves/leaf.gd index 4dec9eeb..ff156a6f 100644 --- a/addons/beehave/nodes/leaves/leaf.gd +++ b/addons/beehave/nodes/leaves/leaf.gd @@ -1,7 +1,7 @@ ## Base class for all leaf nodes of the tree. @tool -class_name Leaf extends BeehaveNode @icon("../../icons/category_leaf.svg") +class_name Leaf extends BeehaveNode func _get_configuration_warnings() -> PackedStringArray: diff --git a/project.godot b/project.godot index f3ed8561..2bba9126 100644 --- a/project.godot +++ b/project.godot @@ -8,124 +8,6 @@ config_version=5 -_global_script_classes=[{ -"base": "Leaf", -"class": &"ActionLeaf", -"language": &"GDScript", -"path": "res://addons/beehave/nodes/leaves/action.gd" -}, { -"base": "Decorator", -"class": &"AlwaysFailDecorator", -"language": &"GDScript", -"path": "res://addons/beehave/nodes/decorators/failer.gd" -}, { -"base": "Decorator", -"class": &"AlwaysSucceedDecorator", -"language": &"GDScript", -"path": "res://addons/beehave/nodes/decorators/succeeder.gd" -}, { -"base": "BeehaveTree", -"class": &"BeehaveNode", -"language": &"GDScript", -"path": "res://addons/beehave/nodes/beehave_node.gd" -}, { -"base": "BeehaveTree", -"class": &"BeehaveRoot", -"language": &"GDScript", -"path": "res://addons/beehave/nodes/beehave_root.gd" -}, { -"base": "Node", -"class": &"BeehaveTree", -"language": &"GDScript", -"path": "res://addons/beehave/nodes/beehave_tree.gd" -}, { -"base": "RefCounted", -"class": &"Blackboard", -"language": &"GDScript", -"path": "res://addons/beehave/blackboard.gd" -}, { -"base": "BeehaveNode", -"class": &"Composite", -"language": &"GDScript", -"path": "res://addons/beehave/nodes/composites/composite.gd" -}, { -"base": "Leaf", -"class": &"ConditionLeaf", -"language": &"GDScript", -"path": "res://addons/beehave/nodes/leaves/condition.gd" -}, { -"base": "BeehaveNode", -"class": &"Decorator", -"language": &"GDScript", -"path": "res://addons/beehave/nodes/decorators/decorator.gd" -}, { -"base": "Decorator", -"class": &"InverterDecorator", -"language": &"GDScript", -"path": "res://addons/beehave/nodes/decorators/inverter.gd" -}, { -"base": "BeehaveNode", -"class": &"Leaf", -"language": &"GDScript", -"path": "res://addons/beehave/nodes/leaves/leaf.gd" -}, { -"base": "Decorator", -"class": &"LimiterDecorator", -"language": &"GDScript", -"path": "res://addons/beehave/nodes/decorators/limiter.gd" -}, { -"base": "Composite", -"class": &"SelectorComposite", -"language": &"GDScript", -"path": "res://addons/beehave/nodes/composites/selector.gd" -}, { -"base": "Composite", -"class": &"SelectorRandomComposite", -"language": &"GDScript", -"path": "res://addons/beehave/nodes/composites/selector_random.gd" -}, { -"base": "Composite", -"class": &"SelectorStarComposite", -"language": &"GDScript", -"path": "res://addons/beehave/nodes/composites/selector_star.gd" -}, { -"base": "Composite", -"class": &"SequenceComposite", -"language": &"GDScript", -"path": "res://addons/beehave/nodes/composites/sequence.gd" -}, { -"base": "Composite", -"class": &"SequenceRandomComposite", -"language": &"GDScript", -"path": "res://addons/beehave/nodes/composites/sequence_random.gd" -}, { -"base": "Composite", -"class": &"SequenceStarComposite", -"language": &"GDScript", -"path": "res://addons/beehave/nodes/composites/sequence_star.gd" -}] -_global_script_class_icons={ -"ActionLeaf": "res://addons/beehave/icons/action.svg", -"AlwaysFailDecorator": "res://addons/beehave/icons/failer.svg", -"AlwaysSucceedDecorator": "res://addons/beehave/icons/succeeder.svg", -"BeehaveNode": "", -"BeehaveRoot": "res://addons/beehave/icons/tree.svg", -"BeehaveTree": "res://addons/beehave/icons/category_bt.svg", -"Blackboard": "", -"Composite": "res://addons/beehave/icons/category_composite.svg", -"ConditionLeaf": "res://addons/beehave/icons/condition.svg", -"Decorator": "res://addons/beehave/icons/category_decorator.svg", -"InverterDecorator": "res://addons/beehave/icons/inverter.svg", -"Leaf": "res://addons/beehave/icons/category_leaf.svg", -"LimiterDecorator": "res://addons/beehave/icons/limiter.svg", -"SelectorComposite": "res://addons/beehave/icons/selector.svg", -"SelectorRandomComposite": "res://addons/beehave/icons/selector_random.svg", -"SelectorStarComposite": "res://addons/beehave/icons/selector_reactive.svg", -"SequenceComposite": "res://addons/beehave/icons/sequence.svg", -"SequenceRandomComposite": "res://addons/beehave/icons/sequence_random.svg", -"SequenceStarComposite": "res://addons/beehave/icons/sequence_reactive.svg" -} - [application] config/name="Beehave" @@ -135,6 +17,10 @@ boot_splash/image="res://splash.png" boot_splash/fullsize=false config/icon="res://icon.png" +[editor] + +export/convert_text_resources_to_binary=true + [editor_plugins] enabled=PackedStringArray("res://addons/beehave/plugin.cfg")